diff --git a/clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts b/clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts index c41373c74b0c..e8c60d2f598e 100644 --- a/clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts +++ b/clients/client-accessanalyzer/protocols/Aws_restJson1_1.ts @@ -2908,23 +2908,18 @@ const serializeAws_restJson1_1Criterion = ( input: Criterion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.contains !== undefined) { - bodyParams["contains"] = serializeAws_restJson1_1ValueList( - input.contains, - context - ); - } - if (input.eq !== undefined) { - bodyParams["eq"] = serializeAws_restJson1_1ValueList(input.eq, context); - } - if (input.exists !== undefined) { - bodyParams["exists"] = input.exists; - } - if (input.neq !== undefined) { - bodyParams["neq"] = serializeAws_restJson1_1ValueList(input.neq, context); - } - return bodyParams; + return { + ...(input.contains !== undefined && { + contains: serializeAws_restJson1_1ValueList(input.contains, context) + }), + ...(input.eq !== undefined && { + eq: serializeAws_restJson1_1ValueList(input.eq, context) + }), + ...(input.exists !== undefined && { exists: input.exists }), + ...(input.neq !== undefined && { + neq: serializeAws_restJson1_1ValueList(input.neq, context) + }) + }; }; const serializeAws_restJson1_1FilterCriteriaMap = ( @@ -2948,17 +2943,12 @@ const serializeAws_restJson1_1InlineArchiveRule = ( input: InlineArchiveRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_restJson1_1FilterCriteriaMap( - input.filter, - context - ); - } - if (input.ruleName !== undefined) { - bodyParams["ruleName"] = input.ruleName; - } - return bodyParams; + return { + ...(input.filter !== undefined && { + filter: serializeAws_restJson1_1FilterCriteriaMap(input.filter, context) + }), + ...(input.ruleName !== undefined && { ruleName: input.ruleName }) + }; }; const serializeAws_restJson1_1InlineArchiveRulesList = ( @@ -2974,14 +2964,12 @@ const serializeAws_restJson1_1SortCriteria = ( input: SortCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributeName !== undefined) { - bodyParams["attributeName"] = input.attributeName; - } - if (input.orderBy !== undefined) { - bodyParams["orderBy"] = input.orderBy; - } - return bodyParams; + return { + ...(input.attributeName !== undefined && { + attributeName: input.attributeName + }), + ...(input.orderBy !== undefined && { orderBy: input.orderBy }) + }; }; const serializeAws_restJson1_1TagsMap = ( diff --git a/clients/client-acm-pca/protocols/Aws_json1_1.ts b/clients/client-acm-pca/protocols/Aws_json1_1.ts index f35d0413bd30..3331f7b7fb6f 100644 --- a/clients/client-acm-pca/protocols/Aws_json1_1.ts +++ b/clients/client-acm-pca/protocols/Aws_json1_1.ts @@ -2816,50 +2816,32 @@ const serializeAws_json1_1ASN1Subject = ( input: ASN1Subject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommonName !== undefined) { - bodyParams["CommonName"] = input.CommonName; - } - if (input.Country !== undefined) { - bodyParams["Country"] = input.Country; - } - if (input.DistinguishedNameQualifier !== undefined) { - bodyParams["DistinguishedNameQualifier"] = input.DistinguishedNameQualifier; - } - if (input.GenerationQualifier !== undefined) { - bodyParams["GenerationQualifier"] = input.GenerationQualifier; - } - if (input.GivenName !== undefined) { - bodyParams["GivenName"] = input.GivenName; - } - if (input.Initials !== undefined) { - bodyParams["Initials"] = input.Initials; - } - if (input.Locality !== undefined) { - bodyParams["Locality"] = input.Locality; - } - if (input.Organization !== undefined) { - bodyParams["Organization"] = input.Organization; - } - if (input.OrganizationalUnit !== undefined) { - bodyParams["OrganizationalUnit"] = input.OrganizationalUnit; - } - if (input.Pseudonym !== undefined) { - bodyParams["Pseudonym"] = input.Pseudonym; - } - if (input.SerialNumber !== undefined) { - bodyParams["SerialNumber"] = input.SerialNumber; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - if (input.Surname !== undefined) { - bodyParams["Surname"] = input.Surname; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ActionList = ( @@ -2873,369 +2855,325 @@ const serializeAws_json1_1CertificateAuthorityConfiguration = ( input: CertificateAuthorityConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyAlgorithm !== undefined) { - bodyParams["KeyAlgorithm"] = input.KeyAlgorithm; - } - if (input.SigningAlgorithm !== undefined) { - bodyParams["SigningAlgorithm"] = input.SigningAlgorithm; - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = serializeAws_json1_1ASN1Subject( - input.Subject, - context - ); - } - return bodyParams; + return { + ...(input.KeyAlgorithm !== undefined && { + KeyAlgorithm: input.KeyAlgorithm + }), + ...(input.SigningAlgorithm !== undefined && { + SigningAlgorithm: input.SigningAlgorithm + }), + ...(input.Subject !== undefined && { + Subject: serializeAws_json1_1ASN1Subject(input.Subject, context) + }) + }; }; const serializeAws_json1_1CreateCertificateAuthorityAuditReportRequest = ( input: CreateCertificateAuthorityAuditReportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuditReportResponseFormat !== undefined) { - bodyParams["AuditReportResponseFormat"] = input.AuditReportResponseFormat; - } - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - return bodyParams; + return { + ...(input.AuditReportResponseFormat !== undefined && { + AuditReportResponseFormat: input.AuditReportResponseFormat + }), + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.S3BucketName !== undefined && { + S3BucketName: input.S3BucketName + }) + }; }; const serializeAws_json1_1CreateCertificateAuthorityRequest = ( input: CreateCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityConfiguration !== undefined) { - bodyParams[ - "CertificateAuthorityConfiguration" - ] = serializeAws_json1_1CertificateAuthorityConfiguration( - input.CertificateAuthorityConfiguration, - context - ); - } - if (input.CertificateAuthorityType !== undefined) { - bodyParams["CertificateAuthorityType"] = input.CertificateAuthorityType; - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.RevocationConfiguration !== undefined) { - bodyParams[ - "RevocationConfiguration" - ] = serializeAws_json1_1RevocationConfiguration( - input.RevocationConfiguration, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreatePermissionRequest = ( input: CreatePermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_json1_1ActionList( - input.Actions, - context - ); - } - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = input.Principal; - } - if (input.SourceAccount !== undefined) { - bodyParams["SourceAccount"] = input.SourceAccount; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CrlConfiguration = ( input: CrlConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomCname !== undefined) { - bodyParams["CustomCname"] = input.CustomCname; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.ExpirationInDays !== undefined) { - bodyParams["ExpirationInDays"] = input.ExpirationInDays; - } - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteCertificateAuthorityRequest = ( input: DeleteCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.PermanentDeletionTimeInDays !== undefined) { - bodyParams["PermanentDeletionTimeInDays"] = - input.PermanentDeletionTimeInDays; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.PermanentDeletionTimeInDays !== undefined && { + PermanentDeletionTimeInDays: input.PermanentDeletionTimeInDays + }) + }; }; const serializeAws_json1_1DeletePermissionRequest = ( input: DeletePermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = input.Principal; - } - if (input.SourceAccount !== undefined) { - bodyParams["SourceAccount"] = input.SourceAccount; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.Principal !== undefined && { Principal: input.Principal }), + ...(input.SourceAccount !== undefined && { + SourceAccount: input.SourceAccount + }) + }; }; const serializeAws_json1_1DescribeCertificateAuthorityAuditReportRequest = ( input: DescribeCertificateAuthorityAuditReportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuditReportId !== undefined) { - bodyParams["AuditReportId"] = input.AuditReportId; - } - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - return bodyParams; + return { + ...(input.AuditReportId !== undefined && { + AuditReportId: input.AuditReportId + }), + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }) + }; }; const serializeAws_json1_1DescribeCertificateAuthorityRequest = ( input: DescribeCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }) + }; }; const serializeAws_json1_1GetCertificateAuthorityCertificateRequest = ( input: GetCertificateAuthorityCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }) + }; }; const serializeAws_json1_1GetCertificateAuthorityCsrRequest = ( input: GetCertificateAuthorityCsrRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }) + }; }; const serializeAws_json1_1GetCertificateRequest = ( input: GetCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }) + }; }; const serializeAws_json1_1ImportCertificateAuthorityCertificateRequest = ( input: ImportCertificateAuthorityCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = context.base64Encoder(input.Certificate); - } - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.CertificateChain !== undefined) { - bodyParams["CertificateChain"] = context.base64Encoder( - input.CertificateChain - ); - } - return bodyParams; + return { + ...(input.Certificate !== undefined && { + Certificate: context.base64Encoder(input.Certificate) + }), + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.CertificateChain !== undefined && { + CertificateChain: context.base64Encoder(input.CertificateChain) + }) + }; }; const serializeAws_json1_1IssueCertificateRequest = ( input: IssueCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.Csr !== undefined) { - bodyParams["Csr"] = context.base64Encoder(input.Csr); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.SigningAlgorithm !== undefined) { - bodyParams["SigningAlgorithm"] = input.SigningAlgorithm; - } - if (input.TemplateArn !== undefined) { - bodyParams["TemplateArn"] = input.TemplateArn; - } - if (input.Validity !== undefined) { - bodyParams["Validity"] = serializeAws_json1_1Validity( - input.Validity, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListCertificateAuthoritiesRequest = ( input: ListCertificateAuthoritiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPermissionsRequest = ( input: ListPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsRequest = ( input: ListTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1RestoreCertificateAuthorityRequest = ( input: RestoreCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }) + }; }; const serializeAws_json1_1RevocationConfiguration = ( input: RevocationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrlConfiguration !== undefined) { - bodyParams["CrlConfiguration"] = serializeAws_json1_1CrlConfiguration( - input.CrlConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.CrlConfiguration !== undefined && { + CrlConfiguration: serializeAws_json1_1CrlConfiguration( + input.CrlConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1RevokeCertificateRequest = ( input: RevokeCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.CertificateSerial !== undefined) { - bodyParams["CertificateSerial"] = input.CertificateSerial; - } - if (input.RevocationReason !== undefined) { - bodyParams["RevocationReason"] = input.RevocationReason; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.CertificateSerial !== undefined && { + CertificateSerial: input.CertificateSerial + }), + ...(input.RevocationReason !== undefined && { + RevocationReason: input.RevocationReason + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagCertificateAuthorityRequest = ( input: TagCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TagList = ( @@ -3249,50 +3187,42 @@ const serializeAws_json1_1UntagCertificateAuthorityRequest = ( input: UntagCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UpdateCertificateAuthorityRequest = ( input: UpdateCertificateAuthorityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.RevocationConfiguration !== undefined) { - bodyParams[ - "RevocationConfiguration" - ] = serializeAws_json1_1RevocationConfiguration( - input.RevocationConfiguration, - context - ); - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + CertificateAuthorityArn: input.CertificateAuthorityArn + }), + ...(input.RevocationConfiguration !== undefined && { + RevocationConfiguration: serializeAws_json1_1RevocationConfiguration( + input.RevocationConfiguration, + context + ) + }), + ...(input.Status !== undefined && { Status: input.Status }) + }; }; const serializeAws_json1_1Validity = ( input: Validity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const deserializeAws_json1_1ASN1Subject = ( diff --git a/clients/client-acm/protocols/Aws_json1_1.ts b/clients/client-acm/protocols/Aws_json1_1.ts index 2d228a1b5bbb..c3dbbbf51b32 100644 --- a/clients/client-acm/protocols/Aws_json1_1.ts +++ b/clients/client-acm/protocols/Aws_json1_1.ts @@ -1692,26 +1692,26 @@ const serializeAws_json1_1AddTagsToCertificateRequest = ( input: AddTagsToCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CertificateOptions = ( input: CertificateOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateTransparencyLoggingPreference !== undefined) { - bodyParams["CertificateTransparencyLoggingPreference"] = - input.CertificateTransparencyLoggingPreference; - } - return bodyParams; + return { + ...(input.CertificateTransparencyLoggingPreference !== undefined && { + CertificateTransparencyLoggingPreference: + input.CertificateTransparencyLoggingPreference + }) + }; }; const serializeAws_json1_1CertificateStatuses = ( @@ -1725,22 +1725,22 @@ const serializeAws_json1_1DeleteCertificateRequest = ( input: DeleteCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1DescribeCertificateRequest = ( input: DescribeCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1DomainList = ( @@ -1754,14 +1754,12 @@ const serializeAws_json1_1DomainValidationOption = ( input: DomainValidationOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.ValidationDomain !== undefined) { - bodyParams["ValidationDomain"] = input.ValidationDomain; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.ValidationDomain !== undefined && { + ValidationDomain: input.ValidationDomain + }) + }; }; const serializeAws_json1_1DomainValidationOptionList = ( @@ -1777,14 +1775,14 @@ const serializeAws_json1_1ExportCertificateRequest = ( input: ExportCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Passphrase !== undefined) { - bodyParams["Passphrase"] = context.base64Encoder(input.Passphrase); - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.Passphrase !== undefined && { + Passphrase: context.base64Encoder(input.Passphrase) + }) + }; }; const serializeAws_json1_1ExtendedKeyUsageFilterList = ( @@ -1798,64 +1796,54 @@ const serializeAws_json1_1Filters = ( input: Filters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.extendedKeyUsage !== undefined) { - bodyParams[ - "extendedKeyUsage" - ] = serializeAws_json1_1ExtendedKeyUsageFilterList( - input.extendedKeyUsage, - context - ); - } - if (input.keyTypes !== undefined) { - bodyParams["keyTypes"] = serializeAws_json1_1KeyAlgorithmList( - input.keyTypes, - context - ); - } - if (input.keyUsage !== undefined) { - bodyParams["keyUsage"] = serializeAws_json1_1KeyUsageFilterList( - input.keyUsage, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetCertificateRequest = ( input: GetCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1ImportCertificateRequest = ( input: ImportCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = context.base64Encoder(input.Certificate); - } - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.CertificateChain !== undefined) { - bodyParams["CertificateChain"] = context.base64Encoder( - input.CertificateChain - ); - } - if (input.PrivateKey !== undefined) { - bodyParams["PrivateKey"] = context.base64Encoder(input.PrivateKey); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1KeyAlgorithmList = ( @@ -1876,133 +1864,113 @@ const serializeAws_json1_1ListCertificatesRequest = ( input: ListCertificatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateStatuses !== undefined) { - bodyParams["CertificateStatuses"] = serializeAws_json1_1CertificateStatuses( - input.CertificateStatuses, - context - ); - } - if (input.Includes !== undefined) { - bodyParams["Includes"] = serializeAws_json1_1Filters( - input.Includes, - context - ); - } - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTagsForCertificateRequest = ( input: ListTagsForCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1RemoveTagsFromCertificateRequest = ( input: RemoveTagsFromCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1RenewCertificateRequest = ( input: RenewCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1RequestCertificateRequest = ( input: RequestCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.DomainValidationOptions !== undefined) { - bodyParams[ - "DomainValidationOptions" - ] = serializeAws_json1_1DomainValidationOptionList( - input.DomainValidationOptions, - context - ); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.Options !== undefined) { - bodyParams["Options"] = serializeAws_json1_1CertificateOptions( - input.Options, - context - ); - } - if (input.SubjectAlternativeNames !== undefined) { - bodyParams["SubjectAlternativeNames"] = serializeAws_json1_1DomainList( - input.SubjectAlternativeNames, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.ValidationMethod !== undefined) { - bodyParams["ValidationMethod"] = input.ValidationMethod; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ResendValidationEmailRequest = ( input: ResendValidationEmailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.ValidationDomain !== undefined) { - bodyParams["ValidationDomain"] = input.ValidationDomain; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.ValidationDomain !== undefined && { + ValidationDomain: input.ValidationDomain + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagList = ( @@ -2016,17 +1984,14 @@ const serializeAws_json1_1UpdateCertificateOptionsRequest = ( input: UpdateCertificateOptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Options !== undefined) { - bodyParams["Options"] = serializeAws_json1_1CertificateOptions( - input.Options, - context - ); - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.Options !== undefined && { + Options: serializeAws_json1_1CertificateOptions(input.Options, context) + }) + }; }; const deserializeAws_json1_1CertificateDetail = ( 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 c35a7a2137f1..5edbed31983b 100644 --- a/clients/client-alexa-for-business/protocols/Aws_json1_1.ts +++ b/clients/client-alexa-for-business/protocols/Aws_json1_1.ts @@ -8647,17 +8647,12 @@ const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValueList(input.Values, context) + }) + }; }; const serializeAws_json1_1FilterList = ( @@ -8678,59 +8673,47 @@ const serializeAws_json1_1IPDialIn = ( input: IPDialIn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommsProtocol !== undefined) { - bodyParams["CommsProtocol"] = input.CommsProtocol; - } - if (input.Endpoint !== undefined) { - bodyParams["Endpoint"] = input.Endpoint; - } - return bodyParams; + return { + ...(input.CommsProtocol !== undefined && { + CommsProtocol: input.CommsProtocol + }), + ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }) + }; }; const serializeAws_json1_1MeetingSetting = ( input: MeetingSetting, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RequirePin !== undefined) { - bodyParams["RequirePin"] = input.RequirePin; - } - return bodyParams; + return { + ...(input.RequirePin !== undefined && { RequirePin: input.RequirePin }) + }; }; const serializeAws_json1_1PSTNDialIn = ( input: PSTNDialIn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CountryCode !== undefined) { - bodyParams["CountryCode"] = input.CountryCode; - } - if (input.OneClickIdDelay !== undefined) { - bodyParams["OneClickIdDelay"] = input.OneClickIdDelay; - } - if (input.OneClickPinDelay !== undefined) { - bodyParams["OneClickPinDelay"] = input.OneClickPinDelay; - } - if (input.PhoneNumber !== undefined) { - bodyParams["PhoneNumber"] = input.PhoneNumber; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Audio = ( input: Audio, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Locale !== undefined) { - bodyParams["Locale"] = input.Locale; - } - if (input.Location !== undefined) { - bodyParams["Location"] = input.Location; - } - return bodyParams; + return { + ...(input.Locale !== undefined && { Locale: input.Locale }), + ...(input.Location !== undefined && { Location: input.Location }) + }; }; const serializeAws_json1_1AudioList = ( @@ -8744,66 +8727,45 @@ const serializeAws_json1_1Content = ( input: Content, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioList !== undefined) { - bodyParams["AudioList"] = serializeAws_json1_1AudioList( - input.AudioList, - context - ); - } - if (input.SsmlList !== undefined) { - bodyParams["SsmlList"] = serializeAws_json1_1SsmlList( - input.SsmlList, - context - ); - } - if (input.TextList !== undefined) { - bodyParams["TextList"] = serializeAws_json1_1TextList( - input.TextList, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SendAnnouncementRequest = ( input: SendAnnouncementRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Content !== undefined) { - bodyParams["Content"] = serializeAws_json1_1Content(input.Content, context); - } - if (input.RoomFilters !== undefined) { - bodyParams["RoomFilters"] = serializeAws_json1_1FilterList( - input.RoomFilters, - context - ); - } - if (input.TimeToLiveInSeconds !== undefined) { - bodyParams["TimeToLiveInSeconds"] = input.TimeToLiveInSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1Ssml = ( input: Ssml, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Locale !== undefined) { - bodyParams["Locale"] = input.Locale; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Locale !== undefined && { Locale: input.Locale }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1SsmlList = ( @@ -8817,14 +8779,10 @@ const serializeAws_json1_1Text = ( input: Text, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Locale !== undefined) { - bodyParams["Locale"] = input.Locale; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Locale !== undefined && { Locale: input.Locale }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TextList = ( @@ -8838,106 +8796,88 @@ const serializeAws_json1_1DeleteDeviceUsageDataRequest = ( input: DeleteDeviceUsageDataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - if (input.DeviceUsageType !== undefined) { - bodyParams["DeviceUsageType"] = input.DeviceUsageType; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.DeviceUsageType !== undefined && { + DeviceUsageType: input.DeviceUsageType + }) + }; }; const serializeAws_json1_1ApproveSkillRequest = ( input: ApproveSkillRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1AssociateContactWithAddressBookRequest = ( input: AssociateContactWithAddressBookRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressBookArn !== undefined) { - bodyParams["AddressBookArn"] = input.AddressBookArn; - } - if (input.ContactArn !== undefined) { - bodyParams["ContactArn"] = input.ContactArn; - } - return bodyParams; + return { + ...(input.AddressBookArn !== undefined && { + AddressBookArn: input.AddressBookArn + }), + ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }) + }; }; const serializeAws_json1_1AssociateDeviceWithNetworkProfileRequest = ( input: AssociateDeviceWithNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - if (input.NetworkProfileArn !== undefined) { - bodyParams["NetworkProfileArn"] = input.NetworkProfileArn; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.NetworkProfileArn !== undefined && { + NetworkProfileArn: input.NetworkProfileArn + }) + }; }; const serializeAws_json1_1AssociateDeviceWithRoomRequest = ( input: AssociateDeviceWithRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1AssociateSkillGroupWithRoomRequest = ( input: AssociateSkillGroupWithRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }) + }; }; const serializeAws_json1_1AssociateSkillWithSkillGroupRequest = ( input: AssociateSkillWithSkillGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1AssociateSkillWithUsersRequest = ( input: AssociateSkillWithUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1AuthorizationResult = ( @@ -8954,663 +8894,505 @@ const serializeAws_json1_1BusinessReportContentRange = ( input: BusinessReportContentRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Interval !== undefined) { - bodyParams["Interval"] = input.Interval; - } - return bodyParams; + return { + ...(input.Interval !== undefined && { Interval: input.Interval }) + }; }; const serializeAws_json1_1BusinessReportRecurrence = ( input: BusinessReportRecurrence, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StartDate !== undefined) { - bodyParams["StartDate"] = input.StartDate; - } - return bodyParams; + return { + ...(input.StartDate !== undefined && { StartDate: input.StartDate }) + }; }; const serializeAws_json1_1ConferencePreference = ( input: ConferencePreference, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultConferenceProviderArn !== undefined) { - bodyParams["DefaultConferenceProviderArn"] = - input.DefaultConferenceProviderArn; - } - return bodyParams; + return { + ...(input.DefaultConferenceProviderArn !== undefined && { + DefaultConferenceProviderArn: input.DefaultConferenceProviderArn + }) + }; }; const serializeAws_json1_1CreateAddressBookRequest = ( input: CreateAddressBookRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateBusinessReportScheduleRequest = ( input: CreateBusinessReportScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.ContentRange !== undefined) { - bodyParams["ContentRange"] = serializeAws_json1_1BusinessReportContentRange( - input.ContentRange, - context - ); - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.Recurrence !== undefined) { - bodyParams["Recurrence"] = serializeAws_json1_1BusinessReportRecurrence( - input.Recurrence, - context - ); - } - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - if (input.S3KeyPrefix !== undefined) { - bodyParams["S3KeyPrefix"] = input.S3KeyPrefix; - } - if (input.ScheduleName !== undefined) { - bodyParams["ScheduleName"] = input.ScheduleName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateConferenceProviderRequest = ( input: CreateConferenceProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.ConferenceProviderName !== undefined) { - bodyParams["ConferenceProviderName"] = input.ConferenceProviderName; - } - if (input.ConferenceProviderType !== undefined) { - bodyParams["ConferenceProviderType"] = input.ConferenceProviderType; - } - if (input.IPDialIn !== undefined) { - bodyParams["IPDialIn"] = serializeAws_json1_1IPDialIn( - input.IPDialIn, - context - ); - } - if (input.MeetingSetting !== undefined) { - bodyParams["MeetingSetting"] = serializeAws_json1_1MeetingSetting( - input.MeetingSetting, - context - ); - } - if (input.PSTNDialIn !== undefined) { - bodyParams["PSTNDialIn"] = serializeAws_json1_1PSTNDialIn( - input.PSTNDialIn, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateContactRequest = ( input: CreateContactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.FirstName !== undefined) { - bodyParams["FirstName"] = input.FirstName; - } - if (input.LastName !== undefined) { - bodyParams["LastName"] = input.LastName; - } - if (input.PhoneNumber !== undefined) { - bodyParams["PhoneNumber"] = input.PhoneNumber; - } - if (input.PhoneNumbers !== undefined) { - bodyParams["PhoneNumbers"] = serializeAws_json1_1PhoneNumberList( - input.PhoneNumbers, - context - ); - } - if (input.SipAddresses !== undefined) { - bodyParams["SipAddresses"] = serializeAws_json1_1SipAddressList( - input.SipAddresses, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateEndOfMeetingReminder = ( input: CreateEndOfMeetingReminder, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.ReminderAtMinutes !== undefined) { - bodyParams[ - "ReminderAtMinutes" - ] = serializeAws_json1_1EndOfMeetingReminderMinutesList( - input.ReminderAtMinutes, - context - ); - } - if (input.ReminderType !== undefined) { - bodyParams["ReminderType"] = input.ReminderType; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.ReminderAtMinutes !== undefined && { + ReminderAtMinutes: serializeAws_json1_1EndOfMeetingReminderMinutesList( + input.ReminderAtMinutes, + context + ) + }), + ...(input.ReminderType !== undefined && { + ReminderType: input.ReminderType + }) + }; }; const serializeAws_json1_1CreateGatewayGroupRequest = ( input: CreateGatewayGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateInstantBooking = ( input: CreateInstantBooking, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DurationInMinutes !== undefined) { - bodyParams["DurationInMinutes"] = input.DurationInMinutes; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.DurationInMinutes !== undefined && { + DurationInMinutes: input.DurationInMinutes + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_json1_1CreateMeetingRoomConfiguration = ( input: CreateMeetingRoomConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndOfMeetingReminder !== undefined) { - bodyParams[ - "EndOfMeetingReminder" - ] = serializeAws_json1_1CreateEndOfMeetingReminder( - input.EndOfMeetingReminder, - context - ); - } - if (input.InstantBooking !== undefined) { - bodyParams["InstantBooking"] = serializeAws_json1_1CreateInstantBooking( - input.InstantBooking, - context - ); - } - if (input.RequireCheckIn !== undefined) { - bodyParams["RequireCheckIn"] = serializeAws_json1_1CreateRequireCheckIn( - input.RequireCheckIn, - context - ); - } - if (input.RoomUtilizationMetricsEnabled !== undefined) { - bodyParams["RoomUtilizationMetricsEnabled"] = - input.RoomUtilizationMetricsEnabled; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateNetworkProfileRequest = ( input: CreateNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.CurrentPassword !== undefined) { - bodyParams["CurrentPassword"] = input.CurrentPassword; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.EapMethod !== undefined) { - bodyParams["EapMethod"] = input.EapMethod; - } - if (input.NetworkProfileName !== undefined) { - bodyParams["NetworkProfileName"] = input.NetworkProfileName; - } - if (input.NextPassword !== undefined) { - bodyParams["NextPassword"] = input.NextPassword; - } - if (input.SecurityType !== undefined) { - bodyParams["SecurityType"] = input.SecurityType; - } - if (input.Ssid !== undefined) { - bodyParams["Ssid"] = input.Ssid; - } - if (input.TrustAnchors !== undefined) { - bodyParams["TrustAnchors"] = serializeAws_json1_1TrustAnchorList( - input.TrustAnchors, - context - ); - } - return bodyParams; + return { + ...(input.CertificateAuthorityArn !== undefined && { + 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 + ) + }) + }; }; const serializeAws_json1_1CreateProfileRequest = ( input: CreateProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DistanceUnit !== undefined) { - bodyParams["DistanceUnit"] = input.DistanceUnit; - } - if (input.Locale !== undefined) { - bodyParams["Locale"] = input.Locale; - } - if (input.MaxVolumeLimit !== undefined) { - bodyParams["MaxVolumeLimit"] = input.MaxVolumeLimit; - } - if (input.MeetingRoomConfiguration !== undefined) { - bodyParams[ - "MeetingRoomConfiguration" - ] = serializeAws_json1_1CreateMeetingRoomConfiguration( - input.MeetingRoomConfiguration, - context - ); - } - if (input.PSTNEnabled !== undefined) { - bodyParams["PSTNEnabled"] = input.PSTNEnabled; - } - if (input.ProfileName !== undefined) { - bodyParams["ProfileName"] = input.ProfileName; - } - if (input.SetupModeDisabled !== undefined) { - bodyParams["SetupModeDisabled"] = input.SetupModeDisabled; - } - if (input.TemperatureUnit !== undefined) { - bodyParams["TemperatureUnit"] = input.TemperatureUnit; - } - if (input.Timezone !== undefined) { - bodyParams["Timezone"] = input.Timezone; - } - if (input.WakeWord !== undefined) { - bodyParams["WakeWord"] = input.WakeWord; - } - return bodyParams; + return { + ...(input.Address !== undefined && { 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.TemperatureUnit !== undefined && { + TemperatureUnit: input.TemperatureUnit + }), + ...(input.Timezone !== undefined && { Timezone: input.Timezone }), + ...(input.WakeWord !== undefined && { WakeWord: input.WakeWord }) + }; }; const serializeAws_json1_1CreateRequireCheckIn = ( input: CreateRequireCheckIn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.ReleaseAfterMinutes !== undefined) { - bodyParams["ReleaseAfterMinutes"] = input.ReleaseAfterMinutes; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.ReleaseAfterMinutes !== undefined && { + ReleaseAfterMinutes: input.ReleaseAfterMinutes + }) + }; }; const serializeAws_json1_1CreateRoomRequest = ( input: CreateRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ProfileArn !== undefined) { - bodyParams["ProfileArn"] = input.ProfileArn; - } - if (input.ProviderCalendarId !== undefined) { - bodyParams["ProviderCalendarId"] = input.ProviderCalendarId; - } - if (input.RoomName !== undefined) { - bodyParams["RoomName"] = input.RoomName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateSkillGroupRequest = ( input: CreateSkillGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.SkillGroupName !== undefined) { - bodyParams["SkillGroupName"] = input.SkillGroupName; - } - return bodyParams; + return { + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.SkillGroupName !== undefined && { + SkillGroupName: input.SkillGroupName + }) + }; }; const serializeAws_json1_1CreateUserRequest = ( input: CreateUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.FirstName !== undefined) { - bodyParams["FirstName"] = input.FirstName; - } - if (input.LastName !== undefined) { - bodyParams["LastName"] = input.LastName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteAddressBookRequest = ( input: DeleteAddressBookRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressBookArn !== undefined) { - bodyParams["AddressBookArn"] = input.AddressBookArn; - } - return bodyParams; + return { + ...(input.AddressBookArn !== undefined && { + AddressBookArn: input.AddressBookArn + }) + }; }; const serializeAws_json1_1DeleteBusinessReportScheduleRequest = ( input: DeleteBusinessReportScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScheduleArn !== undefined) { - bodyParams["ScheduleArn"] = input.ScheduleArn; - } - return bodyParams; + return { + ...(input.ScheduleArn !== undefined && { ScheduleArn: input.ScheduleArn }) + }; }; const serializeAws_json1_1DeleteConferenceProviderRequest = ( input: DeleteConferenceProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConferenceProviderArn !== undefined) { - bodyParams["ConferenceProviderArn"] = input.ConferenceProviderArn; - } - return bodyParams; + return { + ...(input.ConferenceProviderArn !== undefined && { + ConferenceProviderArn: input.ConferenceProviderArn + }) + }; }; const serializeAws_json1_1DeleteContactRequest = ( input: DeleteContactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContactArn !== undefined) { - bodyParams["ContactArn"] = input.ContactArn; - } - return bodyParams; + return { + ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }) + }; }; const serializeAws_json1_1DeleteDeviceRequest = ( input: DeleteDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }) + }; }; const serializeAws_json1_1DeleteGatewayGroupRequest = ( input: DeleteGatewayGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayGroupArn !== undefined) { - bodyParams["GatewayGroupArn"] = input.GatewayGroupArn; - } - return bodyParams; + return { + ...(input.GatewayGroupArn !== undefined && { + GatewayGroupArn: input.GatewayGroupArn + }) + }; }; const serializeAws_json1_1DeleteNetworkProfileRequest = ( input: DeleteNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NetworkProfileArn !== undefined) { - bodyParams["NetworkProfileArn"] = input.NetworkProfileArn; - } - return bodyParams; + return { + ...(input.NetworkProfileArn !== undefined && { + NetworkProfileArn: input.NetworkProfileArn + }) + }; }; const serializeAws_json1_1DeleteProfileRequest = ( input: DeleteProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProfileArn !== undefined) { - bodyParams["ProfileArn"] = input.ProfileArn; - } - return bodyParams; + return { + ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }) + }; }; const serializeAws_json1_1DeleteRoomRequest = ( input: DeleteRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1DeleteRoomSkillParameterRequest = ( input: DeleteRoomSkillParameterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterKey !== undefined) { - bodyParams["ParameterKey"] = input.ParameterKey; - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.ParameterKey !== undefined && { + ParameterKey: input.ParameterKey + }), + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1DeleteSkillAuthorizationRequest = ( input: DeleteSkillAuthorizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1DeleteSkillGroupRequest = ( input: DeleteSkillGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - return bodyParams; + return { + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }) + }; }; const serializeAws_json1_1DeleteUserRequest = ( input: DeleteUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnrollmentId !== undefined) { - bodyParams["EnrollmentId"] = input.EnrollmentId; - } - if (input.UserArn !== undefined) { - bodyParams["UserArn"] = input.UserArn; - } - return bodyParams; + return { + ...(input.EnrollmentId !== undefined && { + EnrollmentId: input.EnrollmentId + }), + ...(input.UserArn !== undefined && { UserArn: input.UserArn }) + }; }; const serializeAws_json1_1DisassociateContactFromAddressBookRequest = ( input: DisassociateContactFromAddressBookRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressBookArn !== undefined) { - bodyParams["AddressBookArn"] = input.AddressBookArn; - } - if (input.ContactArn !== undefined) { - bodyParams["ContactArn"] = input.ContactArn; - } - return bodyParams; + return { + ...(input.AddressBookArn !== undefined && { + AddressBookArn: input.AddressBookArn + }), + ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }) + }; }; const serializeAws_json1_1DisassociateDeviceFromRoomRequest = ( input: DisassociateDeviceFromRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }) + }; }; const serializeAws_json1_1DisassociateSkillFromSkillGroupRequest = ( input: DisassociateSkillFromSkillGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1DisassociateSkillFromUsersRequest = ( input: DisassociateSkillFromUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1DisassociateSkillGroupFromRoomRequest = ( input: DisassociateSkillGroupFromRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }) + }; }; const serializeAws_json1_1EndOfMeetingReminderMinutesList = ( @@ -9631,335 +9413,261 @@ const serializeAws_json1_1ForgetSmartHomeAppliancesRequest = ( input: ForgetSmartHomeAppliancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1GetAddressBookRequest = ( input: GetAddressBookRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressBookArn !== undefined) { - bodyParams["AddressBookArn"] = input.AddressBookArn; - } - return bodyParams; + return { + ...(input.AddressBookArn !== undefined && { + AddressBookArn: input.AddressBookArn + }) + }; }; const serializeAws_json1_1GetConferencePreferenceRequest = ( input: GetConferencePreferenceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetConferenceProviderRequest = ( input: GetConferenceProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConferenceProviderArn !== undefined) { - bodyParams["ConferenceProviderArn"] = input.ConferenceProviderArn; - } - return bodyParams; + return { + ...(input.ConferenceProviderArn !== undefined && { + ConferenceProviderArn: input.ConferenceProviderArn + }) + }; }; const serializeAws_json1_1GetContactRequest = ( input: GetContactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContactArn !== undefined) { - bodyParams["ContactArn"] = input.ContactArn; - } - return bodyParams; + return { + ...(input.ContactArn !== undefined && { ContactArn: input.ContactArn }) + }; }; const serializeAws_json1_1GetDeviceRequest = ( input: GetDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }) + }; }; const serializeAws_json1_1GetGatewayGroupRequest = ( input: GetGatewayGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayGroupArn !== undefined) { - bodyParams["GatewayGroupArn"] = input.GatewayGroupArn; - } - return bodyParams; + return { + ...(input.GatewayGroupArn !== undefined && { + GatewayGroupArn: input.GatewayGroupArn + }) + }; }; const serializeAws_json1_1GetGatewayRequest = ( input: GetGatewayRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayArn !== undefined) { - bodyParams["GatewayArn"] = input.GatewayArn; - } - return bodyParams; + return { + ...(input.GatewayArn !== undefined && { GatewayArn: input.GatewayArn }) + }; }; const serializeAws_json1_1GetInvitationConfigurationRequest = ( input: GetInvitationConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetNetworkProfileRequest = ( input: GetNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NetworkProfileArn !== undefined) { - bodyParams["NetworkProfileArn"] = input.NetworkProfileArn; - } - return bodyParams; + return { + ...(input.NetworkProfileArn !== undefined && { + NetworkProfileArn: input.NetworkProfileArn + }) + }; }; const serializeAws_json1_1GetProfileRequest = ( input: GetProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProfileArn !== undefined) { - bodyParams["ProfileArn"] = input.ProfileArn; - } - return bodyParams; + return { + ...(input.ProfileArn !== undefined && { ProfileArn: input.ProfileArn }) + }; }; const serializeAws_json1_1GetRoomRequest = ( input: GetRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1GetRoomSkillParameterRequest = ( input: GetRoomSkillParameterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterKey !== undefined) { - bodyParams["ParameterKey"] = input.ParameterKey; - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.ParameterKey !== undefined && { + ParameterKey: input.ParameterKey + }), + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1GetSkillGroupRequest = ( input: GetSkillGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - return bodyParams; + return { + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }) + }; }; const serializeAws_json1_1ListBusinessReportSchedulesRequest = ( input: ListBusinessReportSchedulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListConferenceProvidersRequest = ( input: ListConferenceProvidersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDeviceEventsRequest = ( input: ListDeviceEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - if (input.EventType !== undefined) { - bodyParams["EventType"] = input.EventType; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListGatewayGroupsRequest = ( input: ListGatewayGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListGatewaysRequest = ( input: ListGatewaysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayGroupArn !== undefined) { - bodyParams["GatewayGroupArn"] = input.GatewayGroupArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.GatewayGroupArn !== undefined && { + GatewayGroupArn: input.GatewayGroupArn + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListSkillsRequest = ( input: ListSkillsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnablementType !== undefined) { - bodyParams["EnablementType"] = input.EnablementType; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - if (input.SkillType !== undefined) { - bodyParams["SkillType"] = input.SkillType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListSkillsStoreCategoriesRequest = ( input: ListSkillsStoreCategoriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListSkillsStoreSkillsByCategoryRequest = ( input: ListSkillsStoreSkillsByCategoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CategoryId !== undefined) { - bodyParams["CategoryId"] = input.CategoryId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.CategoryId !== undefined && { CategoryId: input.CategoryId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListSmartHomeAppliancesRequest = ( input: ListSmartHomeAppliancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1ListTagsRequest = ( input: ListTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1PhoneNumber = ( input: PhoneNumber, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Number !== undefined) { - bodyParams["Number"] = input.Number; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Number !== undefined && { Number: input.Number }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1PhoneNumberList = ( @@ -9973,371 +9681,263 @@ const serializeAws_json1_1PutConferencePreferenceRequest = ( input: PutConferencePreferenceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConferencePreference !== undefined) { - bodyParams[ - "ConferencePreference" - ] = serializeAws_json1_1ConferencePreference( - input.ConferencePreference, - context - ); - } - return bodyParams; + return { + ...(input.ConferencePreference !== undefined && { + ConferencePreference: serializeAws_json1_1ConferencePreference( + input.ConferencePreference, + context + ) + }) + }; }; const serializeAws_json1_1PutInvitationConfigurationRequest = ( input: PutInvitationConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContactEmail !== undefined) { - bodyParams["ContactEmail"] = input.ContactEmail; - } - if (input.OrganizationName !== undefined) { - bodyParams["OrganizationName"] = input.OrganizationName; - } - if (input.PrivateSkillIds !== undefined) { - bodyParams["PrivateSkillIds"] = serializeAws_json1_1ShortSkillIdList( - input.PrivateSkillIds, - context - ); - } - return bodyParams; + return { + ...(input.ContactEmail !== undefined && { + ContactEmail: input.ContactEmail + }), + ...(input.OrganizationName !== undefined && { + OrganizationName: input.OrganizationName + }), + ...(input.PrivateSkillIds !== undefined && { + PrivateSkillIds: serializeAws_json1_1ShortSkillIdList( + input.PrivateSkillIds, + context + ) + }) + }; }; const serializeAws_json1_1PutRoomSkillParameterRequest = ( input: PutRoomSkillParameterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.RoomSkillParameter !== undefined) { - bodyParams["RoomSkillParameter"] = serializeAws_json1_1RoomSkillParameter( - input.RoomSkillParameter, - context - ); - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.RoomSkillParameter !== undefined && { + RoomSkillParameter: serializeAws_json1_1RoomSkillParameter( + input.RoomSkillParameter, + context + ) + }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1PutSkillAuthorizationRequest = ( input: PutSkillAuthorizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthorizationResult !== undefined) { - bodyParams["AuthorizationResult"] = serializeAws_json1_1AuthorizationResult( - input.AuthorizationResult, - context - ); - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.AuthorizationResult !== undefined && { + AuthorizationResult: serializeAws_json1_1AuthorizationResult( + input.AuthorizationResult, + context + ) + }), + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }), + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1RegisterAVSDeviceRequest = ( input: RegisterAVSDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AmazonId !== undefined) { - bodyParams["AmazonId"] = input.AmazonId; - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.DeviceSerialNumber !== undefined) { - bodyParams["DeviceSerialNumber"] = input.DeviceSerialNumber; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.UserCode !== undefined) { - bodyParams["UserCode"] = input.UserCode; - } - return bodyParams; + 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.UserCode !== undefined && { UserCode: input.UserCode }) + }; }; const serializeAws_json1_1RejectSkillRequest = ( input: RejectSkillRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - return bodyParams; + return { + ...(input.SkillId !== undefined && { SkillId: input.SkillId }) + }; }; const serializeAws_json1_1ResolveRoomRequest = ( input: ResolveRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkillId !== undefined) { - bodyParams["SkillId"] = input.SkillId; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.SkillId !== undefined && { SkillId: input.SkillId }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_json1_1RevokeInvitationRequest = ( input: RevokeInvitationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnrollmentId !== undefined) { - bodyParams["EnrollmentId"] = input.EnrollmentId; - } - if (input.UserArn !== undefined) { - bodyParams["UserArn"] = input.UserArn; - } - return bodyParams; + return { + ...(input.EnrollmentId !== undefined && { + EnrollmentId: input.EnrollmentId + }), + ...(input.UserArn !== undefined && { UserArn: input.UserArn }) + }; }; const serializeAws_json1_1RoomSkillParameter = ( input: RoomSkillParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterKey !== undefined) { - bodyParams["ParameterKey"] = input.ParameterKey; - } - if (input.ParameterValue !== undefined) { - bodyParams["ParameterValue"] = input.ParameterValue; - } - return bodyParams; + return { + ...(input.ParameterKey !== undefined && { + ParameterKey: input.ParameterKey + }), + ...(input.ParameterValue !== undefined && { + ParameterValue: input.ParameterValue + }) + }; }; const serializeAws_json1_1SearchAddressBooksRequest = ( input: SearchAddressBooksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchContactsRequest = ( input: SearchContactsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchDevicesRequest = ( input: SearchDevicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchNetworkProfilesRequest = ( input: SearchNetworkProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchProfilesRequest = ( input: SearchProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchRoomsRequest = ( input: SearchRoomsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchSkillGroupsRequest = ( input: SearchSkillGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SearchUsersRequest = ( input: SearchUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortList( - input.SortCriteria, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SendInvitationRequest = ( input: SendInvitationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserArn !== undefined) { - bodyParams["UserArn"] = input.UserArn; - } - return bodyParams; + return { + ...(input.UserArn !== undefined && { UserArn: input.UserArn }) + }; }; const serializeAws_json1_1ShortSkillIdList = ( @@ -10351,14 +9951,10 @@ const serializeAws_json1_1SipAddress = ( input: SipAddress, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Uri !== undefined) { - bodyParams["Uri"] = input.Uri; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Uri !== undefined && { Uri: input.Uri }) + }; }; const serializeAws_json1_1SipAddressList = ( @@ -10372,14 +9968,10 @@ const serializeAws_json1_1Sort = ( input: Sort, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1SortList = ( @@ -10393,42 +9985,29 @@ const serializeAws_json1_1StartDeviceSyncRequest = ( input: StartDeviceSyncRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - if (input.Features !== undefined) { - bodyParams["Features"] = serializeAws_json1_1Features( - input.Features, - context - ); - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.Features !== undefined && { + Features: serializeAws_json1_1Features(input.Features, context) + }), + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1StartSmartHomeApplianceDiscoveryRequest = ( input: StartSmartHomeApplianceDiscoveryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - return bodyParams; + return { + ...(input.RoomArn !== undefined && { RoomArn: input.RoomArn }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -10449,14 +10028,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TrustAnchorList = ( @@ -10470,387 +10047,301 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateAddressBookRequest = ( input: UpdateAddressBookRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressBookArn !== undefined) { - bodyParams["AddressBookArn"] = input.AddressBookArn; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.AddressBookArn !== undefined && { + AddressBookArn: input.AddressBookArn + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateBusinessReportScheduleRequest = ( input: UpdateBusinessReportScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.Recurrence !== undefined) { - bodyParams["Recurrence"] = serializeAws_json1_1BusinessReportRecurrence( - input.Recurrence, - context - ); - } - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - if (input.S3KeyPrefix !== undefined) { - bodyParams["S3KeyPrefix"] = input.S3KeyPrefix; - } - if (input.ScheduleArn !== undefined) { - bodyParams["ScheduleArn"] = input.ScheduleArn; - } - if (input.ScheduleName !== undefined) { - bodyParams["ScheduleName"] = input.ScheduleName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateConferenceProviderRequest = ( input: UpdateConferenceProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConferenceProviderArn !== undefined) { - bodyParams["ConferenceProviderArn"] = input.ConferenceProviderArn; - } - if (input.ConferenceProviderType !== undefined) { - bodyParams["ConferenceProviderType"] = input.ConferenceProviderType; - } - if (input.IPDialIn !== undefined) { - bodyParams["IPDialIn"] = serializeAws_json1_1IPDialIn( - input.IPDialIn, - context - ); - } - if (input.MeetingSetting !== undefined) { - bodyParams["MeetingSetting"] = serializeAws_json1_1MeetingSetting( - input.MeetingSetting, - context - ); - } - if (input.PSTNDialIn !== undefined) { - bodyParams["PSTNDialIn"] = serializeAws_json1_1PSTNDialIn( - input.PSTNDialIn, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateContactRequest = ( input: UpdateContactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContactArn !== undefined) { - bodyParams["ContactArn"] = input.ContactArn; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.FirstName !== undefined) { - bodyParams["FirstName"] = input.FirstName; - } - if (input.LastName !== undefined) { - bodyParams["LastName"] = input.LastName; - } - if (input.PhoneNumber !== undefined) { - bodyParams["PhoneNumber"] = input.PhoneNumber; - } - if (input.PhoneNumbers !== undefined) { - bodyParams["PhoneNumbers"] = serializeAws_json1_1PhoneNumberList( - input.PhoneNumbers, - context - ); - } - if (input.SipAddresses !== undefined) { - bodyParams["SipAddresses"] = serializeAws_json1_1SipAddressList( - input.SipAddresses, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateDeviceRequest = ( input: UpdateDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceArn !== undefined) { - bodyParams["DeviceArn"] = input.DeviceArn; - } - if (input.DeviceName !== undefined) { - bodyParams["DeviceName"] = input.DeviceName; - } - return bodyParams; + return { + ...(input.DeviceArn !== undefined && { DeviceArn: input.DeviceArn }), + ...(input.DeviceName !== undefined && { DeviceName: input.DeviceName }) + }; }; const serializeAws_json1_1UpdateEndOfMeetingReminder = ( input: UpdateEndOfMeetingReminder, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.ReminderAtMinutes !== undefined) { - bodyParams[ - "ReminderAtMinutes" - ] = serializeAws_json1_1EndOfMeetingReminderMinutesList( - input.ReminderAtMinutes, - context - ); - } - if (input.ReminderType !== undefined) { - bodyParams["ReminderType"] = input.ReminderType; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.ReminderAtMinutes !== undefined && { + ReminderAtMinutes: serializeAws_json1_1EndOfMeetingReminderMinutesList( + input.ReminderAtMinutes, + context + ) + }), + ...(input.ReminderType !== undefined && { + ReminderType: input.ReminderType + }) + }; }; const serializeAws_json1_1UpdateGatewayGroupRequest = ( input: UpdateGatewayGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GatewayGroupArn !== undefined) { - bodyParams["GatewayGroupArn"] = input.GatewayGroupArn; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.GatewayGroupArn !== undefined && { + GatewayGroupArn: input.GatewayGroupArn + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateGatewayRequest = ( input: UpdateGatewayRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GatewayArn !== undefined) { - bodyParams["GatewayArn"] = input.GatewayArn; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SoftwareVersion !== undefined) { - bodyParams["SoftwareVersion"] = input.SoftwareVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateInstantBooking = ( input: UpdateInstantBooking, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DurationInMinutes !== undefined) { - bodyParams["DurationInMinutes"] = input.DurationInMinutes; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.DurationInMinutes !== undefined && { + DurationInMinutes: input.DurationInMinutes + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_json1_1UpdateMeetingRoomConfiguration = ( input: UpdateMeetingRoomConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndOfMeetingReminder !== undefined) { - bodyParams[ - "EndOfMeetingReminder" - ] = serializeAws_json1_1UpdateEndOfMeetingReminder( - input.EndOfMeetingReminder, - context - ); - } - if (input.InstantBooking !== undefined) { - bodyParams["InstantBooking"] = serializeAws_json1_1UpdateInstantBooking( - input.InstantBooking, - context - ); - } - if (input.RequireCheckIn !== undefined) { - bodyParams["RequireCheckIn"] = serializeAws_json1_1UpdateRequireCheckIn( - input.RequireCheckIn, - context - ); - } - if (input.RoomUtilizationMetricsEnabled !== undefined) { - bodyParams["RoomUtilizationMetricsEnabled"] = - input.RoomUtilizationMetricsEnabled; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateNetworkProfileRequest = ( input: UpdateNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArn !== undefined) { - bodyParams["CertificateAuthorityArn"] = input.CertificateAuthorityArn; - } - if (input.CurrentPassword !== undefined) { - bodyParams["CurrentPassword"] = input.CurrentPassword; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.NetworkProfileArn !== undefined) { - bodyParams["NetworkProfileArn"] = input.NetworkProfileArn; - } - if (input.NetworkProfileName !== undefined) { - bodyParams["NetworkProfileName"] = input.NetworkProfileName; - } - if (input.NextPassword !== undefined) { - bodyParams["NextPassword"] = input.NextPassword; - } - if (input.TrustAnchors !== undefined) { - bodyParams["TrustAnchors"] = serializeAws_json1_1TrustAnchorList( - input.TrustAnchors, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateProfileRequest = ( input: UpdateProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.DistanceUnit !== undefined) { - bodyParams["DistanceUnit"] = input.DistanceUnit; - } - if (input.IsDefault !== undefined) { - bodyParams["IsDefault"] = input.IsDefault; - } - if (input.Locale !== undefined) { - bodyParams["Locale"] = input.Locale; - } - if (input.MaxVolumeLimit !== undefined) { - bodyParams["MaxVolumeLimit"] = input.MaxVolumeLimit; - } - if (input.MeetingRoomConfiguration !== undefined) { - bodyParams[ - "MeetingRoomConfiguration" - ] = serializeAws_json1_1UpdateMeetingRoomConfiguration( - input.MeetingRoomConfiguration, - context - ); - } - if (input.PSTNEnabled !== undefined) { - bodyParams["PSTNEnabled"] = input.PSTNEnabled; - } - if (input.ProfileArn !== undefined) { - bodyParams["ProfileArn"] = input.ProfileArn; - } - if (input.ProfileName !== undefined) { - bodyParams["ProfileName"] = input.ProfileName; - } - if (input.SetupModeDisabled !== undefined) { - bodyParams["SetupModeDisabled"] = input.SetupModeDisabled; - } - if (input.TemperatureUnit !== undefined) { - bodyParams["TemperatureUnit"] = input.TemperatureUnit; - } - if (input.Timezone !== undefined) { - bodyParams["Timezone"] = input.Timezone; - } - if (input.WakeWord !== undefined) { - bodyParams["WakeWord"] = input.WakeWord; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateRequireCheckIn = ( input: UpdateRequireCheckIn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.ReleaseAfterMinutes !== undefined) { - bodyParams["ReleaseAfterMinutes"] = input.ReleaseAfterMinutes; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.ReleaseAfterMinutes !== undefined && { + ReleaseAfterMinutes: input.ReleaseAfterMinutes + }) + }; }; const serializeAws_json1_1UpdateRoomRequest = ( input: UpdateRoomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ProfileArn !== undefined) { - bodyParams["ProfileArn"] = input.ProfileArn; - } - if (input.ProviderCalendarId !== undefined) { - bodyParams["ProviderCalendarId"] = input.ProviderCalendarId; - } - if (input.RoomArn !== undefined) { - bodyParams["RoomArn"] = input.RoomArn; - } - if (input.RoomName !== undefined) { - bodyParams["RoomName"] = input.RoomName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateSkillGroupRequest = ( input: UpdateSkillGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.SkillGroupArn !== undefined) { - bodyParams["SkillGroupArn"] = input.SkillGroupArn; - } - if (input.SkillGroupName !== undefined) { - bodyParams["SkillGroupName"] = input.SkillGroupName; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.SkillGroupArn !== undefined && { + SkillGroupArn: input.SkillGroupArn + }), + ...(input.SkillGroupName !== undefined && { + SkillGroupName: input.SkillGroupName + }) + }; }; const deserializeAws_json1_1AlreadyExistsException = ( diff --git a/clients/client-amplify/protocols/Aws_restJson1_1.ts b/clients/client-amplify/protocols/Aws_restJson1_1.ts index 78e37335ace8..0fc3de3b4f3a 100644 --- a/clients/client-amplify/protocols/Aws_restJson1_1.ts +++ b/clients/client-amplify/protocols/Aws_restJson1_1.ts @@ -5889,40 +5889,32 @@ const serializeAws_restJson1_1AutoBranchCreationConfig = ( input: AutoBranchCreationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.basicAuthCredentials !== undefined) { - bodyParams["basicAuthCredentials"] = input.basicAuthCredentials; - } - if (input.buildSpec !== undefined) { - bodyParams["buildSpec"] = input.buildSpec; - } - if (input.enableAutoBuild !== undefined) { - bodyParams["enableAutoBuild"] = input.enableAutoBuild; - } - if (input.enableBasicAuth !== undefined) { - bodyParams["enableBasicAuth"] = input.enableBasicAuth; - } - if (input.enablePullRequestPreview !== undefined) { - bodyParams["enablePullRequestPreview"] = input.enablePullRequestPreview; - } - if (input.environmentVariables !== undefined) { - bodyParams[ - "environmentVariables" - ] = serializeAws_restJson1_1EnvironmentVariables( - input.environmentVariables, - context - ); - } - if (input.framework !== undefined) { - bodyParams["framework"] = input.framework; - } - if (input.pullRequestEnvironmentName !== undefined) { - bodyParams["pullRequestEnvironmentName"] = input.pullRequestEnvironmentName; - } - if (input.stage !== undefined) { - bodyParams["stage"] = input.stage; - } - return bodyParams; + 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.enablePullRequestPreview !== undefined && { + enablePullRequestPreview: input.enablePullRequestPreview + }), + ...(input.environmentVariables !== undefined && { + environmentVariables: serializeAws_restJson1_1EnvironmentVariables( + input.environmentVariables, + context + ) + }), + ...(input.framework !== undefined && { framework: input.framework }), + ...(input.pullRequestEnvironmentName !== undefined && { + pullRequestEnvironmentName: input.pullRequestEnvironmentName + }), + ...(input.stage !== undefined && { stage: input.stage }) + }; }; const serializeAws_restJson1_1AutoBranchCreationPatterns = ( @@ -5936,20 +5928,12 @@ const serializeAws_restJson1_1CustomRule = ( input: CustomRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.condition !== undefined) { - bodyParams["condition"] = input.condition; - } - if (input.source !== undefined) { - bodyParams["source"] = input.source; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - if (input.target !== undefined) { - bodyParams["target"] = input.target; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CustomRules = ( @@ -5983,14 +5967,10 @@ const serializeAws_restJson1_1SubDomainSetting = ( input: SubDomainSetting, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - return bodyParams; + return { + ...(input.branchName !== undefined && { branchName: input.branchName }), + ...(input.prefix !== undefined && { prefix: input.prefix }) + }; }; const serializeAws_restJson1_1SubDomainSettings = ( diff --git a/clients/client-api-gateway/protocols/Aws_restJson1_1.ts b/clients/client-api-gateway/protocols/Aws_restJson1_1.ts index 9769cdaad305..d8c88b180fa3 100644 --- a/clients/client-api-gateway/protocols/Aws_restJson1_1.ts +++ b/clients/client-api-gateway/protocols/Aws_restJson1_1.ts @@ -22650,112 +22650,89 @@ const serializeAws_restJson1_1ApiStage = ( input: ApiStage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.apiId !== undefined) { - bodyParams["apiId"] = input.apiId; - } - if (input.stage !== undefined) { - bodyParams["stage"] = input.stage; - } - if (input.throttle !== undefined) { - bodyParams[ - "throttle" - ] = serializeAws_restJson1_1MapOfApiStageThrottleSettings( - input.throttle, - context - ); - } - return bodyParams; + return { + ...(input.apiId !== undefined && { apiId: input.apiId }), + ...(input.stage !== undefined && { stage: input.stage }), + ...(input.throttle !== undefined && { + throttle: serializeAws_restJson1_1MapOfApiStageThrottleSettings( + input.throttle, + context + ) + }) + }; }; const serializeAws_restJson1_1CanarySettings = ( input: CanarySettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.percentTraffic !== undefined) { - bodyParams["percentTraffic"] = input.percentTraffic; - } - if (input.stageVariableOverrides !== undefined) { - bodyParams[ - "stageVariableOverrides" - ] = serializeAws_restJson1_1MapOfStringToString( - input.stageVariableOverrides, - context - ); - } - if (input.useStageCache !== undefined) { - bodyParams["useStageCache"] = input.useStageCache; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.percentTraffic !== undefined && { + percentTraffic: input.percentTraffic + }), + ...(input.stageVariableOverrides !== undefined && { + stageVariableOverrides: serializeAws_restJson1_1MapOfStringToString( + input.stageVariableOverrides, + context + ) + }), + ...(input.useStageCache !== undefined && { + useStageCache: input.useStageCache + }) + }; }; const serializeAws_restJson1_1DeploymentCanarySettings = ( input: DeploymentCanarySettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.percentTraffic !== undefined) { - bodyParams["percentTraffic"] = input.percentTraffic; - } - if (input.stageVariableOverrides !== undefined) { - bodyParams[ - "stageVariableOverrides" - ] = serializeAws_restJson1_1MapOfStringToString( - input.stageVariableOverrides, - context - ); - } - if (input.useStageCache !== undefined) { - bodyParams["useStageCache"] = input.useStageCache; - } - return bodyParams; + return { + ...(input.percentTraffic !== undefined && { + percentTraffic: input.percentTraffic + }), + ...(input.stageVariableOverrides !== undefined && { + stageVariableOverrides: serializeAws_restJson1_1MapOfStringToString( + input.stageVariableOverrides, + context + ) + }), + ...(input.useStageCache !== undefined && { + useStageCache: input.useStageCache + }) + }; }; const serializeAws_restJson1_1DocumentationPartLocation = ( input: DocumentationPartLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.method !== undefined) { - bodyParams["method"] = input.method; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - if (input.statusCode !== undefined) { - bodyParams["statusCode"] = input.statusCode; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1EndpointConfiguration = ( input: EndpointConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.types !== undefined) { - bodyParams["types"] = serializeAws_restJson1_1ListOfEndpointType( - input.types, - context - ); - } - if (input.vpcEndpointIds !== undefined) { - bodyParams["vpcEndpointIds"] = serializeAws_restJson1_1ListOfString( - input.vpcEndpointIds, - context - ); - } - return bodyParams; + return { + ...(input.types !== undefined && { + types: serializeAws_restJson1_1ListOfEndpointType(input.types, context) + }), + ...(input.vpcEndpointIds !== undefined && { + vpcEndpointIds: serializeAws_restJson1_1ListOfString( + input.vpcEndpointIds, + context + ) + }) + }; }; const serializeAws_restJson1_1ListOfARNs = ( @@ -22830,45 +22807,31 @@ const serializeAws_restJson1_1QuotaSettings = ( input: QuotaSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.offset !== undefined) { - bodyParams["offset"] = input.offset; - } - if (input.period !== undefined) { - bodyParams["period"] = input.period; - } - return bodyParams; + return { + ...(input.limit !== undefined && { limit: input.limit }), + ...(input.offset !== undefined && { offset: input.offset }), + ...(input.period !== undefined && { period: input.period }) + }; }; const serializeAws_restJson1_1StageKey = ( input: StageKey, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.restApiId !== undefined) { - bodyParams["restApiId"] = input.restApiId; - } - if (input.stageName !== undefined) { - bodyParams["stageName"] = input.stageName; - } - return bodyParams; + return { + ...(input.restApiId !== undefined && { restApiId: input.restApiId }), + ...(input.stageName !== undefined && { stageName: input.stageName }) + }; }; const serializeAws_restJson1_1ThrottleSettings = ( input: ThrottleSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.burstLimit !== undefined) { - bodyParams["burstLimit"] = input.burstLimit; - } - if (input.rateLimit !== undefined) { - bodyParams["rateLimit"] = input.rateLimit; - } - return bodyParams; + return { + ...(input.burstLimit !== undefined && { burstLimit: input.burstLimit }), + ...(input.rateLimit !== undefined && { rateLimit: input.rateLimit }) + }; }; const serializeAws_restJson1_1ListOfPatchOperation = ( @@ -22891,20 +22854,12 @@ const serializeAws_restJson1_1PatchOperation = ( input: PatchOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.from !== undefined) { - bodyParams["from"] = input.from; - } - if (input.op !== undefined) { - bodyParams["op"] = input.op; - } - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_restJson1_1AccessLogSettings = ( diff --git a/clients/client-apigatewayv2/protocols/Aws_restJson1_1.ts b/clients/client-apigatewayv2/protocols/Aws_restJson1_1.ts index 59433e6e139b..d07fdb457998 100644 --- a/clients/client-apigatewayv2/protocols/Aws_restJson1_1.ts +++ b/clients/client-apigatewayv2/protocols/Aws_restJson1_1.ts @@ -10501,14 +10501,12 @@ const serializeAws_restJson1_1AccessLogSettings = ( input: AccessLogSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationArn !== undefined) { - bodyParams["destinationArn"] = input.DestinationArn; - } - if (input.Format !== undefined) { - bodyParams["format"] = input.Format; - } - return bodyParams; + return { + ...(input.DestinationArn !== undefined && { + destinationArn: input.DestinationArn + }), + ...(input.Format !== undefined && { format: input.Format }) + }; }; const serializeAws_restJson1_1AuthorizationScopes = ( @@ -10522,38 +10520,36 @@ const serializeAws_restJson1_1Cors = ( input: Cors, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowCredentials !== undefined) { - bodyParams["allowCredentials"] = input.AllowCredentials; - } - if (input.AllowHeaders !== undefined) { - bodyParams["allowHeaders"] = serializeAws_restJson1_1CorsHeaderList( - input.AllowHeaders, - context - ); - } - if (input.AllowMethods !== undefined) { - bodyParams["allowMethods"] = serializeAws_restJson1_1CorsMethodList( - input.AllowMethods, - context - ); - } - if (input.AllowOrigins !== undefined) { - bodyParams["allowOrigins"] = serializeAws_restJson1_1CorsOriginList( - input.AllowOrigins, - context - ); - } - if (input.ExposeHeaders !== undefined) { - bodyParams["exposeHeaders"] = serializeAws_restJson1_1CorsHeaderList( - input.ExposeHeaders, - context - ); - } - if (input.MaxAge !== undefined) { - bodyParams["maxAge"] = input.MaxAge; - } - return bodyParams; + return { + ...(input.AllowCredentials !== undefined && { + allowCredentials: input.AllowCredentials + }), + ...(input.AllowHeaders !== undefined && { + allowHeaders: serializeAws_restJson1_1CorsHeaderList( + input.AllowHeaders, + context + ) + }), + ...(input.AllowMethods !== undefined && { + allowMethods: serializeAws_restJson1_1CorsMethodList( + input.AllowMethods, + context + ) + }), + ...(input.AllowOrigins !== undefined && { + allowOrigins: serializeAws_restJson1_1CorsOriginList( + input.AllowOrigins, + context + ) + }), + ...(input.ExposeHeaders !== undefined && { + exposeHeaders: serializeAws_restJson1_1CorsHeaderList( + input.ExposeHeaders, + context + ) + }), + ...(input.MaxAge !== undefined && { maxAge: input.MaxAge }) + }; }; const serializeAws_restJson1_1CorsHeaderList = ( @@ -10581,36 +10577,36 @@ const serializeAws_restJson1_1DomainNameConfiguration = ( input: DomainNameConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApiGatewayDomainName !== undefined) { - bodyParams["apiGatewayDomainName"] = input.ApiGatewayDomainName; - } - if (input.CertificateArn !== undefined) { - bodyParams["certificateArn"] = input.CertificateArn; - } - if (input.CertificateName !== undefined) { - bodyParams["certificateName"] = input.CertificateName; - } - if (input.CertificateUploadDate !== undefined) { - bodyParams["certificateUploadDate"] = - input.CertificateUploadDate.toISOString().split(".")[0] + "Z"; - } - if (input.DomainNameStatus !== undefined) { - bodyParams["domainNameStatus"] = input.DomainNameStatus; - } - if (input.DomainNameStatusMessage !== undefined) { - bodyParams["domainNameStatusMessage"] = input.DomainNameStatusMessage; - } - if (input.EndpointType !== undefined) { - bodyParams["endpointType"] = input.EndpointType; - } - if (input.HostedZoneId !== undefined) { - bodyParams["hostedZoneId"] = input.HostedZoneId; - } - if (input.SecurityPolicy !== undefined) { - bodyParams["securityPolicy"] = input.SecurityPolicy; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1DomainNameConfigurations = ( @@ -10643,28 +10639,24 @@ const serializeAws_restJson1_1JWTConfiguration = ( input: JWTConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Audience !== undefined) { - bodyParams["audience"] = serializeAws_restJson1_1__listOf__string( - input.Audience, - context - ); - } - if (input.Issuer !== undefined) { - bodyParams["issuer"] = input.Issuer; - } - return bodyParams; + return { + ...(input.Audience !== undefined && { + audience: serializeAws_restJson1_1__listOf__string( + input.Audience, + context + ) + }), + ...(input.Issuer !== undefined && { issuer: input.Issuer }) + }; }; const serializeAws_restJson1_1ParameterConstraints = ( input: ParameterConstraints, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Required !== undefined) { - bodyParams["required"] = input.Required; - } - return bodyParams; + return { + ...(input.Required !== undefined && { required: input.Required }) + }; }; const serializeAws_restJson1_1RouteModels = ( @@ -10694,23 +10686,23 @@ const serializeAws_restJson1_1RouteSettings = ( input: RouteSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataTraceEnabled !== undefined) { - bodyParams["dataTraceEnabled"] = input.DataTraceEnabled; - } - if (input.DetailedMetricsEnabled !== undefined) { - bodyParams["detailedMetricsEnabled"] = input.DetailedMetricsEnabled; - } - if (input.LoggingLevel !== undefined) { - bodyParams["loggingLevel"] = input.LoggingLevel; - } - if (input.ThrottlingBurstLimit !== undefined) { - bodyParams["throttlingBurstLimit"] = input.ThrottlingBurstLimit; - } - if (input.ThrottlingRateLimit !== undefined) { - bodyParams["throttlingRateLimit"] = input.ThrottlingRateLimit; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1RouteSettingsMap = ( diff --git a/clients/client-app-mesh/protocols/Aws_restJson1_1.ts b/clients/client-app-mesh/protocols/Aws_restJson1_1.ts index 928b76e9b72c..20e653c90bf3 100644 --- a/clients/client-app-mesh/protocols/Aws_restJson1_1.ts +++ b/clients/client-app-mesh/protocols/Aws_restJson1_1.ts @@ -5247,14 +5247,10 @@ const serializeAws_restJson1_1AwsCloudMapInstanceAttribute = ( input: AwsCloudMapInstanceAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1AwsCloudMapInstanceAttributes = ( @@ -5270,22 +5266,18 @@ const serializeAws_restJson1_1AwsCloudMapServiceDiscovery = ( input: AwsCloudMapServiceDiscovery, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams[ - "attributes" - ] = serializeAws_restJson1_1AwsCloudMapInstanceAttributes( - input.attributes, - context - ); - } - if (input.namespaceName !== undefined) { - bodyParams["namespaceName"] = input.namespaceName; - } - if (input.serviceName !== undefined) { - bodyParams["serviceName"] = input.serviceName; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1AwsCloudMapInstanceAttributes( + input.attributes, + context + ) + }), + ...(input.namespaceName !== undefined && { + namespaceName: input.namespaceName + }), + ...(input.serviceName !== undefined && { serviceName: input.serviceName }) + }; }; const serializeAws_restJson1_1Backend = ( @@ -5310,86 +5302,70 @@ const serializeAws_restJson1_1DnsServiceDiscovery = ( input: DnsServiceDiscovery, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hostname !== undefined) { - bodyParams["hostname"] = input.hostname; - } - return bodyParams; + return { + ...(input.hostname !== undefined && { hostname: input.hostname }) + }; }; const serializeAws_restJson1_1Duration = ( input: Duration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.unit !== undefined) { - bodyParams["unit"] = input.unit; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.unit !== undefined && { unit: input.unit }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1EgressFilter = ( input: EgressFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_restJson1_1FileAccessLog = ( input: FileAccessLog, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - return bodyParams; + return { + ...(input.path !== undefined && { path: input.path }) + }; }; const serializeAws_restJson1_1GrpcRetryPolicy = ( input: GrpcRetryPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.grpcRetryEvents !== undefined) { - bodyParams[ - "grpcRetryEvents" - ] = serializeAws_restJson1_1GrpcRetryPolicyEvents( - input.grpcRetryEvents, - context - ); - } - if (input.httpRetryEvents !== undefined) { - bodyParams[ - "httpRetryEvents" - ] = serializeAws_restJson1_1HttpRetryPolicyEvents( - input.httpRetryEvents, - context - ); - } - if (input.maxRetries !== undefined) { - bodyParams["maxRetries"] = input.maxRetries; - } - if (input.perRetryTimeout !== undefined) { - bodyParams["perRetryTimeout"] = serializeAws_restJson1_1Duration( - input.perRetryTimeout, - context - ); - } - if (input.tcpRetryEvents !== undefined) { - bodyParams["tcpRetryEvents"] = serializeAws_restJson1_1TcpRetryPolicyEvents( - input.tcpRetryEvents, - context - ); - } - return bodyParams; + return { + ...(input.grpcRetryEvents !== undefined && { + grpcRetryEvents: serializeAws_restJson1_1GrpcRetryPolicyEvents( + input.grpcRetryEvents, + context + ) + }), + ...(input.httpRetryEvents !== undefined && { + httpRetryEvents: serializeAws_restJson1_1HttpRetryPolicyEvents( + input.httpRetryEvents, + context + ) + }), + ...(input.maxRetries !== undefined && { maxRetries: input.maxRetries }), + ...(input.perRetryTimeout !== undefined && { + perRetryTimeout: serializeAws_restJson1_1Duration( + input.perRetryTimeout, + context + ) + }), + ...(input.tcpRetryEvents !== undefined && { + tcpRetryEvents: serializeAws_restJson1_1TcpRetryPolicyEvents( + input.tcpRetryEvents, + context + ) + }) + }; }; const serializeAws_restJson1_1GrpcRetryPolicyEvents = ( @@ -5403,80 +5379,66 @@ const serializeAws_restJson1_1GrpcRoute = ( input: GrpcRoute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = serializeAws_restJson1_1GrpcRouteAction( - input.action, - context - ); - } - if (input.match !== undefined) { - bodyParams["match"] = serializeAws_restJson1_1GrpcRouteMatch( - input.match, - context - ); - } - if (input.retryPolicy !== undefined) { - bodyParams["retryPolicy"] = serializeAws_restJson1_1GrpcRetryPolicy( - input.retryPolicy, - context - ); - } - return bodyParams; + return { + ...(input.action !== undefined && { + action: serializeAws_restJson1_1GrpcRouteAction(input.action, context) + }), + ...(input.match !== undefined && { + match: serializeAws_restJson1_1GrpcRouteMatch(input.match, context) + }), + ...(input.retryPolicy !== undefined && { + retryPolicy: serializeAws_restJson1_1GrpcRetryPolicy( + input.retryPolicy, + context + ) + }) + }; }; const serializeAws_restJson1_1GrpcRouteAction = ( input: GrpcRouteAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.weightedTargets !== undefined) { - bodyParams["weightedTargets"] = serializeAws_restJson1_1WeightedTargets( - input.weightedTargets, - context - ); - } - return bodyParams; + return { + ...(input.weightedTargets !== undefined && { + weightedTargets: serializeAws_restJson1_1WeightedTargets( + input.weightedTargets, + context + ) + }) + }; }; const serializeAws_restJson1_1GrpcRouteMatch = ( input: GrpcRouteMatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.metadata !== undefined) { - bodyParams["metadata"] = serializeAws_restJson1_1GrpcRouteMetadataList( - input.metadata, - context - ); - } - if (input.methodName !== undefined) { - bodyParams["methodName"] = input.methodName; - } - if (input.serviceName !== undefined) { - bodyParams["serviceName"] = input.serviceName; - } - return bodyParams; + return { + ...(input.metadata !== undefined && { + metadata: serializeAws_restJson1_1GrpcRouteMetadataList( + input.metadata, + context + ) + }), + ...(input.methodName !== undefined && { methodName: input.methodName }), + ...(input.serviceName !== undefined && { serviceName: input.serviceName }) + }; }; const serializeAws_restJson1_1GrpcRouteMetadata = ( input: GrpcRouteMetadata, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.invert !== undefined) { - bodyParams["invert"] = input.invert; - } - if (input.match !== undefined) { - bodyParams["match"] = serializeAws_restJson1_1GrpcRouteMetadataMatchMethod( - input.match, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.invert !== undefined && { invert: input.invert }), + ...(input.match !== undefined && { + match: serializeAws_restJson1_1GrpcRouteMetadataMatchMethod( + input.match, + context + ) + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1GrpcRouteMetadataList = ( @@ -5520,60 +5482,50 @@ const serializeAws_restJson1_1HealthCheckPolicy = ( input: HealthCheckPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.healthyThreshold !== undefined) { - bodyParams["healthyThreshold"] = input.healthyThreshold; - } - if (input.intervalMillis !== undefined) { - bodyParams["intervalMillis"] = input.intervalMillis; - } - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - if (input.port !== undefined) { - bodyParams["port"] = input.port; - } - if (input.protocol !== undefined) { - bodyParams["protocol"] = input.protocol; - } - if (input.timeoutMillis !== undefined) { - bodyParams["timeoutMillis"] = input.timeoutMillis; - } - if (input.unhealthyThreshold !== undefined) { - bodyParams["unhealthyThreshold"] = input.unhealthyThreshold; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1HttpRetryPolicy = ( input: HttpRetryPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.httpRetryEvents !== undefined) { - bodyParams[ - "httpRetryEvents" - ] = serializeAws_restJson1_1HttpRetryPolicyEvents( - input.httpRetryEvents, - context - ); - } - if (input.maxRetries !== undefined) { - bodyParams["maxRetries"] = input.maxRetries; - } - if (input.perRetryTimeout !== undefined) { - bodyParams["perRetryTimeout"] = serializeAws_restJson1_1Duration( - input.perRetryTimeout, - context - ); - } - if (input.tcpRetryEvents !== undefined) { - bodyParams["tcpRetryEvents"] = serializeAws_restJson1_1TcpRetryPolicyEvents( - input.tcpRetryEvents, - context - ); - } - return bodyParams; + return { + ...(input.httpRetryEvents !== undefined && { + httpRetryEvents: serializeAws_restJson1_1HttpRetryPolicyEvents( + input.httpRetryEvents, + context + ) + }), + ...(input.maxRetries !== undefined && { maxRetries: input.maxRetries }), + ...(input.perRetryTimeout !== undefined && { + perRetryTimeout: serializeAws_restJson1_1Duration( + input.perRetryTimeout, + context + ) + }), + ...(input.tcpRetryEvents !== undefined && { + tcpRetryEvents: serializeAws_restJson1_1TcpRetryPolicyEvents( + input.tcpRetryEvents, + context + ) + }) + }; }; const serializeAws_restJson1_1HttpRetryPolicyEvents = ( @@ -5587,60 +5539,47 @@ const serializeAws_restJson1_1HttpRoute = ( input: HttpRoute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = serializeAws_restJson1_1HttpRouteAction( - input.action, - context - ); - } - if (input.match !== undefined) { - bodyParams["match"] = serializeAws_restJson1_1HttpRouteMatch( - input.match, - context - ); - } - if (input.retryPolicy !== undefined) { - bodyParams["retryPolicy"] = serializeAws_restJson1_1HttpRetryPolicy( - input.retryPolicy, - context - ); - } - return bodyParams; + return { + ...(input.action !== undefined && { + action: serializeAws_restJson1_1HttpRouteAction(input.action, context) + }), + ...(input.match !== undefined && { + match: serializeAws_restJson1_1HttpRouteMatch(input.match, context) + }), + ...(input.retryPolicy !== undefined && { + retryPolicy: serializeAws_restJson1_1HttpRetryPolicy( + input.retryPolicy, + context + ) + }) + }; }; const serializeAws_restJson1_1HttpRouteAction = ( input: HttpRouteAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.weightedTargets !== undefined) { - bodyParams["weightedTargets"] = serializeAws_restJson1_1WeightedTargets( - input.weightedTargets, - context - ); - } - return bodyParams; + return { + ...(input.weightedTargets !== undefined && { + weightedTargets: serializeAws_restJson1_1WeightedTargets( + input.weightedTargets, + context + ) + }) + }; }; const serializeAws_restJson1_1HttpRouteHeader = ( input: HttpRouteHeader, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.invert !== undefined) { - bodyParams["invert"] = input.invert; - } - if (input.match !== undefined) { - bodyParams["match"] = serializeAws_restJson1_1HeaderMatchMethod( - input.match, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.invert !== undefined && { invert: input.invert }), + ...(input.match !== undefined && { + match: serializeAws_restJson1_1HeaderMatchMethod(input.match, context) + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1HttpRouteHeaders = ( @@ -5656,43 +5595,34 @@ const serializeAws_restJson1_1HttpRouteMatch = ( input: HttpRouteMatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.headers !== undefined) { - bodyParams["headers"] = serializeAws_restJson1_1HttpRouteHeaders( - input.headers, - context - ); - } - if (input.method !== undefined) { - bodyParams["method"] = input.method; - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - if (input.scheme !== undefined) { - bodyParams["scheme"] = input.scheme; - } - return bodyParams; + return { + ...(input.headers !== undefined && { + headers: serializeAws_restJson1_1HttpRouteHeaders(input.headers, context) + }), + ...(input.method !== undefined && { method: input.method }), + ...(input.prefix !== undefined && { prefix: input.prefix }), + ...(input.scheme !== undefined && { scheme: input.scheme }) + }; }; const serializeAws_restJson1_1Listener = ( input: Listener, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.healthCheck !== undefined) { - bodyParams["healthCheck"] = serializeAws_restJson1_1HealthCheckPolicy( - input.healthCheck, - context - ); - } - if (input.portMapping !== undefined) { - bodyParams["portMapping"] = serializeAws_restJson1_1PortMapping( - input.portMapping, - context - ); - } - return bodyParams; + return { + ...(input.healthCheck !== undefined && { + healthCheck: serializeAws_restJson1_1HealthCheckPolicy( + input.healthCheck, + context + ) + }), + ...(input.portMapping !== undefined && { + portMapping: serializeAws_restJson1_1PortMapping( + input.portMapping, + context + ) + }) + }; }; const serializeAws_restJson1_1Listeners = ( @@ -5706,91 +5636,66 @@ const serializeAws_restJson1_1Logging = ( input: Logging, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.accessLog !== undefined) { - bodyParams["accessLog"] = serializeAws_restJson1_1AccessLog( - input.accessLog, - context - ); - } - return bodyParams; + return { + ...(input.accessLog !== undefined && { + accessLog: serializeAws_restJson1_1AccessLog(input.accessLog, context) + }) + }; }; const serializeAws_restJson1_1MatchRange = ( input: MatchRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.end !== undefined) { - bodyParams["end"] = input.end; - } - if (input.start !== undefined) { - bodyParams["start"] = input.start; - } - return bodyParams; + return { + ...(input.end !== undefined && { end: input.end }), + ...(input.start !== undefined && { start: input.start }) + }; }; const serializeAws_restJson1_1MeshSpec = ( input: MeshSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.egressFilter !== undefined) { - bodyParams["egressFilter"] = serializeAws_restJson1_1EgressFilter( - input.egressFilter, - context - ); - } - return bodyParams; + return { + ...(input.egressFilter !== undefined && { + egressFilter: serializeAws_restJson1_1EgressFilter( + input.egressFilter, + context + ) + }) + }; }; const serializeAws_restJson1_1PortMapping = ( input: PortMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.port !== undefined) { - bodyParams["port"] = input.port; - } - if (input.protocol !== undefined) { - bodyParams["protocol"] = input.protocol; - } - return bodyParams; + return { + ...(input.port !== undefined && { port: input.port }), + ...(input.protocol !== undefined && { protocol: input.protocol }) + }; }; const serializeAws_restJson1_1RouteSpec = ( input: RouteSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.grpcRoute !== undefined) { - bodyParams["grpcRoute"] = serializeAws_restJson1_1GrpcRoute( - input.grpcRoute, - context - ); - } - if (input.http2Route !== undefined) { - bodyParams["http2Route"] = serializeAws_restJson1_1HttpRoute( - input.http2Route, - context - ); - } - if (input.httpRoute !== undefined) { - bodyParams["httpRoute"] = serializeAws_restJson1_1HttpRoute( - input.httpRoute, - context - ); - } - if (input.priority !== undefined) { - bodyParams["priority"] = input.priority; - } - if (input.tcpRoute !== undefined) { - bodyParams["tcpRoute"] = serializeAws_restJson1_1TcpRoute( - input.tcpRoute, - context - ); - } - return bodyParams; + return { + ...(input.grpcRoute !== undefined && { + grpcRoute: serializeAws_restJson1_1GrpcRoute(input.grpcRoute, context) + }), + ...(input.http2Route !== undefined && { + http2Route: serializeAws_restJson1_1HttpRoute(input.http2Route, context) + }), + ...(input.httpRoute !== undefined && { + httpRoute: serializeAws_restJson1_1HttpRoute(input.httpRoute, context) + }), + ...(input.priority !== undefined && { priority: input.priority }), + ...(input.tcpRoute !== undefined && { + tcpRoute: serializeAws_restJson1_1TcpRoute(input.tcpRoute, context) + }) + }; }; const serializeAws_restJson1_1ServiceDiscovery = ( @@ -5823,14 +5728,10 @@ const serializeAws_restJson1_1TagRef = ( input: TagRef, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1TcpRetryPolicyEvents = ( @@ -5844,85 +5745,73 @@ const serializeAws_restJson1_1TcpRoute = ( input: TcpRoute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = serializeAws_restJson1_1TcpRouteAction( - input.action, - context - ); - } - return bodyParams; + return { + ...(input.action !== undefined && { + action: serializeAws_restJson1_1TcpRouteAction(input.action, context) + }) + }; }; const serializeAws_restJson1_1TcpRouteAction = ( input: TcpRouteAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.weightedTargets !== undefined) { - bodyParams["weightedTargets"] = serializeAws_restJson1_1WeightedTargets( - input.weightedTargets, - context - ); - } - return bodyParams; + return { + ...(input.weightedTargets !== undefined && { + weightedTargets: serializeAws_restJson1_1WeightedTargets( + input.weightedTargets, + context + ) + }) + }; }; const serializeAws_restJson1_1VirtualNodeServiceProvider = ( input: VirtualNodeServiceProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.virtualNodeName !== undefined) { - bodyParams["virtualNodeName"] = input.virtualNodeName; - } - return bodyParams; + return { + ...(input.virtualNodeName !== undefined && { + virtualNodeName: input.virtualNodeName + }) + }; }; const serializeAws_restJson1_1VirtualNodeSpec = ( input: VirtualNodeSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.backends !== undefined) { - bodyParams["backends"] = serializeAws_restJson1_1Backends( - input.backends, - context - ); - } - if (input.listeners !== undefined) { - bodyParams["listeners"] = serializeAws_restJson1_1Listeners( - input.listeners, - context - ); - } - if (input.logging !== undefined) { - bodyParams["logging"] = serializeAws_restJson1_1Logging( - input.logging, - context - ); - } - if (input.serviceDiscovery !== undefined) { - bodyParams["serviceDiscovery"] = serializeAws_restJson1_1ServiceDiscovery( - input.serviceDiscovery, - context - ); - } - return bodyParams; + return { + ...(input.backends !== undefined && { + backends: serializeAws_restJson1_1Backends(input.backends, context) + }), + ...(input.listeners !== undefined && { + listeners: serializeAws_restJson1_1Listeners(input.listeners, context) + }), + ...(input.logging !== undefined && { + logging: serializeAws_restJson1_1Logging(input.logging, context) + }), + ...(input.serviceDiscovery !== undefined && { + serviceDiscovery: serializeAws_restJson1_1ServiceDiscovery( + input.serviceDiscovery, + context + ) + }) + }; }; const serializeAws_restJson1_1VirtualRouterListener = ( input: VirtualRouterListener, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.portMapping !== undefined) { - bodyParams["portMapping"] = serializeAws_restJson1_1PortMapping( - input.portMapping, - context - ); - } - return bodyParams; + return { + ...(input.portMapping !== undefined && { + portMapping: serializeAws_restJson1_1PortMapping( + input.portMapping, + context + ) + }) + }; }; const serializeAws_restJson1_1VirtualRouterListeners = ( @@ -5938,36 +5827,36 @@ const serializeAws_restJson1_1VirtualRouterServiceProvider = ( input: VirtualRouterServiceProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.virtualRouterName !== undefined) { - bodyParams["virtualRouterName"] = input.virtualRouterName; - } - return bodyParams; + return { + ...(input.virtualRouterName !== undefined && { + virtualRouterName: input.virtualRouterName + }) + }; }; const serializeAws_restJson1_1VirtualRouterSpec = ( input: VirtualRouterSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.listeners !== undefined) { - bodyParams["listeners"] = serializeAws_restJson1_1VirtualRouterListeners( - input.listeners, - context - ); - } - return bodyParams; + return { + ...(input.listeners !== undefined && { + listeners: serializeAws_restJson1_1VirtualRouterListeners( + input.listeners, + context + ) + }) + }; }; const serializeAws_restJson1_1VirtualServiceBackend = ( input: VirtualServiceBackend, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.virtualServiceName !== undefined) { - bodyParams["virtualServiceName"] = input.virtualServiceName; - } - return bodyParams; + return { + ...(input.virtualServiceName !== undefined && { + virtualServiceName: input.virtualServiceName + }) + }; }; const serializeAws_restJson1_1VirtualServiceProvider = ( @@ -5987,28 +5876,24 @@ const serializeAws_restJson1_1VirtualServiceSpec = ( input: VirtualServiceSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.provider !== undefined) { - bodyParams["provider"] = serializeAws_restJson1_1VirtualServiceProvider( - input.provider, - context - ); - } - return bodyParams; + return { + ...(input.provider !== undefined && { + provider: serializeAws_restJson1_1VirtualServiceProvider( + input.provider, + context + ) + }) + }; }; const serializeAws_restJson1_1WeightedTarget = ( input: WeightedTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.virtualNode !== undefined) { - bodyParams["virtualNode"] = input.virtualNode; - } - if (input.weight !== undefined) { - bodyParams["weight"] = input.weight; - } - return bodyParams; + return { + ...(input.virtualNode !== undefined && { virtualNode: input.virtualNode }), + ...(input.weight !== undefined && { weight: input.weight }) + }; }; const serializeAws_restJson1_1WeightedTargets = ( diff --git a/clients/client-appconfig/protocols/Aws_restJson1_1.ts b/clients/client-appconfig/protocols/Aws_restJson1_1.ts index 10dd8f1bc90b..0d6b10638383 100644 --- a/clients/client-appconfig/protocols/Aws_restJson1_1.ts +++ b/clients/client-appconfig/protocols/Aws_restJson1_1.ts @@ -4582,14 +4582,12 @@ const serializeAws_restJson1_1Monitor = ( input: Monitor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlarmArn !== undefined) { - bodyParams["AlarmArn"] = input.AlarmArn; - } - if (input.AlarmRoleArn !== undefined) { - bodyParams["AlarmRoleArn"] = input.AlarmRoleArn; - } - return bodyParams; + return { + ...(input.AlarmArn !== undefined && { AlarmArn: input.AlarmArn }), + ...(input.AlarmRoleArn !== undefined && { + AlarmRoleArn: input.AlarmRoleArn + }) + }; }; const serializeAws_restJson1_1MonitorList = ( @@ -4613,14 +4611,10 @@ const serializeAws_restJson1_1Validator = ( input: Validator, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Content !== undefined && { Content: input.Content }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1ValidatorList = ( 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 59e31dd73a25..dc59e0e581e6 100644 --- a/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts +++ b/clients/client-application-auto-scaling/protocols/Aws_json1_1.ts @@ -1392,206 +1392,162 @@ const serializeAws_json1_1CustomizedMetricSpecification = ( input: CustomizedMetricSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_json1_1MetricDimensions( - input.Dimensions, - context - ); - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Namespace !== undefined) { - bodyParams["Namespace"] = input.Namespace; - } - if (input.Statistic !== undefined) { - bodyParams["Statistic"] = input.Statistic; - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteScalingPolicyRequest = ( input: DeleteScalingPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteScheduledActionRequest = ( input: DeleteScheduledActionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ScheduledActionName !== undefined) { - bodyParams["ScheduledActionName"] = input.ScheduledActionName; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeregisterScalableTargetRequest = ( input: DeregisterScalableTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ScalableDimension !== undefined && { + ScalableDimension: input.ScalableDimension + }), + ...(input.ServiceNamespace !== undefined && { + ServiceNamespace: input.ServiceNamespace + }) + }; }; const serializeAws_json1_1DescribeScalableTargetsRequest = ( input: DescribeScalableTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceIds !== undefined) { - bodyParams["ResourceIds"] = serializeAws_json1_1ResourceIdsMaxLen1600( - input.ResourceIds, - context - ); - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeScalingActivitiesRequest = ( input: DescribeScalingActivitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeScalingPoliciesRequest = ( input: DescribeScalingPoliciesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PolicyNames !== undefined) { - bodyParams["PolicyNames"] = serializeAws_json1_1ResourceIdsMaxLen1600( - input.PolicyNames, - context - ); - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeScheduledActionsRequest = ( input: DescribeScheduledActionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ScheduledActionNames !== undefined) { - bodyParams[ - "ScheduledActionNames" - ] = serializeAws_json1_1ResourceIdsMaxLen1600( - input.ScheduledActionNames, - context - ); - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MetricDimension = ( input: MetricDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1MetricDimensions = ( @@ -1607,122 +1563,98 @@ const serializeAws_json1_1PredefinedMetricSpecification = ( input: PredefinedMetricSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PredefinedMetricType !== undefined) { - bodyParams["PredefinedMetricType"] = input.PredefinedMetricType; - } - if (input.ResourceLabel !== undefined) { - bodyParams["ResourceLabel"] = input.ResourceLabel; - } - return bodyParams; + return { + ...(input.PredefinedMetricType !== undefined && { + PredefinedMetricType: input.PredefinedMetricType + }), + ...(input.ResourceLabel !== undefined && { + ResourceLabel: input.ResourceLabel + }) + }; }; const serializeAws_json1_1PutScalingPolicyRequest = ( input: PutScalingPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - if (input.PolicyType !== undefined) { - bodyParams["PolicyType"] = input.PolicyType; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - if (input.StepScalingPolicyConfiguration !== undefined) { - bodyParams[ - "StepScalingPolicyConfiguration" - ] = serializeAws_json1_1StepScalingPolicyConfiguration( - input.StepScalingPolicyConfiguration, - context - ); - } - if (input.TargetTrackingScalingPolicyConfiguration !== undefined) { - bodyParams[ - "TargetTrackingScalingPolicyConfiguration" - ] = serializeAws_json1_1TargetTrackingScalingPolicyConfiguration( - input.TargetTrackingScalingPolicyConfiguration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutScheduledActionRequest = ( input: PutScheduledActionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ScalableTargetAction !== undefined) { - bodyParams[ - "ScalableTargetAction" - ] = serializeAws_json1_1ScalableTargetAction( - input.ScalableTargetAction, - context - ); - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.ScheduledActionName !== undefined) { - bodyParams["ScheduledActionName"] = input.ScheduledActionName; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RegisterScalableTargetRequest = ( input: RegisterScalableTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MinCapacity !== undefined) { - bodyParams["MinCapacity"] = input.MinCapacity; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - if (input.SuspendedState !== undefined) { - bodyParams["SuspendedState"] = serializeAws_json1_1SuspendedState( - input.SuspendedState, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ResourceIdsMaxLen1600 = ( @@ -1736,31 +1668,27 @@ const serializeAws_json1_1ScalableTargetAction = ( input: ScalableTargetAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MinCapacity !== undefined) { - bodyParams["MinCapacity"] = input.MinCapacity; - } - return bodyParams; + return { + ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), + ...(input.MinCapacity !== undefined && { MinCapacity: input.MinCapacity }) + }; }; const serializeAws_json1_1StepAdjustment = ( input: StepAdjustment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MetricIntervalLowerBound !== undefined) { - bodyParams["MetricIntervalLowerBound"] = input.MetricIntervalLowerBound; - } - if (input.MetricIntervalUpperBound !== undefined) { - bodyParams["MetricIntervalUpperBound"] = input.MetricIntervalUpperBound; - } - if (input.ScalingAdjustment !== undefined) { - bodyParams["ScalingAdjustment"] = input.ScalingAdjustment; - } - return bodyParams; + return { + ...(input.MetricIntervalLowerBound !== undefined && { + MetricIntervalLowerBound: input.MetricIntervalLowerBound + }), + ...(input.MetricIntervalUpperBound !== undefined && { + MetricIntervalUpperBound: input.MetricIntervalUpperBound + }), + ...(input.ScalingAdjustment !== undefined && { + ScalingAdjustment: input.ScalingAdjustment + }) + }; }; const serializeAws_json1_1StepAdjustments = ( @@ -1774,79 +1702,71 @@ const serializeAws_json1_1StepScalingPolicyConfiguration = ( input: StepScalingPolicyConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdjustmentType !== undefined) { - bodyParams["AdjustmentType"] = input.AdjustmentType; - } - if (input.Cooldown !== undefined) { - bodyParams["Cooldown"] = input.Cooldown; - } - if (input.MetricAggregationType !== undefined) { - bodyParams["MetricAggregationType"] = input.MetricAggregationType; - } - if (input.MinAdjustmentMagnitude !== undefined) { - bodyParams["MinAdjustmentMagnitude"] = input.MinAdjustmentMagnitude; - } - if (input.StepAdjustments !== undefined) { - bodyParams["StepAdjustments"] = serializeAws_json1_1StepAdjustments( - input.StepAdjustments, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SuspendedState = ( input: SuspendedState, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DynamicScalingInSuspended !== undefined) { - bodyParams["DynamicScalingInSuspended"] = input.DynamicScalingInSuspended; - } - if (input.DynamicScalingOutSuspended !== undefined) { - bodyParams["DynamicScalingOutSuspended"] = input.DynamicScalingOutSuspended; - } - if (input.ScheduledScalingSuspended !== undefined) { - bodyParams["ScheduledScalingSuspended"] = input.ScheduledScalingSuspended; - } - return bodyParams; + return { + ...(input.DynamicScalingInSuspended !== undefined && { + DynamicScalingInSuspended: input.DynamicScalingInSuspended + }), + ...(input.DynamicScalingOutSuspended !== undefined && { + DynamicScalingOutSuspended: input.DynamicScalingOutSuspended + }), + ...(input.ScheduledScalingSuspended !== undefined && { + ScheduledScalingSuspended: input.ScheduledScalingSuspended + }) + }; }; const serializeAws_json1_1TargetTrackingScalingPolicyConfiguration = ( input: TargetTrackingScalingPolicyConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomizedMetricSpecification !== undefined) { - bodyParams[ - "CustomizedMetricSpecification" - ] = serializeAws_json1_1CustomizedMetricSpecification( - input.CustomizedMetricSpecification, - context - ); - } - if (input.DisableScaleIn !== undefined) { - bodyParams["DisableScaleIn"] = input.DisableScaleIn; - } - if (input.PredefinedMetricSpecification !== undefined) { - bodyParams[ - "PredefinedMetricSpecification" - ] = serializeAws_json1_1PredefinedMetricSpecification( - input.PredefinedMetricSpecification, - context - ); - } - if (input.ScaleInCooldown !== undefined) { - bodyParams["ScaleInCooldown"] = input.ScaleInCooldown; - } - if (input.ScaleOutCooldown !== undefined) { - bodyParams["ScaleOutCooldown"] = input.ScaleOutCooldown; - } - if (input.TargetValue !== undefined) { - bodyParams["TargetValue"] = input.TargetValue; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1Alarm = ( 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 d02ed3899d1c..4987ddb068b5 100644 --- a/clients/client-application-discovery-service/protocols/Aws_json1_1.ts +++ b/clients/client-application-discovery-service/protocols/Aws_json1_1.ts @@ -3596,31 +3596,31 @@ const serializeAws_json1_1AssociateConfigurationItemsToApplicationRequest = ( input: AssociateConfigurationItemsToApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationConfigurationId !== undefined) { - bodyParams["applicationConfigurationId"] = input.applicationConfigurationId; - } - if (input.configurationIds !== undefined) { - bodyParams["configurationIds"] = serializeAws_json1_1ConfigurationIdList( - input.configurationIds, - context - ); - } - return bodyParams; + return { + ...(input.applicationConfigurationId !== undefined && { + applicationConfigurationId: input.applicationConfigurationId + }), + ...(input.configurationIds !== undefined && { + configurationIds: serializeAws_json1_1ConfigurationIdList( + input.configurationIds, + context + ) + }) + }; }; const serializeAws_json1_1BatchDeleteImportDataRequest = ( input: BatchDeleteImportDataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.importTaskIds !== undefined) { - bodyParams["importTaskIds"] = serializeAws_json1_1ToDeleteIdentifierList( - input.importTaskIds, - context - ); - } - return bodyParams; + return { + ...(input.importTaskIds !== undefined && { + importTaskIds: serializeAws_json1_1ToDeleteIdentifierList( + input.importTaskIds, + context + ) + }) + }; }; const serializeAws_json1_1ConfigurationIdList = ( @@ -3641,165 +3641,133 @@ const serializeAws_json1_1CreateApplicationRequest = ( input: CreateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1CreateTagsRequest = ( input: CreateTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationIds !== undefined) { - bodyParams["configurationIds"] = serializeAws_json1_1ConfigurationIdList( - input.configurationIds, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagSet(input.tags, context); - } - return bodyParams; + return { + ...(input.configurationIds !== undefined && { + configurationIds: serializeAws_json1_1ConfigurationIdList( + input.configurationIds, + context + ) + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagSet(input.tags, context) + }) + }; }; const serializeAws_json1_1DeleteApplicationsRequest = ( input: DeleteApplicationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationIds !== undefined) { - bodyParams["configurationIds"] = serializeAws_json1_1ApplicationIdsList( - input.configurationIds, - context - ); - } - return bodyParams; + return { + ...(input.configurationIds !== undefined && { + configurationIds: serializeAws_json1_1ApplicationIdsList( + input.configurationIds, + context + ) + }) + }; }; const serializeAws_json1_1DeleteTagsRequest = ( input: DeleteTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationIds !== undefined) { - bodyParams["configurationIds"] = serializeAws_json1_1ConfigurationIdList( - input.configurationIds, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagSet(input.tags, context); - } - return bodyParams; + return { + ...(input.configurationIds !== undefined && { + configurationIds: serializeAws_json1_1ConfigurationIdList( + input.configurationIds, + context + ) + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagSet(input.tags, context) + }) + }; }; const serializeAws_json1_1DescribeAgentsRequest = ( input: DescribeAgentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.agentIds !== undefined) { - bodyParams["agentIds"] = serializeAws_json1_1AgentIds( - input.agentIds, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1Filters(input.filters, context); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeConfigurationsRequest = ( input: DescribeConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationIds !== undefined) { - bodyParams["configurationIds"] = serializeAws_json1_1ConfigurationIdList( - input.configurationIds, - context - ); - } - return bodyParams; + return { + ...(input.configurationIds !== undefined && { + configurationIds: serializeAws_json1_1ConfigurationIdList( + input.configurationIds, + context + ) + }) + }; }; const serializeAws_json1_1DescribeContinuousExportsRequest = ( input: DescribeContinuousExportsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exportIds !== undefined) { - bodyParams["exportIds"] = serializeAws_json1_1ContinuousExportIds( - input.exportIds, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.exportIds !== undefined && { + exportIds: serializeAws_json1_1ContinuousExportIds( + input.exportIds, + context + ) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeExportConfigurationsRequest = ( input: DescribeExportConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exportIds !== undefined) { - bodyParams["exportIds"] = serializeAws_json1_1ExportIds( - input.exportIds, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.exportIds !== undefined && { + exportIds: serializeAws_json1_1ExportIds(input.exportIds, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeExportTasksRequest = ( input: DescribeExportTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exportIds !== undefined) { - bodyParams["exportIds"] = serializeAws_json1_1ExportIds( - input.exportIds, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1ExportFilters( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeImportTasksFilterList = ( @@ -3815,57 +3783,46 @@ const serializeAws_json1_1DescribeImportTasksRequest = ( input: DescribeImportTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1DescribeImportTasksFilterList( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_json1_1DescribeImportTasksFilterList( + input.filters, + context + ) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeTagsRequest = ( input: DescribeTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1TagFilters( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_json1_1TagFilters(input.filters, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DisassociateConfigurationItemsFromApplicationRequest = ( input: DisassociateConfigurationItemsFromApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationConfigurationId !== undefined) { - bodyParams["applicationConfigurationId"] = input.applicationConfigurationId; - } - if (input.configurationIds !== undefined) { - bodyParams["configurationIds"] = serializeAws_json1_1ConfigurationIdList( - input.configurationIds, - context - ); - } - return bodyParams; + return { + ...(input.applicationConfigurationId !== undefined && { + applicationConfigurationId: input.applicationConfigurationId + }), + ...(input.configurationIds !== undefined && { + configurationIds: serializeAws_json1_1ConfigurationIdList( + input.configurationIds, + context + ) + }) + }; }; const serializeAws_json1_1ExportDataFormats = ( @@ -3879,20 +3836,13 @@ const serializeAws_json1_1ExportFilter = ( input: ExportFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.condition !== undefined) { - bodyParams["condition"] = input.condition; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1FilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.condition !== undefined && { condition: input.condition }), + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_json1_1FilterValues(input.values, context) + }) + }; }; const serializeAws_json1_1ExportFilters = ( @@ -3913,20 +3863,13 @@ const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.condition !== undefined) { - bodyParams["condition"] = input.condition; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1FilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.condition !== undefined && { condition: input.condition }), + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_json1_1FilterValues(input.values, context) + }) + }; }; const serializeAws_json1_1FilterValues = ( @@ -3947,25 +3890,22 @@ const serializeAws_json1_1GetDiscoverySummaryRequest = ( input: GetDiscoverySummaryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ImportTaskFilter = ( input: ImportTaskFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1ImportTaskFilterValueList( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_json1_1ImportTaskFilterValueList( + input.values, + context + ) + }) + }; }; const serializeAws_json1_1ImportTaskFilterValueList = ( @@ -3979,68 +3919,51 @@ const serializeAws_json1_1ListConfigurationsRequest = ( input: ListConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationType !== undefined) { - bodyParams["configurationType"] = input.configurationType; - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1Filters(input.filters, context); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.orderBy !== undefined) { - bodyParams["orderBy"] = serializeAws_json1_1OrderByList( - input.orderBy, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListServerNeighborsRequest = ( input: ListServerNeighborsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationId !== undefined) { - bodyParams["configurationId"] = input.configurationId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.neighborConfigurationIds !== undefined) { - bodyParams[ - "neighborConfigurationIds" - ] = serializeAws_json1_1ConfigurationIdList( - input.neighborConfigurationIds, - context - ); - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.portInformationNeeded !== undefined) { - bodyParams["portInformationNeeded"] = input.portInformationNeeded; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1OrderByElement = ( input: OrderByElement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fieldName !== undefined) { - bodyParams["fieldName"] = input.fieldName; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + return { + ...(input.fieldName !== undefined && { fieldName: input.fieldName }), + ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }) + }; }; const serializeAws_json1_1OrderByList = ( @@ -4054,121 +3977,91 @@ const serializeAws_json1_1StartContinuousExportRequest = ( input: StartContinuousExportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1StartDataCollectionByAgentIdsRequest = ( input: StartDataCollectionByAgentIdsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.agentIds !== undefined) { - bodyParams["agentIds"] = serializeAws_json1_1AgentIds( - input.agentIds, - context - ); - } - return bodyParams; + return { + ...(input.agentIds !== undefined && { + agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) + }) + }; }; const serializeAws_json1_1StartExportTaskRequest = ( input: StartExportTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.exportDataFormat !== undefined) { - bodyParams["exportDataFormat"] = serializeAws_json1_1ExportDataFormats( - input.exportDataFormat, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1ExportFilters( - input.filters, - context - ); - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartImportTaskRequest = ( input: StartImportTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken === undefined) { - input.clientRequestToken = generateIdempotencyToken(); - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.importUrl !== undefined) { - bodyParams["importUrl"] = input.importUrl; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), + ...(input.importUrl !== undefined && { importUrl: input.importUrl }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1StopContinuousExportRequest = ( input: StopContinuousExportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exportId !== undefined) { - bodyParams["exportId"] = input.exportId; - } - return bodyParams; + return { + ...(input.exportId !== undefined && { exportId: input.exportId }) + }; }; const serializeAws_json1_1StopDataCollectionByAgentIdsRequest = ( input: StopDataCollectionByAgentIdsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.agentIds !== undefined) { - bodyParams["agentIds"] = serializeAws_json1_1AgentIds( - input.agentIds, - context - ); - } - return bodyParams; + return { + ...(input.agentIds !== undefined && { + agentIds: serializeAws_json1_1AgentIds(input.agentIds, context) + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagFilter = ( input: TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1FilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_json1_1FilterValues(input.values, context) + }) + }; }; const serializeAws_json1_1TagFilters = ( @@ -4196,17 +4089,13 @@ const serializeAws_json1_1UpdateApplicationRequest = ( input: UpdateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configurationId !== undefined) { - bodyParams["configurationId"] = input.configurationId; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.configurationId !== undefined && { + configurationId: input.configurationId + }), + ...(input.description !== undefined && { description: input.description }), + ...(input.name !== undefined && { name: input.name }) + }; }; const deserializeAws_json1_1AgentConfigurationStatus = ( diff --git a/clients/client-application-insights/protocols/Aws_json1_1.ts b/clients/client-application-insights/protocols/Aws_json1_1.ts index 29dd928d52e7..d354a458cd3e 100644 --- a/clients/client-application-insights/protocols/Aws_json1_1.ts +++ b/clients/client-application-insights/protocols/Aws_json1_1.ts @@ -3042,339 +3042,295 @@ const serializeAws_json1_1CreateApplicationRequest = ( input: CreateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OpsCenterEnabled !== undefined) { - bodyParams["OpsCenterEnabled"] = input.OpsCenterEnabled; - } - if (input.OpsItemSNSTopicArn !== undefined) { - bodyParams["OpsItemSNSTopicArn"] = input.OpsItemSNSTopicArn; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(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) + }) + }; }; const serializeAws_json1_1CreateComponentRequest = ( input: CreateComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.ResourceList !== undefined) { - bodyParams["ResourceList"] = serializeAws_json1_1ResourceList( - input.ResourceList, - context - ); - } - return bodyParams; + return { + ...(input.ComponentName !== undefined && { + ComponentName: input.ComponentName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }), + ...(input.ResourceList !== undefined && { + ResourceList: serializeAws_json1_1ResourceList( + input.ResourceList, + context + ) + }) + }; }; const serializeAws_json1_1CreateLogPatternRequest = ( input: CreateLogPatternRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pattern !== undefined) { - bodyParams["Pattern"] = input.Pattern; - } - if (input.PatternName !== undefined) { - bodyParams["PatternName"] = input.PatternName; - } - if (input.PatternSetName !== undefined) { - bodyParams["PatternSetName"] = input.PatternSetName; - } - if (input.Rank !== undefined) { - bodyParams["Rank"] = input.Rank; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteApplicationRequest = ( input: DeleteApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DeleteComponentRequest = ( input: DeleteComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.ComponentName !== undefined && { + ComponentName: input.ComponentName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DeleteLogPatternRequest = ( input: DeleteLogPatternRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PatternName !== undefined) { - bodyParams["PatternName"] = input.PatternName; - } - if (input.PatternSetName !== undefined) { - bodyParams["PatternSetName"] = input.PatternSetName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.PatternName !== undefined && { PatternName: input.PatternName }), + ...(input.PatternSetName !== undefined && { + PatternSetName: input.PatternSetName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DescribeApplicationRequest = ( input: DescribeApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DescribeComponentConfigurationRecommendationRequest = ( input: DescribeComponentConfigurationRecommendationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.Tier !== undefined) { - bodyParams["Tier"] = input.Tier; - } - return bodyParams; + return { + ...(input.ComponentName !== undefined && { + ComponentName: input.ComponentName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }), + ...(input.Tier !== undefined && { Tier: input.Tier }) + }; }; const serializeAws_json1_1DescribeComponentConfigurationRequest = ( input: DescribeComponentConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.ComponentName !== undefined && { + ComponentName: input.ComponentName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DescribeComponentRequest = ( input: DescribeComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.ComponentName !== undefined && { + ComponentName: input.ComponentName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DescribeLogPatternRequest = ( input: DescribeLogPatternRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PatternName !== undefined) { - bodyParams["PatternName"] = input.PatternName; - } - if (input.PatternSetName !== undefined) { - bodyParams["PatternSetName"] = input.PatternSetName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.PatternName !== undefined && { PatternName: input.PatternName }), + ...(input.PatternSetName !== undefined && { + PatternSetName: input.PatternSetName + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1DescribeObservationRequest = ( input: DescribeObservationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObservationId !== undefined) { - bodyParams["ObservationId"] = input.ObservationId; - } - return bodyParams; + return { + ...(input.ObservationId !== undefined && { + ObservationId: input.ObservationId + }) + }; }; const serializeAws_json1_1DescribeProblemObservationsRequest = ( input: DescribeProblemObservationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProblemId !== undefined) { - bodyParams["ProblemId"] = input.ProblemId; - } - return bodyParams; + return { + ...(input.ProblemId !== undefined && { ProblemId: input.ProblemId }) + }; }; const serializeAws_json1_1DescribeProblemRequest = ( input: DescribeProblemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProblemId !== undefined) { - bodyParams["ProblemId"] = input.ProblemId; - } - return bodyParams; + return { + ...(input.ProblemId !== undefined && { ProblemId: input.ProblemId }) + }; }; const serializeAws_json1_1ListApplicationsRequest = ( input: ListApplicationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListComponentsRequest = ( input: ListComponentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1ListConfigurationHistoryRequest = ( input: ListConfigurationHistoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.EventStatus !== undefined) { - bodyParams["EventStatus"] = input.EventStatus; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListLogPatternSetsRequest = ( input: ListLogPatternSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1ListLogPatternsRequest = ( input: ListLogPatternsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PatternSetName !== undefined) { - bodyParams["PatternSetName"] = input.PatternSetName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListProblemsRequest = ( input: ListProblemsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ResourceList = ( @@ -3385,14 +3341,10 @@ const serializeAws_json1_1ResourceList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -3413,120 +3365,103 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateApplicationRequest = ( input: UpdateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OpsCenterEnabled !== undefined) { - bodyParams["OpsCenterEnabled"] = input.OpsCenterEnabled; - } - if (input.OpsItemSNSTopicArn !== undefined) { - bodyParams["OpsItemSNSTopicArn"] = input.OpsItemSNSTopicArn; - } - if (input.RemoveSNSTopic !== undefined) { - bodyParams["RemoveSNSTopic"] = input.RemoveSNSTopic; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + return { + ...(input.OpsCenterEnabled !== undefined && { + OpsCenterEnabled: input.OpsCenterEnabled + }), + ...(input.OpsItemSNSTopicArn !== undefined && { + OpsItemSNSTopicArn: input.OpsItemSNSTopicArn + }), + ...(input.RemoveSNSTopic !== undefined && { + RemoveSNSTopic: input.RemoveSNSTopic + }), + ...(input.ResourceGroupName !== undefined && { + ResourceGroupName: input.ResourceGroupName + }) + }; }; const serializeAws_json1_1UpdateComponentConfigurationRequest = ( input: UpdateComponentConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentConfiguration !== undefined) { - bodyParams["ComponentConfiguration"] = input.ComponentConfiguration; - } - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.Monitor !== undefined) { - bodyParams["Monitor"] = input.Monitor; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.Tier !== undefined) { - bodyParams["Tier"] = input.Tier; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateComponentRequest = ( input: UpdateComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComponentName !== undefined) { - bodyParams["ComponentName"] = input.ComponentName; - } - if (input.NewComponentName !== undefined) { - bodyParams["NewComponentName"] = input.NewComponentName; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - if (input.ResourceList !== undefined) { - bodyParams["ResourceList"] = serializeAws_json1_1ResourceList( - input.ResourceList, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateLogPatternRequest = ( input: UpdateLogPatternRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pattern !== undefined) { - bodyParams["Pattern"] = input.Pattern; - } - if (input.PatternName !== undefined) { - bodyParams["PatternName"] = input.PatternName; - } - if (input.PatternSetName !== undefined) { - bodyParams["PatternSetName"] = input.PatternSetName; - } - if (input.Rank !== undefined) { - bodyParams["Rank"] = input.Rank; - } - if (input.ResourceGroupName !== undefined) { - bodyParams["ResourceGroupName"] = input.ResourceGroupName; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1ApplicationComponent = ( diff --git a/clients/client-appstream/protocols/Aws_json1_1.ts b/clients/client-appstream/protocols/Aws_json1_1.ts index c5d4ae62c349..cdce3e0bfef1 100644 --- a/clients/client-appstream/protocols/Aws_json1_1.ts +++ b/clients/client-appstream/protocols/Aws_json1_1.ts @@ -5178,14 +5178,12 @@ const serializeAws_json1_1AccessEndpoint = ( input: AccessEndpoint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointType !== undefined) { - bodyParams["EndpointType"] = input.EndpointType; - } - if (input.VpceId !== undefined) { - bodyParams["VpceId"] = input.VpceId; - } - return bodyParams; + return { + ...(input.EndpointType !== undefined && { + EndpointType: input.EndpointType + }), + ...(input.VpceId !== undefined && { VpceId: input.VpceId }) + }; }; const serializeAws_json1_1AccessEndpointList = ( @@ -5199,14 +5197,12 @@ const serializeAws_json1_1ApplicationSettings = ( input: ApplicationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.SettingsGroup !== undefined) { - bodyParams["SettingsGroup"] = input.SettingsGroup; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.SettingsGroup !== undefined && { + SettingsGroup: input.SettingsGroup + }) + }; }; const serializeAws_json1_1ArnList = ( @@ -5220,14 +5216,10 @@ const serializeAws_json1_1AssociateFleetRequest = ( input: AssociateFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetName !== undefined) { - bodyParams["FleetName"] = input.FleetName; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - return bodyParams; + return { + ...(input.FleetName !== undefined && { FleetName: input.FleetName }), + ...(input.StackName !== undefined && { StackName: input.StackName }) + }; }; const serializeAws_json1_1AwsAccountIdList = ( @@ -5241,624 +5233,488 @@ const serializeAws_json1_1BatchAssociateUserStackRequest = ( input: BatchAssociateUserStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserStackAssociations !== undefined) { - bodyParams[ - "UserStackAssociations" - ] = serializeAws_json1_1UserStackAssociationList( - input.UserStackAssociations, - context - ); - } - return bodyParams; + return { + ...(input.UserStackAssociations !== undefined && { + UserStackAssociations: serializeAws_json1_1UserStackAssociationList( + input.UserStackAssociations, + context + ) + }) + }; }; const serializeAws_json1_1BatchDisassociateUserStackRequest = ( input: BatchDisassociateUserStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserStackAssociations !== undefined) { - bodyParams[ - "UserStackAssociations" - ] = serializeAws_json1_1UserStackAssociationList( - input.UserStackAssociations, - context - ); - } - return bodyParams; + return { + ...(input.UserStackAssociations !== undefined && { + UserStackAssociations: serializeAws_json1_1UserStackAssociationList( + input.UserStackAssociations, + context + ) + }) + }; }; const serializeAws_json1_1ComputeCapacity = ( input: ComputeCapacity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredInstances !== undefined) { - bodyParams["DesiredInstances"] = input.DesiredInstances; - } - return bodyParams; + return { + ...(input.DesiredInstances !== undefined && { + DesiredInstances: input.DesiredInstances + }) + }; }; const serializeAws_json1_1CopyImageRequest = ( input: CopyImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationImageDescription !== undefined) { - bodyParams["DestinationImageDescription"] = - input.DestinationImageDescription; - } - if (input.DestinationImageName !== undefined) { - bodyParams["DestinationImageName"] = input.DestinationImageName; - } - if (input.DestinationRegion !== undefined) { - bodyParams["DestinationRegion"] = input.DestinationRegion; - } - if (input.SourceImageName !== undefined) { - bodyParams["SourceImageName"] = input.SourceImageName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateDirectoryConfigRequest = ( input: CreateDirectoryConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryName !== undefined) { - bodyParams["DirectoryName"] = input.DirectoryName; - } - if (input.OrganizationalUnitDistinguishedNames !== undefined) { - bodyParams[ - "OrganizationalUnitDistinguishedNames" - ] = serializeAws_json1_1OrganizationalUnitDistinguishedNamesList( - input.OrganizationalUnitDistinguishedNames, - context - ); - } - if (input.ServiceAccountCredentials !== undefined) { - bodyParams[ - "ServiceAccountCredentials" - ] = serializeAws_json1_1ServiceAccountCredentials( - input.ServiceAccountCredentials, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateFleetRequest = ( input: CreateFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComputeCapacity !== undefined) { - bodyParams["ComputeCapacity"] = serializeAws_json1_1ComputeCapacity( - input.ComputeCapacity, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisconnectTimeoutInSeconds !== undefined) { - bodyParams["DisconnectTimeoutInSeconds"] = input.DisconnectTimeoutInSeconds; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.DomainJoinInfo !== undefined) { - bodyParams["DomainJoinInfo"] = serializeAws_json1_1DomainJoinInfo( - input.DomainJoinInfo, - context - ); - } - if (input.EnableDefaultInternetAccess !== undefined) { - bodyParams["EnableDefaultInternetAccess"] = - input.EnableDefaultInternetAccess; - } - if (input.FleetType !== undefined) { - bodyParams["FleetType"] = input.FleetType; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.IdleDisconnectTimeoutInSeconds !== undefined) { - bodyParams["IdleDisconnectTimeoutInSeconds"] = - input.IdleDisconnectTimeoutInSeconds; - } - if (input.ImageArn !== undefined) { - bodyParams["ImageArn"] = input.ImageArn; - } - if (input.ImageName !== undefined) { - bodyParams["ImageName"] = input.ImageName; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.MaxUserDurationInSeconds !== undefined) { - bodyParams["MaxUserDurationInSeconds"] = input.MaxUserDurationInSeconds; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }), + ...(input.VpcConfig !== undefined && { + VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) + }) + }; }; const serializeAws_json1_1CreateImageBuilderRequest = ( input: CreateImageBuilderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessEndpoints !== undefined) { - bodyParams["AccessEndpoints"] = serializeAws_json1_1AccessEndpointList( - input.AccessEndpoints, - context - ); - } - if (input.AppstreamAgentVersion !== undefined) { - bodyParams["AppstreamAgentVersion"] = input.AppstreamAgentVersion; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.DomainJoinInfo !== undefined) { - bodyParams["DomainJoinInfo"] = serializeAws_json1_1DomainJoinInfo( - input.DomainJoinInfo, - context - ); - } - if (input.EnableDefaultInternetAccess !== undefined) { - bodyParams["EnableDefaultInternetAccess"] = - input.EnableDefaultInternetAccess; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.ImageArn !== undefined) { - bodyParams["ImageArn"] = input.ImageArn; - } - if (input.ImageName !== undefined) { - bodyParams["ImageName"] = input.ImageName; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateImageBuilderStreamingURLRequest = ( input: CreateImageBuilderStreamingURLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Validity !== undefined) { - bodyParams["Validity"] = input.Validity; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Validity !== undefined && { Validity: input.Validity }) + }; }; const serializeAws_json1_1CreateStackRequest = ( input: CreateStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessEndpoints !== undefined) { - bodyParams["AccessEndpoints"] = serializeAws_json1_1AccessEndpointList( - input.AccessEndpoints, - context - ); - } - if (input.ApplicationSettings !== undefined) { - bodyParams["ApplicationSettings"] = serializeAws_json1_1ApplicationSettings( - input.ApplicationSettings, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.EmbedHostDomains !== undefined) { - bodyParams["EmbedHostDomains"] = serializeAws_json1_1EmbedHostDomains( - input.EmbedHostDomains, - context - ); - } - if (input.FeedbackURL !== undefined) { - bodyParams["FeedbackURL"] = input.FeedbackURL; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RedirectURL !== undefined) { - bodyParams["RedirectURL"] = input.RedirectURL; - } - if (input.StorageConnectors !== undefined) { - bodyParams["StorageConnectors"] = serializeAws_json1_1StorageConnectorList( - input.StorageConnectors, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.UserSettings !== undefined) { - bodyParams["UserSettings"] = serializeAws_json1_1UserSettingList( - input.UserSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateStreamingURLRequest = ( input: CreateStreamingURLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationId !== undefined) { - bodyParams["ApplicationId"] = input.ApplicationId; - } - if (input.FleetName !== undefined) { - bodyParams["FleetName"] = input.FleetName; - } - if (input.SessionContext !== undefined) { - bodyParams["SessionContext"] = input.SessionContext; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - if (input.Validity !== undefined) { - bodyParams["Validity"] = input.Validity; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateUsageReportSubscriptionRequest = ( input: CreateUsageReportSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1CreateUserRequest = ( input: CreateUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.FirstName !== undefined) { - bodyParams["FirstName"] = input.FirstName; - } - if (input.LastName !== undefined) { - bodyParams["LastName"] = input.LastName; - } - if (input.MessageAction !== undefined) { - bodyParams["MessageAction"] = input.MessageAction; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteDirectoryConfigRequest = ( input: DeleteDirectoryConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryName !== undefined) { - bodyParams["DirectoryName"] = input.DirectoryName; - } - return bodyParams; + return { + ...(input.DirectoryName !== undefined && { + DirectoryName: input.DirectoryName + }) + }; }; const serializeAws_json1_1DeleteFleetRequest = ( input: DeleteFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteImageBuilderRequest = ( input: DeleteImageBuilderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteImagePermissionsRequest = ( input: DeleteImagePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SharedAccountId !== undefined) { - bodyParams["SharedAccountId"] = input.SharedAccountId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SharedAccountId !== undefined && { + SharedAccountId: input.SharedAccountId + }) + }; }; const serializeAws_json1_1DeleteImageRequest = ( input: DeleteImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteStackRequest = ( input: DeleteStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteUsageReportSubscriptionRequest = ( input: DeleteUsageReportSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DeleteUserRequest = ( input: DeleteUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.AuthenticationType !== undefined && { + AuthenticationType: input.AuthenticationType + }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1DescribeDirectoryConfigsRequest = ( input: DescribeDirectoryConfigsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryNames !== undefined) { - bodyParams["DirectoryNames"] = serializeAws_json1_1DirectoryNameList( - input.DirectoryNames, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryNames !== undefined && { + DirectoryNames: serializeAws_json1_1DirectoryNameList( + input.DirectoryNames, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeFleetsRequest = ( input: DescribeFleetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1StringList(input.Names, context); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Names !== undefined && { + Names: serializeAws_json1_1StringList(input.Names, context) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeImageBuildersRequest = ( input: DescribeImageBuildersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1StringList(input.Names, context); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.Names !== undefined && { + Names: serializeAws_json1_1StringList(input.Names, context) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeImagePermissionsRequest = ( input: DescribeImagePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SharedAwsAccountIds !== undefined) { - bodyParams["SharedAwsAccountIds"] = serializeAws_json1_1AwsAccountIdList( - input.SharedAwsAccountIds, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeImagesRequest = ( input: DescribeImagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arns !== undefined) { - bodyParams["Arns"] = serializeAws_json1_1ArnList(input.Arns, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1StringList(input.Names, context); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeSessionsRequest = ( input: DescribeSessionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.FleetName !== undefined) { - bodyParams["FleetName"] = input.FleetName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeStacksRequest = ( input: DescribeStacksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1StringList(input.Names, context); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Names !== undefined && { + Names: serializeAws_json1_1StringList(input.Names, context) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeUsageReportSubscriptionsRequest = ( input: DescribeUsageReportSubscriptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeUserStackAssociationsRequest = ( input: DescribeUserStackAssociationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeUsersRequest = ( input: DescribeUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.AuthenticationType !== undefined && { + AuthenticationType: input.AuthenticationType + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DirectoryNameList = ( @@ -5872,43 +5728,37 @@ const serializeAws_json1_1DisableUserRequest = ( input: DisableUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.AuthenticationType !== undefined && { + AuthenticationType: input.AuthenticationType + }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1DisassociateFleetRequest = ( input: DisassociateFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetName !== undefined) { - bodyParams["FleetName"] = input.FleetName; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - return bodyParams; + return { + ...(input.FleetName !== undefined && { FleetName: input.FleetName }), + ...(input.StackName !== undefined && { StackName: input.StackName }) + }; }; const serializeAws_json1_1DomainJoinInfo = ( input: DomainJoinInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryName !== undefined) { - bodyParams["DirectoryName"] = input.DirectoryName; - } - if (input.OrganizationalUnitDistinguishedName !== undefined) { - bodyParams["OrganizationalUnitDistinguishedName"] = - input.OrganizationalUnitDistinguishedName; - } - return bodyParams; + return { + ...(input.DirectoryName !== undefined && { + DirectoryName: input.DirectoryName + }), + ...(input.OrganizationalUnitDistinguishedName !== undefined && { + OrganizationalUnitDistinguishedName: + input.OrganizationalUnitDistinguishedName + }) + }; }; const serializeAws_json1_1DomainList = ( @@ -5929,25 +5779,21 @@ const serializeAws_json1_1EnableUserRequest = ( input: EnableUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.AuthenticationType !== undefined && { + AuthenticationType: input.AuthenticationType + }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1ExpireSessionRequest = ( input: ExpireSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SessionId !== undefined) { - bodyParams["SessionId"] = input.SessionId; - } - return bodyParams; + return { + ...(input.SessionId !== undefined && { SessionId: input.SessionId }) + }; }; const serializeAws_json1_1FleetAttributes = ( @@ -5961,53 +5807,41 @@ const serializeAws_json1_1ImagePermissions = ( input: ImagePermissions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.allowFleet !== undefined) { - bodyParams["allowFleet"] = input.allowFleet; - } - if (input.allowImageBuilder !== undefined) { - bodyParams["allowImageBuilder"] = input.allowImageBuilder; - } - return bodyParams; + return { + ...(input.allowFleet !== undefined && { allowFleet: input.allowFleet }), + ...(input.allowImageBuilder !== undefined && { + allowImageBuilder: input.allowImageBuilder + }) + }; }; const serializeAws_json1_1ListAssociatedFleetsRequest = ( input: ListAssociatedFleetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.StackName !== undefined && { StackName: input.StackName }) + }; }; const serializeAws_json1_1ListAssociatedStacksRequest = ( input: ListAssociatedStacksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetName !== undefined) { - bodyParams["FleetName"] = input.FleetName; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.FleetName !== undefined && { FleetName: input.FleetName }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1OrganizationalUnitDistinguishedNamesList = ( @@ -6028,14 +5862,12 @@ const serializeAws_json1_1ServiceAccountCredentials = ( input: ServiceAccountCredentials, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountName !== undefined) { - bodyParams["AccountName"] = input.AccountName; - } - if (input.AccountPassword !== undefined) { - bodyParams["AccountPassword"] = input.AccountPassword; - } - return bodyParams; + return { + ...(input.AccountName !== undefined && { AccountName: input.AccountName }), + ...(input.AccountPassword !== undefined && { + AccountPassword: input.AccountPassword + }) + }; }; const serializeAws_json1_1StackAttributes = ( @@ -6049,67 +5881,56 @@ const serializeAws_json1_1StartFleetRequest = ( input: StartFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StartImageBuilderRequest = ( input: StartImageBuilderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppstreamAgentVersion !== undefined) { - bodyParams["AppstreamAgentVersion"] = input.AppstreamAgentVersion; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.AppstreamAgentVersion !== undefined && { + AppstreamAgentVersion: input.AppstreamAgentVersion + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StopFleetRequest = ( input: StopFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StopImageBuilderRequest = ( input: StopImageBuilderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StorageConnector = ( input: StorageConnector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectorType !== undefined) { - bodyParams["ConnectorType"] = input.ConnectorType; - } - if (input.Domains !== undefined) { - bodyParams["Domains"] = serializeAws_json1_1DomainList( - input.Domains, - context - ); - } - if (input.ResourceIdentifier !== undefined) { - bodyParams["ResourceIdentifier"] = input.ResourceIdentifier; - } - return bodyParams; + return { + ...(input.ConnectorType !== undefined && { + ConnectorType: input.ConnectorType + }), + ...(input.Domains !== undefined && { + Domains: serializeAws_json1_1DomainList(input.Domains, context) + }), + ...(input.ResourceIdentifier !== undefined && { + ResourceIdentifier: input.ResourceIdentifier + }) + }; }; const serializeAws_json1_1StorageConnectorList = ( @@ -6146,14 +5967,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -6170,210 +5989,168 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateDirectoryConfigRequest = ( input: UpdateDirectoryConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryName !== undefined) { - bodyParams["DirectoryName"] = input.DirectoryName; - } - if (input.OrganizationalUnitDistinguishedNames !== undefined) { - bodyParams[ - "OrganizationalUnitDistinguishedNames" - ] = serializeAws_json1_1OrganizationalUnitDistinguishedNamesList( - input.OrganizationalUnitDistinguishedNames, - context - ); - } - if (input.ServiceAccountCredentials !== undefined) { - bodyParams[ - "ServiceAccountCredentials" - ] = serializeAws_json1_1ServiceAccountCredentials( - input.ServiceAccountCredentials, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateFleetRequest = ( input: UpdateFleetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributesToDelete !== undefined) { - bodyParams["AttributesToDelete"] = serializeAws_json1_1FleetAttributes( - input.AttributesToDelete, - context - ); - } - if (input.ComputeCapacity !== undefined) { - bodyParams["ComputeCapacity"] = serializeAws_json1_1ComputeCapacity( - input.ComputeCapacity, - context - ); - } - if (input.DeleteVpcConfig !== undefined) { - bodyParams["DeleteVpcConfig"] = input.DeleteVpcConfig; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisconnectTimeoutInSeconds !== undefined) { - bodyParams["DisconnectTimeoutInSeconds"] = input.DisconnectTimeoutInSeconds; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.DomainJoinInfo !== undefined) { - bodyParams["DomainJoinInfo"] = serializeAws_json1_1DomainJoinInfo( - input.DomainJoinInfo, - context - ); - } - if (input.EnableDefaultInternetAccess !== undefined) { - bodyParams["EnableDefaultInternetAccess"] = - input.EnableDefaultInternetAccess; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.IdleDisconnectTimeoutInSeconds !== undefined) { - bodyParams["IdleDisconnectTimeoutInSeconds"] = - input.IdleDisconnectTimeoutInSeconds; - } - if (input.ImageArn !== undefined) { - bodyParams["ImageArn"] = input.ImageArn; - } - if (input.ImageName !== undefined) { - bodyParams["ImageName"] = input.ImageName; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.MaxUserDurationInSeconds !== undefined) { - bodyParams["MaxUserDurationInSeconds"] = input.MaxUserDurationInSeconds; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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.VpcConfig !== undefined && { + VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) + }) + }; }; const serializeAws_json1_1UpdateImagePermissionsRequest = ( input: UpdateImagePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ImagePermissions !== undefined) { - bodyParams["ImagePermissions"] = serializeAws_json1_1ImagePermissions( - input.ImagePermissions, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SharedAccountId !== undefined) { - bodyParams["SharedAccountId"] = input.SharedAccountId; - } - return bodyParams; + return { + ...(input.ImagePermissions !== undefined && { + ImagePermissions: serializeAws_json1_1ImagePermissions( + input.ImagePermissions, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SharedAccountId !== undefined && { + SharedAccountId: input.SharedAccountId + }) + }; }; const serializeAws_json1_1UpdateStackRequest = ( input: UpdateStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessEndpoints !== undefined) { - bodyParams["AccessEndpoints"] = serializeAws_json1_1AccessEndpointList( - input.AccessEndpoints, - context - ); - } - if (input.ApplicationSettings !== undefined) { - bodyParams["ApplicationSettings"] = serializeAws_json1_1ApplicationSettings( - input.ApplicationSettings, - context - ); - } - if (input.AttributesToDelete !== undefined) { - bodyParams["AttributesToDelete"] = serializeAws_json1_1StackAttributes( - input.AttributesToDelete, - context - ); - } - if (input.DeleteStorageConnectors !== undefined) { - bodyParams["DeleteStorageConnectors"] = input.DeleteStorageConnectors; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.EmbedHostDomains !== undefined) { - bodyParams["EmbedHostDomains"] = serializeAws_json1_1EmbedHostDomains( - input.EmbedHostDomains, - context - ); - } - if (input.FeedbackURL !== undefined) { - bodyParams["FeedbackURL"] = input.FeedbackURL; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RedirectURL !== undefined) { - bodyParams["RedirectURL"] = input.RedirectURL; - } - if (input.StorageConnectors !== undefined) { - bodyParams["StorageConnectors"] = serializeAws_json1_1StorageConnectorList( - input.StorageConnectors, - context - ); - } - if (input.UserSettings !== undefined) { - bodyParams["UserSettings"] = serializeAws_json1_1UserSettingList( - input.UserSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UserSetting = ( input: UserSetting, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Permission !== undefined) { - bodyParams["Permission"] = input.Permission; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Permission !== undefined && { Permission: input.Permission }) + }; }; const serializeAws_json1_1UserSettingList = ( @@ -6387,20 +6164,16 @@ const serializeAws_json1_1UserStackAssociation = ( input: UserStackAssociation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationType !== undefined) { - bodyParams["AuthenticationType"] = input.AuthenticationType; - } - if (input.SendEmailNotification !== undefined) { - bodyParams["SendEmailNotification"] = input.SendEmailNotification; - } - if (input.StackName !== undefined) { - bodyParams["StackName"] = input.StackName; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UserStackAssociationList = ( @@ -6416,20 +6189,17 @@ const serializeAws_json1_1VpcConfig = ( input: VpcConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIdList( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIdList( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) + }) + }; }; const deserializeAws_json1_1AccessEndpoint = ( diff --git a/clients/client-appsync/protocols/Aws_restJson1_1.ts b/clients/client-appsync/protocols/Aws_restJson1_1.ts index bf67263f8e88..7eabb44d1934 100644 --- a/clients/client-appsync/protocols/Aws_restJson1_1.ts +++ b/clients/client-appsync/protocols/Aws_restJson1_1.ts @@ -6624,27 +6624,23 @@ const serializeAws_restJson1_1AdditionalAuthenticationProvider = ( input: AdditionalAuthenticationProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authenticationType !== undefined) { - bodyParams["authenticationType"] = input.authenticationType; - } - if (input.openIDConnectConfig !== undefined) { - bodyParams[ - "openIDConnectConfig" - ] = serializeAws_restJson1_1OpenIDConnectConfig( - input.openIDConnectConfig, - context - ); - } - if (input.userPoolConfig !== undefined) { - bodyParams[ - "userPoolConfig" - ] = serializeAws_restJson1_1CognitoUserPoolConfig( - input.userPoolConfig, - context - ); - } - return bodyParams; + return { + ...(input.authenticationType !== undefined && { + authenticationType: input.authenticationType + }), + ...(input.openIDConnectConfig !== undefined && { + openIDConnectConfig: serializeAws_restJson1_1OpenIDConnectConfig( + input.openIDConnectConfig, + context + ) + }), + ...(input.userPoolConfig !== undefined && { + userPoolConfig: serializeAws_restJson1_1CognitoUserPoolConfig( + input.userPoolConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1AdditionalAuthenticationProviders = ( @@ -6660,48 +6656,46 @@ const serializeAws_restJson1_1AuthorizationConfig = ( input: AuthorizationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorizationType !== undefined) { - bodyParams["authorizationType"] = input.authorizationType; - } - if (input.awsIamConfig !== undefined) { - bodyParams["awsIamConfig"] = serializeAws_restJson1_1AwsIamConfig( - input.awsIamConfig, - context - ); - } - return bodyParams; + return { + ...(input.authorizationType !== undefined && { + authorizationType: input.authorizationType + }), + ...(input.awsIamConfig !== undefined && { + awsIamConfig: serializeAws_restJson1_1AwsIamConfig( + input.awsIamConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1AwsIamConfig = ( input: AwsIamConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.signingRegion !== undefined) { - bodyParams["signingRegion"] = input.signingRegion; - } - if (input.signingServiceName !== undefined) { - bodyParams["signingServiceName"] = input.signingServiceName; - } - return bodyParams; + return { + ...(input.signingRegion !== undefined && { + signingRegion: input.signingRegion + }), + ...(input.signingServiceName !== undefined && { + signingServiceName: input.signingServiceName + }) + }; }; const serializeAws_restJson1_1CachingConfig = ( input: CachingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cachingKeys !== undefined) { - bodyParams["cachingKeys"] = serializeAws_restJson1_1CachingKeys( - input.cachingKeys, - context - ); - } - if (input.ttl !== undefined) { - bodyParams["ttl"] = input.ttl; - } - return bodyParams; + return { + ...(input.cachingKeys !== undefined && { + cachingKeys: serializeAws_restJson1_1CachingKeys( + input.cachingKeys, + context + ) + }), + ...(input.ttl !== undefined && { ttl: input.ttl }) + }; }; const serializeAws_restJson1_1CachingKeys = ( @@ -6715,74 +6709,60 @@ const serializeAws_restJson1_1CognitoUserPoolConfig = ( input: CognitoUserPoolConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appIdClientRegex !== undefined) { - bodyParams["appIdClientRegex"] = input.appIdClientRegex; - } - if (input.awsRegion !== undefined) { - bodyParams["awsRegion"] = input.awsRegion; - } - if (input.userPoolId !== undefined) { - bodyParams["userPoolId"] = input.userPoolId; - } - return bodyParams; + return { + ...(input.appIdClientRegex !== undefined && { + appIdClientRegex: input.appIdClientRegex + }), + ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), + ...(input.userPoolId !== undefined && { userPoolId: input.userPoolId }) + }; }; const serializeAws_restJson1_1DeltaSyncConfig = ( input: DeltaSyncConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.baseTableTTL !== undefined) { - bodyParams["baseTableTTL"] = input.baseTableTTL; - } - if (input.deltaSyncTableName !== undefined) { - bodyParams["deltaSyncTableName"] = input.deltaSyncTableName; - } - if (input.deltaSyncTableTTL !== undefined) { - bodyParams["deltaSyncTableTTL"] = input.deltaSyncTableTTL; - } - return bodyParams; + return { + ...(input.baseTableTTL !== undefined && { + baseTableTTL: input.baseTableTTL + }), + ...(input.deltaSyncTableName !== undefined && { + deltaSyncTableName: input.deltaSyncTableName + }), + ...(input.deltaSyncTableTTL !== undefined && { + deltaSyncTableTTL: input.deltaSyncTableTTL + }) + }; }; const serializeAws_restJson1_1DynamodbDataSourceConfig = ( input: DynamodbDataSourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsRegion !== undefined) { - bodyParams["awsRegion"] = input.awsRegion; - } - if (input.deltaSyncConfig !== undefined) { - bodyParams["deltaSyncConfig"] = serializeAws_restJson1_1DeltaSyncConfig( - input.deltaSyncConfig, - context - ); - } - if (input.tableName !== undefined) { - bodyParams["tableName"] = input.tableName; - } - if (input.useCallerCredentials !== undefined) { - bodyParams["useCallerCredentials"] = input.useCallerCredentials; - } - if (input.versioned !== undefined) { - bodyParams["versioned"] = input.versioned; - } - return bodyParams; + return { + ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), + ...(input.deltaSyncConfig !== undefined && { + deltaSyncConfig: serializeAws_restJson1_1DeltaSyncConfig( + input.deltaSyncConfig, + context + ) + }), + ...(input.tableName !== undefined && { tableName: input.tableName }), + ...(input.useCallerCredentials !== undefined && { + useCallerCredentials: input.useCallerCredentials + }), + ...(input.versioned !== undefined && { versioned: input.versioned }) + }; }; const serializeAws_restJson1_1ElasticsearchDataSourceConfig = ( input: ElasticsearchDataSourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsRegion !== undefined) { - bodyParams["awsRegion"] = input.awsRegion; - } - if (input.endpoint !== undefined) { - bodyParams["endpoint"] = input.endpoint; - } - return bodyParams; + return { + ...(input.awsRegion !== undefined && { awsRegion: input.awsRegion }), + ...(input.endpoint !== undefined && { endpoint: input.endpoint }) + }; }; const serializeAws_restJson1_1FunctionsIds = ( @@ -6796,157 +6776,133 @@ const serializeAws_restJson1_1HttpDataSourceConfig = ( input: HttpDataSourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorizationConfig !== undefined) { - bodyParams[ - "authorizationConfig" - ] = serializeAws_restJson1_1AuthorizationConfig( - input.authorizationConfig, - context - ); - } - if (input.endpoint !== undefined) { - bodyParams["endpoint"] = input.endpoint; - } - return bodyParams; + return { + ...(input.authorizationConfig !== undefined && { + authorizationConfig: serializeAws_restJson1_1AuthorizationConfig( + input.authorizationConfig, + context + ) + }), + ...(input.endpoint !== undefined && { endpoint: input.endpoint }) + }; }; const serializeAws_restJson1_1LambdaConflictHandlerConfig = ( input: LambdaConflictHandlerConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lambdaConflictHandlerArn !== undefined) { - bodyParams["lambdaConflictHandlerArn"] = input.lambdaConflictHandlerArn; - } - return bodyParams; + return { + ...(input.lambdaConflictHandlerArn !== undefined && { + lambdaConflictHandlerArn: input.lambdaConflictHandlerArn + }) + }; }; const serializeAws_restJson1_1LambdaDataSourceConfig = ( input: LambdaDataSourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lambdaFunctionArn !== undefined) { - bodyParams["lambdaFunctionArn"] = input.lambdaFunctionArn; - } - return bodyParams; + return { + ...(input.lambdaFunctionArn !== undefined && { + lambdaFunctionArn: input.lambdaFunctionArn + }) + }; }; const serializeAws_restJson1_1LogConfig = ( input: LogConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cloudWatchLogsRoleArn !== undefined) { - bodyParams["cloudWatchLogsRoleArn"] = input.cloudWatchLogsRoleArn; - } - if (input.excludeVerboseContent !== undefined) { - bodyParams["excludeVerboseContent"] = input.excludeVerboseContent; - } - if (input.fieldLogLevel !== undefined) { - bodyParams["fieldLogLevel"] = input.fieldLogLevel; - } - return bodyParams; + return { + ...(input.cloudWatchLogsRoleArn !== undefined && { + cloudWatchLogsRoleArn: input.cloudWatchLogsRoleArn + }), + ...(input.excludeVerboseContent !== undefined && { + excludeVerboseContent: input.excludeVerboseContent + }), + ...(input.fieldLogLevel !== undefined && { + fieldLogLevel: input.fieldLogLevel + }) + }; }; const serializeAws_restJson1_1OpenIDConnectConfig = ( input: OpenIDConnectConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authTTL !== undefined) { - bodyParams["authTTL"] = input.authTTL; - } - if (input.clientId !== undefined) { - bodyParams["clientId"] = input.clientId; - } - if (input.iatTTL !== undefined) { - bodyParams["iatTTL"] = input.iatTTL; - } - if (input.issuer !== undefined) { - bodyParams["issuer"] = input.issuer; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1PipelineConfig = ( input: PipelineConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.functions !== undefined) { - bodyParams["functions"] = serializeAws_restJson1_1FunctionsIds( - input.functions, - context - ); - } - return bodyParams; + return { + ...(input.functions !== undefined && { + functions: serializeAws_restJson1_1FunctionsIds(input.functions, context) + }) + }; }; const serializeAws_restJson1_1RdsHttpEndpointConfig = ( input: RdsHttpEndpointConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsRegion !== undefined) { - bodyParams["awsRegion"] = input.awsRegion; - } - if (input.awsSecretStoreArn !== undefined) { - bodyParams["awsSecretStoreArn"] = input.awsSecretStoreArn; - } - if (input.databaseName !== undefined) { - bodyParams["databaseName"] = input.databaseName; - } - if (input.dbClusterIdentifier !== undefined) { - bodyParams["dbClusterIdentifier"] = input.dbClusterIdentifier; - } - if (input.schema !== undefined) { - bodyParams["schema"] = input.schema; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1RelationalDatabaseDataSourceConfig = ( input: RelationalDatabaseDataSourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.rdsHttpEndpointConfig !== undefined) { - bodyParams[ - "rdsHttpEndpointConfig" - ] = serializeAws_restJson1_1RdsHttpEndpointConfig( - input.rdsHttpEndpointConfig, - context - ); - } - if (input.relationalDatabaseSourceType !== undefined) { - bodyParams["relationalDatabaseSourceType"] = - input.relationalDatabaseSourceType; - } - return bodyParams; + return { + ...(input.rdsHttpEndpointConfig !== undefined && { + rdsHttpEndpointConfig: serializeAws_restJson1_1RdsHttpEndpointConfig( + input.rdsHttpEndpointConfig, + context + ) + }), + ...(input.relationalDatabaseSourceType !== undefined && { + relationalDatabaseSourceType: input.relationalDatabaseSourceType + }) + }; }; const serializeAws_restJson1_1SyncConfig = ( input: SyncConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.conflictDetection !== undefined) { - bodyParams["conflictDetection"] = input.conflictDetection; - } - if (input.conflictHandler !== undefined) { - bodyParams["conflictHandler"] = input.conflictHandler; - } - if (input.lambdaConflictHandlerConfig !== undefined) { - bodyParams[ - "lambdaConflictHandlerConfig" - ] = serializeAws_restJson1_1LambdaConflictHandlerConfig( - input.lambdaConflictHandlerConfig, - context - ); - } - return bodyParams; + return { + ...(input.conflictDetection !== undefined && { + conflictDetection: input.conflictDetection + }), + ...(input.conflictHandler !== undefined && { + conflictHandler: input.conflictHandler + }), + ...(input.lambdaConflictHandlerConfig !== undefined && { + lambdaConflictHandlerConfig: serializeAws_restJson1_1LambdaConflictHandlerConfig( + input.lambdaConflictHandlerConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1TagMap = ( @@ -6963,20 +6919,16 @@ const serializeAws_restJson1_1UserPoolConfig = ( input: UserPoolConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appIdClientRegex !== undefined) { - bodyParams["appIdClientRegex"] = input.appIdClientRegex; - } - if (input.awsRegion !== undefined) { - bodyParams["awsRegion"] = input.awsRegion; - } - if (input.defaultAction !== undefined) { - bodyParams["defaultAction"] = input.defaultAction; - } - if (input.userPoolId !== undefined) { - bodyParams["userPoolId"] = input.userPoolId; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_restJson1_1AdditionalAuthenticationProvider = ( diff --git a/clients/client-athena/protocols/Aws_json1_1.ts b/clients/client-athena/protocols/Aws_json1_1.ts index f818e61b5ae5..3483fe945c63 100644 --- a/clients/client-athena/protocols/Aws_json1_1.ts +++ b/clients/client-athena/protocols/Aws_json1_1.ts @@ -1916,237 +1916,181 @@ const serializeAws_json1_1BatchGetNamedQueryInput = ( input: BatchGetNamedQueryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NamedQueryIds !== undefined) { - bodyParams["NamedQueryIds"] = serializeAws_json1_1NamedQueryIdList( - input.NamedQueryIds, - context - ); - } - return bodyParams; + return { + ...(input.NamedQueryIds !== undefined && { + NamedQueryIds: serializeAws_json1_1NamedQueryIdList( + input.NamedQueryIds, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetQueryExecutionInput = ( input: BatchGetQueryExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QueryExecutionIds !== undefined) { - bodyParams["QueryExecutionIds"] = serializeAws_json1_1QueryExecutionIdList( - input.QueryExecutionIds, - context - ); - } - return bodyParams; + return { + ...(input.QueryExecutionIds !== undefined && { + QueryExecutionIds: serializeAws_json1_1QueryExecutionIdList( + input.QueryExecutionIds, + context + ) + }) + }; }; const serializeAws_json1_1CreateNamedQueryInput = ( input: CreateNamedQueryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.QueryString !== undefined) { - bodyParams["QueryString"] = input.QueryString; - } - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateWorkGroupInput = ( input: CreateWorkGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = serializeAws_json1_1WorkGroupConfiguration( - input.Configuration, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteNamedQueryInput = ( input: DeleteNamedQueryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NamedQueryId === undefined) { - input.NamedQueryId = generateIdempotencyToken(); - } - if (input.NamedQueryId !== undefined) { - bodyParams["NamedQueryId"] = input.NamedQueryId; - } - return bodyParams; + return { + NamedQueryId: input.NamedQueryId ?? generateIdempotencyToken() + }; }; const serializeAws_json1_1DeleteWorkGroupInput = ( input: DeleteWorkGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecursiveDeleteOption !== undefined) { - bodyParams["RecursiveDeleteOption"] = input.RecursiveDeleteOption; - } - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + return { + ...(input.RecursiveDeleteOption !== undefined && { + RecursiveDeleteOption: input.RecursiveDeleteOption + }), + ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }) + }; }; const serializeAws_json1_1EncryptionConfiguration = ( input: EncryptionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionOption !== undefined) { - bodyParams["EncryptionOption"] = input.EncryptionOption; - } - if (input.KmsKey !== undefined) { - bodyParams["KmsKey"] = input.KmsKey; - } - return bodyParams; + return { + ...(input.EncryptionOption !== undefined && { + EncryptionOption: input.EncryptionOption + }), + ...(input.KmsKey !== undefined && { KmsKey: input.KmsKey }) + }; }; const serializeAws_json1_1GetNamedQueryInput = ( input: GetNamedQueryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NamedQueryId !== undefined) { - bodyParams["NamedQueryId"] = input.NamedQueryId; - } - return bodyParams; + return { + ...(input.NamedQueryId !== undefined && { + NamedQueryId: input.NamedQueryId + }) + }; }; const serializeAws_json1_1GetQueryExecutionInput = ( input: GetQueryExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QueryExecutionId !== undefined) { - bodyParams["QueryExecutionId"] = input.QueryExecutionId; - } - return bodyParams; + return { + ...(input.QueryExecutionId !== undefined && { + QueryExecutionId: input.QueryExecutionId + }) + }; }; const serializeAws_json1_1GetQueryResultsInput = ( input: GetQueryResultsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.QueryExecutionId !== undefined) { - bodyParams["QueryExecutionId"] = input.QueryExecutionId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.QueryExecutionId !== undefined && { + QueryExecutionId: input.QueryExecutionId + }) + }; }; const serializeAws_json1_1GetWorkGroupInput = ( input: GetWorkGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + return { + ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }) + }; }; const serializeAws_json1_1ListNamedQueriesInput = ( input: ListNamedQueriesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }) + }; }; const serializeAws_json1_1ListQueryExecutionsInput = ( input: ListQueryExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListWorkGroupsInput = ( input: ListWorkGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1NamedQueryIdList = ( @@ -2160,11 +2104,9 @@ const serializeAws_json1_1QueryExecutionContext = ( input: QueryExecutionContext, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }) + }; }; const serializeAws_json1_1QueryExecutionIdList = ( @@ -2178,104 +2120,79 @@ const serializeAws_json1_1ResultConfiguration = ( input: ResultConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.OutputLocation !== undefined) { - bodyParams["OutputLocation"] = input.OutputLocation; - } - return bodyParams; + return { + ...(input.EncryptionConfiguration !== undefined && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration( + input.EncryptionConfiguration, + context + ) + }), + ...(input.OutputLocation !== undefined && { + OutputLocation: input.OutputLocation + }) + }; }; const serializeAws_json1_1ResultConfigurationUpdates = ( input: ResultConfigurationUpdates, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.OutputLocation !== undefined) { - bodyParams["OutputLocation"] = input.OutputLocation; - } - if (input.RemoveEncryptionConfiguration !== undefined) { - bodyParams["RemoveEncryptionConfiguration"] = - input.RemoveEncryptionConfiguration; - } - if (input.RemoveOutputLocation !== undefined) { - bodyParams["RemoveOutputLocation"] = input.RemoveOutputLocation; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1StartQueryExecutionInput = ( input: StartQueryExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.QueryExecutionContext !== undefined) { - bodyParams[ - "QueryExecutionContext" - ] = serializeAws_json1_1QueryExecutionContext( - input.QueryExecutionContext, - context - ); - } - if (input.QueryString !== undefined) { - bodyParams["QueryString"] = input.QueryString; - } - if (input.ResultConfiguration !== undefined) { - bodyParams["ResultConfiguration"] = serializeAws_json1_1ResultConfiguration( - input.ResultConfiguration, - context - ); - } - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StopQueryExecutionInput = ( input: StopQueryExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QueryExecutionId === undefined) { - input.QueryExecutionId = generateIdempotencyToken(); - } - if (input.QueryExecutionId !== undefined) { - bodyParams["QueryExecutionId"] = input.QueryExecutionId; - } - return bodyParams; + return { + QueryExecutionId: input.QueryExecutionId ?? generateIdempotencyToken() + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -2296,118 +2213,96 @@ const serializeAws_json1_1TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateWorkGroupInput = ( input: UpdateWorkGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationUpdates !== undefined) { - bodyParams[ - "ConfigurationUpdates" - ] = serializeAws_json1_1WorkGroupConfigurationUpdates( - input.ConfigurationUpdates, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1WorkGroupConfiguration = ( input: WorkGroupConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BytesScannedCutoffPerQuery !== undefined) { - bodyParams["BytesScannedCutoffPerQuery"] = input.BytesScannedCutoffPerQuery; - } - if (input.EnforceWorkGroupConfiguration !== undefined) { - bodyParams["EnforceWorkGroupConfiguration"] = - input.EnforceWorkGroupConfiguration; - } - if (input.PublishCloudWatchMetricsEnabled !== undefined) { - bodyParams["PublishCloudWatchMetricsEnabled"] = - input.PublishCloudWatchMetricsEnabled; - } - if (input.RequesterPaysEnabled !== undefined) { - bodyParams["RequesterPaysEnabled"] = input.RequesterPaysEnabled; - } - if (input.ResultConfiguration !== undefined) { - bodyParams["ResultConfiguration"] = serializeAws_json1_1ResultConfiguration( - input.ResultConfiguration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1WorkGroupConfigurationUpdates = ( input: WorkGroupConfigurationUpdates, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BytesScannedCutoffPerQuery !== undefined) { - bodyParams["BytesScannedCutoffPerQuery"] = input.BytesScannedCutoffPerQuery; - } - if (input.EnforceWorkGroupConfiguration !== undefined) { - bodyParams["EnforceWorkGroupConfiguration"] = - input.EnforceWorkGroupConfiguration; - } - if (input.PublishCloudWatchMetricsEnabled !== undefined) { - bodyParams["PublishCloudWatchMetricsEnabled"] = - input.PublishCloudWatchMetricsEnabled; - } - if (input.RemoveBytesScannedCutoffPerQuery !== undefined) { - bodyParams["RemoveBytesScannedCutoffPerQuery"] = - input.RemoveBytesScannedCutoffPerQuery; - } - if (input.RequesterPaysEnabled !== undefined) { - bodyParams["RequesterPaysEnabled"] = input.RequesterPaysEnabled; - } - if (input.ResultConfigurationUpdates !== undefined) { - bodyParams[ - "ResultConfigurationUpdates" - ] = serializeAws_json1_1ResultConfigurationUpdates( - input.ResultConfigurationUpdates, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const deserializeAws_json1_1BatchGetNamedQueryOutput = ( 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 272c4462faa2..e3d52246441f 100644 --- a/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts +++ b/clients/client-auto-scaling-plans/protocols/Aws_json1_1.ts @@ -826,17 +826,14 @@ const serializeAws_json1_1ApplicationSource = ( input: ApplicationSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudFormationStackARN !== undefined) { - bodyParams["CloudFormationStackARN"] = input.CloudFormationStackARN; - } - if (input.TagFilters !== undefined) { - bodyParams["TagFilters"] = serializeAws_json1_1TagFilters( - input.TagFilters, - context - ); - } - return bodyParams; + return { + ...(input.CloudFormationStackARN !== undefined && { + CloudFormationStackARN: input.CloudFormationStackARN + }), + ...(input.TagFilters !== undefined && { + TagFilters: serializeAws_json1_1TagFilters(input.TagFilters, context) + }) + }; }; const serializeAws_json1_1ApplicationSources = ( @@ -852,184 +849,154 @@ const serializeAws_json1_1CreateScalingPlanRequest = ( input: CreateScalingPlanRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationSource !== undefined) { - bodyParams["ApplicationSource"] = serializeAws_json1_1ApplicationSource( - input.ApplicationSource, - context - ); - } - if (input.ScalingInstructions !== undefined) { - bodyParams["ScalingInstructions"] = serializeAws_json1_1ScalingInstructions( - input.ScalingInstructions, - context - ); - } - if (input.ScalingPlanName !== undefined) { - bodyParams["ScalingPlanName"] = input.ScalingPlanName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CustomizedLoadMetricSpecification = ( input: CustomizedLoadMetricSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_json1_1MetricDimensions( - input.Dimensions, - context - ); - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Namespace !== undefined) { - bodyParams["Namespace"] = input.Namespace; - } - if (input.Statistic !== undefined) { - bodyParams["Statistic"] = input.Statistic; - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CustomizedScalingMetricSpecification = ( input: CustomizedScalingMetricSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_json1_1MetricDimensions( - input.Dimensions, - context - ); - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Namespace !== undefined) { - bodyParams["Namespace"] = input.Namespace; - } - if (input.Statistic !== undefined) { - bodyParams["Statistic"] = input.Statistic; - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteScalingPlanRequest = ( input: DeleteScalingPlanRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScalingPlanName !== undefined) { - bodyParams["ScalingPlanName"] = input.ScalingPlanName; - } - if (input.ScalingPlanVersion !== undefined) { - bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; - } - return bodyParams; + return { + ...(input.ScalingPlanName !== undefined && { + ScalingPlanName: input.ScalingPlanName + }), + ...(input.ScalingPlanVersion !== undefined && { + ScalingPlanVersion: input.ScalingPlanVersion + }) + }; }; const serializeAws_json1_1DescribeScalingPlanResourcesRequest = ( input: DescribeScalingPlanResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ScalingPlanName !== undefined) { - bodyParams["ScalingPlanName"] = input.ScalingPlanName; - } - if (input.ScalingPlanVersion !== undefined) { - bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeScalingPlansRequest = ( input: DescribeScalingPlansRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationSources !== undefined) { - bodyParams["ApplicationSources"] = serializeAws_json1_1ApplicationSources( - input.ApplicationSources, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ScalingPlanNames !== undefined) { - bodyParams["ScalingPlanNames"] = serializeAws_json1_1ScalingPlanNames( - input.ScalingPlanNames, - context - ); - } - if (input.ScalingPlanVersion !== undefined) { - bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetScalingPlanResourceForecastDataRequest = ( input: GetScalingPlanResourceForecastDataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.ForecastDataType !== undefined) { - bodyParams["ForecastDataType"] = input.ForecastDataType; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ScalingPlanName !== undefined) { - bodyParams["ScalingPlanName"] = input.ScalingPlanName; - } - if (input.ScalingPlanVersion !== undefined) { - bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1MetricDimension = ( input: MetricDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1MetricDimensions = ( @@ -1045,97 +1012,83 @@ const serializeAws_json1_1PredefinedLoadMetricSpecification = ( input: PredefinedLoadMetricSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PredefinedLoadMetricType !== undefined) { - bodyParams["PredefinedLoadMetricType"] = input.PredefinedLoadMetricType; - } - if (input.ResourceLabel !== undefined) { - bodyParams["ResourceLabel"] = input.ResourceLabel; - } - return bodyParams; + return { + ...(input.PredefinedLoadMetricType !== undefined && { + PredefinedLoadMetricType: input.PredefinedLoadMetricType + }), + ...(input.ResourceLabel !== undefined && { + ResourceLabel: input.ResourceLabel + }) + }; }; const serializeAws_json1_1PredefinedScalingMetricSpecification = ( input: PredefinedScalingMetricSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PredefinedScalingMetricType !== undefined) { - bodyParams["PredefinedScalingMetricType"] = - input.PredefinedScalingMetricType; - } - if (input.ResourceLabel !== undefined) { - bodyParams["ResourceLabel"] = input.ResourceLabel; - } - return bodyParams; + return { + ...(input.PredefinedScalingMetricType !== undefined && { + PredefinedScalingMetricType: input.PredefinedScalingMetricType + }), + ...(input.ResourceLabel !== undefined && { + ResourceLabel: input.ResourceLabel + }) + }; }; const serializeAws_json1_1ScalingInstruction = ( input: ScalingInstruction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomizedLoadMetricSpecification !== undefined) { - bodyParams[ - "CustomizedLoadMetricSpecification" - ] = serializeAws_json1_1CustomizedLoadMetricSpecification( - input.CustomizedLoadMetricSpecification, - context - ); - } - if (input.DisableDynamicScaling !== undefined) { - bodyParams["DisableDynamicScaling"] = input.DisableDynamicScaling; - } - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MinCapacity !== undefined) { - bodyParams["MinCapacity"] = input.MinCapacity; - } - if (input.PredefinedLoadMetricSpecification !== undefined) { - bodyParams[ - "PredefinedLoadMetricSpecification" - ] = serializeAws_json1_1PredefinedLoadMetricSpecification( - input.PredefinedLoadMetricSpecification, - context - ); - } - if (input.PredictiveScalingMaxCapacityBehavior !== undefined) { - bodyParams["PredictiveScalingMaxCapacityBehavior"] = - input.PredictiveScalingMaxCapacityBehavior; - } - if (input.PredictiveScalingMaxCapacityBuffer !== undefined) { - bodyParams["PredictiveScalingMaxCapacityBuffer"] = - input.PredictiveScalingMaxCapacityBuffer; - } - if (input.PredictiveScalingMode !== undefined) { - bodyParams["PredictiveScalingMode"] = input.PredictiveScalingMode; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ScalableDimension !== undefined) { - bodyParams["ScalableDimension"] = input.ScalableDimension; - } - if (input.ScalingPolicyUpdateBehavior !== undefined) { - bodyParams["ScalingPolicyUpdateBehavior"] = - input.ScalingPolicyUpdateBehavior; - } - if (input.ScheduledActionBufferTime !== undefined) { - bodyParams["ScheduledActionBufferTime"] = input.ScheduledActionBufferTime; - } - if (input.ServiceNamespace !== undefined) { - bodyParams["ServiceNamespace"] = input.ServiceNamespace; - } - if (input.TargetTrackingConfigurations !== undefined) { - bodyParams[ - "TargetTrackingConfigurations" - ] = serializeAws_json1_1TargetTrackingConfigurations( - input.TargetTrackingConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ScalingInstructions = ( @@ -1158,14 +1111,12 @@ const serializeAws_json1_1TagFilter = ( input: TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1TagValues(input.Values, context); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1TagValues(input.Values, context) + }) + }; }; const serializeAws_json1_1TagFilters = ( @@ -1186,39 +1137,33 @@ const serializeAws_json1_1TargetTrackingConfiguration = ( input: TargetTrackingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomizedScalingMetricSpecification !== undefined) { - bodyParams[ - "CustomizedScalingMetricSpecification" - ] = serializeAws_json1_1CustomizedScalingMetricSpecification( - input.CustomizedScalingMetricSpecification, - context - ); - } - if (input.DisableScaleIn !== undefined) { - bodyParams["DisableScaleIn"] = input.DisableScaleIn; - } - if (input.EstimatedInstanceWarmup !== undefined) { - bodyParams["EstimatedInstanceWarmup"] = input.EstimatedInstanceWarmup; - } - if (input.PredefinedScalingMetricSpecification !== undefined) { - bodyParams[ - "PredefinedScalingMetricSpecification" - ] = serializeAws_json1_1PredefinedScalingMetricSpecification( - input.PredefinedScalingMetricSpecification, - context - ); - } - if (input.ScaleInCooldown !== undefined) { - bodyParams["ScaleInCooldown"] = input.ScaleInCooldown; - } - if (input.ScaleOutCooldown !== undefined) { - bodyParams["ScaleOutCooldown"] = input.ScaleOutCooldown; - } - if (input.TargetValue !== undefined) { - bodyParams["TargetValue"] = input.TargetValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1TargetTrackingConfigurations = ( @@ -1234,26 +1179,26 @@ const serializeAws_json1_1UpdateScalingPlanRequest = ( input: UpdateScalingPlanRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationSource !== undefined) { - bodyParams["ApplicationSource"] = serializeAws_json1_1ApplicationSource( - input.ApplicationSource, - context - ); - } - if (input.ScalingInstructions !== undefined) { - bodyParams["ScalingInstructions"] = serializeAws_json1_1ScalingInstructions( - input.ScalingInstructions, - context - ); - } - if (input.ScalingPlanName !== undefined) { - bodyParams["ScalingPlanName"] = input.ScalingPlanName; - } - if (input.ScalingPlanVersion !== undefined) { - bodyParams["ScalingPlanVersion"] = input.ScalingPlanVersion; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1ApplicationSource = ( diff --git a/clients/client-backup/protocols/Aws_restJson1_1.ts b/clients/client-backup/protocols/Aws_restJson1_1.ts index 95a292bf6cb5..6f5a77b424ab 100644 --- a/clients/client-backup/protocols/Aws_restJson1_1.ts +++ b/clients/client-backup/protocols/Aws_restJson1_1.ts @@ -7174,58 +7174,50 @@ const serializeAws_restJson1_1BackupPlanInput = ( input: BackupPlanInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupPlanName !== undefined) { - bodyParams["BackupPlanName"] = input.BackupPlanName; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_restJson1_1BackupRulesInput( - input.Rules, - context - ); - } - return bodyParams; + return { + ...(input.BackupPlanName !== undefined && { + BackupPlanName: input.BackupPlanName + }), + ...(input.Rules !== undefined && { + Rules: serializeAws_restJson1_1BackupRulesInput(input.Rules, context) + }) + }; }; const serializeAws_restJson1_1BackupRuleInput = ( input: BackupRuleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompletionWindowMinutes !== undefined) { - bodyParams["CompletionWindowMinutes"] = input.CompletionWindowMinutes; - } - if (input.CopyActions !== undefined) { - bodyParams["CopyActions"] = serializeAws_restJson1_1CopyActions( - input.CopyActions, - context - ); - } - if (input.Lifecycle !== undefined) { - bodyParams["Lifecycle"] = serializeAws_restJson1_1Lifecycle( - input.Lifecycle, - context - ); - } - if (input.RecoveryPointTags !== undefined) { - bodyParams["RecoveryPointTags"] = serializeAws_restJson1_1Tags( - input.RecoveryPointTags, - context - ); - } - if (input.RuleName !== undefined) { - bodyParams["RuleName"] = input.RuleName; - } - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - if (input.StartWindowMinutes !== undefined) { - bodyParams["StartWindowMinutes"] = input.StartWindowMinutes; - } - if (input.TargetBackupVaultName !== undefined) { - bodyParams["TargetBackupVaultName"] = input.TargetBackupVaultName; - } - return bodyParams; + return { + ...(input.CompletionWindowMinutes !== undefined && { + CompletionWindowMinutes: input.CompletionWindowMinutes + }), + ...(input.CopyActions !== undefined && { + CopyActions: serializeAws_restJson1_1CopyActions( + input.CopyActions, + context + ) + }), + ...(input.Lifecycle !== undefined && { + Lifecycle: serializeAws_restJson1_1Lifecycle(input.Lifecycle, context) + }), + ...(input.RecoveryPointTags !== undefined && { + RecoveryPointTags: serializeAws_restJson1_1Tags( + 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 + }) + }; }; const serializeAws_restJson1_1BackupRulesInput = ( @@ -7241,26 +7233,18 @@ const serializeAws_restJson1_1BackupSelection = ( input: BackupSelection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.ListOfTags !== undefined) { - bodyParams["ListOfTags"] = serializeAws_restJson1_1ListOfTags( - input.ListOfTags, - context - ); - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_restJson1_1ResourceArns( - input.Resources, - context - ); - } - if (input.SelectionName !== undefined) { - bodyParams["SelectionName"] = input.SelectionName; - } - return bodyParams; + return { + ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), + ...(input.ListOfTags !== undefined && { + ListOfTags: serializeAws_restJson1_1ListOfTags(input.ListOfTags, context) + }), + ...(input.Resources !== undefined && { + Resources: serializeAws_restJson1_1ResourceArns(input.Resources, context) + }), + ...(input.SelectionName !== undefined && { + SelectionName: input.SelectionName + }) + }; }; const serializeAws_restJson1_1BackupVaultEvents = ( @@ -7274,34 +7258,31 @@ const serializeAws_restJson1_1Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionKey !== undefined) { - bodyParams["ConditionKey"] = input.ConditionKey; - } - if (input.ConditionType !== undefined) { - bodyParams["ConditionType"] = input.ConditionType; - } - if (input.ConditionValue !== undefined) { - bodyParams["ConditionValue"] = input.ConditionValue; - } - return bodyParams; + return { + ...(input.ConditionKey !== undefined && { + ConditionKey: input.ConditionKey + }), + ...(input.ConditionType !== undefined && { + ConditionType: input.ConditionType + }), + ...(input.ConditionValue !== undefined && { + ConditionValue: input.ConditionValue + }) + }; }; const serializeAws_restJson1_1CopyAction = ( input: CopyAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationBackupVaultArn !== undefined) { - bodyParams["DestinationBackupVaultArn"] = input.DestinationBackupVaultArn; - } - if (input.Lifecycle !== undefined) { - bodyParams["Lifecycle"] = serializeAws_restJson1_1Lifecycle( - input.Lifecycle, - context - ); - } - return bodyParams; + return { + ...(input.DestinationBackupVaultArn !== undefined && { + DestinationBackupVaultArn: input.DestinationBackupVaultArn + }), + ...(input.Lifecycle !== undefined && { + Lifecycle: serializeAws_restJson1_1Lifecycle(input.Lifecycle, context) + }) + }; }; const serializeAws_restJson1_1CopyActions = ( @@ -7315,14 +7296,14 @@ const serializeAws_restJson1_1Lifecycle = ( input: Lifecycle, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteAfterDays !== undefined) { - bodyParams["DeleteAfterDays"] = input.DeleteAfterDays; - } - if (input.MoveToColdStorageAfterDays !== undefined) { - bodyParams["MoveToColdStorageAfterDays"] = input.MoveToColdStorageAfterDays; - } - return bodyParams; + return { + ...(input.DeleteAfterDays !== undefined && { + DeleteAfterDays: input.DeleteAfterDays + }), + ...(input.MoveToColdStorageAfterDays !== undefined && { + MoveToColdStorageAfterDays: input.MoveToColdStorageAfterDays + }) + }; }; const serializeAws_restJson1_1ListOfTags = ( diff --git a/clients/client-batch/protocols/Aws_restJson1_1.ts b/clients/client-batch/protocols/Aws_restJson1_1.ts index 2c3663bd9f97..e2aa1f0b8c84 100644 --- a/clients/client-batch/protocols/Aws_restJson1_1.ts +++ b/clients/client-batch/protocols/Aws_restJson1_1.ts @@ -1972,25 +1972,21 @@ const serializeAws_restJson1_1ArrayProperties = ( input: ArrayProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.size !== undefined) { - bodyParams["size"] = input.size; - } - return bodyParams; + return { + ...(input.size !== undefined && { size: input.size }) + }; }; const serializeAws_restJson1_1ComputeEnvironmentOrder = ( input: ComputeEnvironmentOrder, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.computeEnvironment !== undefined) { - bodyParams["computeEnvironment"] = input.computeEnvironment; - } - if (input.order !== undefined) { - bodyParams["order"] = input.order; - } - return bodyParams; + return { + ...(input.computeEnvironment !== undefined && { + computeEnvironment: input.computeEnvironment + }), + ...(input.order !== undefined && { order: input.order }) + }; }; const serializeAws_restJson1_1ComputeEnvironmentOrders = ( @@ -2006,220 +2002,167 @@ const serializeAws_restJson1_1ComputeResource = ( input: ComputeResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.allocationStrategy !== undefined) { - bodyParams["allocationStrategy"] = input.allocationStrategy; - } - if (input.bidPercentage !== undefined) { - bodyParams["bidPercentage"] = input.bidPercentage; - } - if (input.desiredvCpus !== undefined) { - bodyParams["desiredvCpus"] = input.desiredvCpus; - } - if (input.ec2KeyPair !== undefined) { - bodyParams["ec2KeyPair"] = input.ec2KeyPair; - } - if (input.imageId !== undefined) { - bodyParams["imageId"] = input.imageId; - } - if (input.instanceRole !== undefined) { - bodyParams["instanceRole"] = input.instanceRole; - } - if (input.instanceTypes !== undefined) { - bodyParams["instanceTypes"] = serializeAws_restJson1_1StringList( - input.instanceTypes, - context - ); - } - if (input.launchTemplate !== undefined) { - bodyParams[ - "launchTemplate" - ] = serializeAws_restJson1_1LaunchTemplateSpecification( - input.launchTemplate, - context - ); - } - if (input.maxvCpus !== undefined) { - bodyParams["maxvCpus"] = input.maxvCpus; - } - if (input.minvCpus !== undefined) { - bodyParams["minvCpus"] = input.minvCpus; - } - if (input.placementGroup !== undefined) { - bodyParams["placementGroup"] = input.placementGroup; - } - if (input.securityGroupIds !== undefined) { - bodyParams["securityGroupIds"] = serializeAws_restJson1_1StringList( - input.securityGroupIds, - context - ); - } - if (input.spotIamFleetRole !== undefined) { - bodyParams["spotIamFleetRole"] = input.spotIamFleetRole; - } - if (input.subnets !== undefined) { - bodyParams["subnets"] = serializeAws_restJson1_1StringList( - input.subnets, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1TagsMap(input.tags, context); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.allocationStrategy !== undefined && { + allocationStrategy: input.allocationStrategy + }), + ...(input.bidPercentage !== undefined && { + bidPercentage: input.bidPercentage + }), + ...(input.desiredvCpus !== undefined && { + desiredvCpus: input.desiredvCpus + }), + ...(input.ec2KeyPair !== undefined && { ec2KeyPair: input.ec2KeyPair }), + ...(input.imageId !== undefined && { imageId: input.imageId }), + ...(input.instanceRole !== undefined && { + instanceRole: input.instanceRole + }), + ...(input.instanceTypes !== undefined && { + instanceTypes: serializeAws_restJson1_1StringList( + input.instanceTypes, + context + ) + }), + ...(input.launchTemplate !== undefined && { + launchTemplate: serializeAws_restJson1_1LaunchTemplateSpecification( + 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_restJson1_1StringList( + input.securityGroupIds, + context + ) + }), + ...(input.spotIamFleetRole !== undefined && { + spotIamFleetRole: input.spotIamFleetRole + }), + ...(input.subnets !== undefined && { + subnets: serializeAws_restJson1_1StringList(input.subnets, context) + }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1TagsMap(input.tags, context) + }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_restJson1_1ComputeResourceUpdate = ( input: ComputeResourceUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.desiredvCpus !== undefined) { - bodyParams["desiredvCpus"] = input.desiredvCpus; - } - if (input.maxvCpus !== undefined) { - bodyParams["maxvCpus"] = input.maxvCpus; - } - if (input.minvCpus !== undefined) { - bodyParams["minvCpus"] = input.minvCpus; - } - return bodyParams; + return { + ...(input.desiredvCpus !== undefined && { + desiredvCpus: input.desiredvCpus + }), + ...(input.maxvCpus !== undefined && { maxvCpus: input.maxvCpus }), + ...(input.minvCpus !== undefined && { minvCpus: input.minvCpus }) + }; }; const serializeAws_restJson1_1ContainerOverrides = ( input: ContainerOverrides, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.command !== undefined) { - bodyParams["command"] = serializeAws_restJson1_1StringList( - input.command, - context - ); - } - if (input.environment !== undefined) { - bodyParams["environment"] = serializeAws_restJson1_1EnvironmentVariables( - input.environment, - context - ); - } - if (input.instanceType !== undefined) { - bodyParams["instanceType"] = input.instanceType; - } - if (input.memory !== undefined) { - bodyParams["memory"] = input.memory; - } - if (input.resourceRequirements !== undefined) { - bodyParams[ - "resourceRequirements" - ] = serializeAws_restJson1_1ResourceRequirements( - input.resourceRequirements, - context - ); - } - if (input.vcpus !== undefined) { - bodyParams["vcpus"] = input.vcpus; - } - return bodyParams; + return { + ...(input.command !== undefined && { + command: serializeAws_restJson1_1StringList(input.command, context) + }), + ...(input.environment !== undefined && { + environment: serializeAws_restJson1_1EnvironmentVariables( + input.environment, + context + ) + }), + ...(input.instanceType !== undefined && { + instanceType: input.instanceType + }), + ...(input.memory !== undefined && { memory: input.memory }), + ...(input.resourceRequirements !== undefined && { + resourceRequirements: serializeAws_restJson1_1ResourceRequirements( + input.resourceRequirements, + context + ) + }), + ...(input.vcpus !== undefined && { vcpus: input.vcpus }) + }; }; const serializeAws_restJson1_1ContainerProperties = ( input: ContainerProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.command !== undefined) { - bodyParams["command"] = serializeAws_restJson1_1StringList( - input.command, - context - ); - } - if (input.environment !== undefined) { - bodyParams["environment"] = serializeAws_restJson1_1EnvironmentVariables( - input.environment, - context - ); - } - if (input.image !== undefined) { - bodyParams["image"] = input.image; - } - if (input.instanceType !== undefined) { - bodyParams["instanceType"] = input.instanceType; - } - if (input.jobRoleArn !== undefined) { - bodyParams["jobRoleArn"] = input.jobRoleArn; - } - if (input.linuxParameters !== undefined) { - bodyParams["linuxParameters"] = serializeAws_restJson1_1LinuxParameters( - input.linuxParameters, - context - ); - } - if (input.memory !== undefined) { - bodyParams["memory"] = input.memory; - } - if (input.mountPoints !== undefined) { - bodyParams["mountPoints"] = serializeAws_restJson1_1MountPoints( - input.mountPoints, - context - ); - } - if (input.privileged !== undefined) { - bodyParams["privileged"] = input.privileged; - } - if (input.readonlyRootFilesystem !== undefined) { - bodyParams["readonlyRootFilesystem"] = input.readonlyRootFilesystem; - } - if (input.resourceRequirements !== undefined) { - bodyParams[ - "resourceRequirements" - ] = serializeAws_restJson1_1ResourceRequirements( - input.resourceRequirements, - context - ); - } - if (input.ulimits !== undefined) { - bodyParams["ulimits"] = serializeAws_restJson1_1Ulimits( - input.ulimits, - context - ); - } - if (input.user !== undefined) { - bodyParams["user"] = input.user; - } - if (input.vcpus !== undefined) { - bodyParams["vcpus"] = input.vcpus; - } - if (input.volumes !== undefined) { - bodyParams["volumes"] = serializeAws_restJson1_1Volumes( - input.volumes, - context - ); - } - return bodyParams; + return { + ...(input.command !== undefined && { + command: serializeAws_restJson1_1StringList(input.command, context) + }), + ...(input.environment !== undefined && { + environment: serializeAws_restJson1_1EnvironmentVariables( + input.environment, + context + ) + }), + ...(input.image !== undefined && { image: input.image }), + ...(input.instanceType !== undefined && { + instanceType: input.instanceType + }), + ...(input.jobRoleArn !== undefined && { jobRoleArn: input.jobRoleArn }), + ...(input.linuxParameters !== undefined && { + linuxParameters: serializeAws_restJson1_1LinuxParameters( + input.linuxParameters, + context + ) + }), + ...(input.memory !== undefined && { memory: input.memory }), + ...(input.mountPoints !== undefined && { + mountPoints: serializeAws_restJson1_1MountPoints( + input.mountPoints, + context + ) + }), + ...(input.privileged !== undefined && { privileged: input.privileged }), + ...(input.readonlyRootFilesystem !== undefined && { + readonlyRootFilesystem: input.readonlyRootFilesystem + }), + ...(input.resourceRequirements !== undefined && { + resourceRequirements: serializeAws_restJson1_1ResourceRequirements( + input.resourceRequirements, + context + ) + }), + ...(input.ulimits !== undefined && { + ulimits: serializeAws_restJson1_1Ulimits(input.ulimits, context) + }), + ...(input.user !== undefined && { user: input.user }), + ...(input.vcpus !== undefined && { vcpus: input.vcpus }), + ...(input.volumes !== undefined && { + volumes: serializeAws_restJson1_1Volumes(input.volumes, context) + }) + }; }; const serializeAws_restJson1_1Device = ( input: Device, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerPath !== undefined) { - bodyParams["containerPath"] = input.containerPath; - } - if (input.hostPath !== undefined) { - bodyParams["hostPath"] = input.hostPath; - } - if (input.permissions !== undefined) { - bodyParams["permissions"] = serializeAws_restJson1_1DeviceCgroupPermissions( - input.permissions, - context - ); - } - return bodyParams; + return { + ...(input.containerPath !== undefined && { + containerPath: input.containerPath + }), + ...(input.hostPath !== undefined && { hostPath: input.hostPath }), + ...(input.permissions !== undefined && { + permissions: serializeAws_restJson1_1DeviceCgroupPermissions( + input.permissions, + context + ) + }) + }; }; const serializeAws_restJson1_1DeviceCgroupPermissions = ( @@ -2249,25 +2192,19 @@ const serializeAws_restJson1_1Host = ( input: Host, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.sourcePath !== undefined) { - bodyParams["sourcePath"] = input.sourcePath; - } - return bodyParams; + return { + ...(input.sourcePath !== undefined && { sourcePath: input.sourcePath }) + }; }; const serializeAws_restJson1_1JobDependency = ( input: JobDependency, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_restJson1_1JobDependencyList = ( @@ -2283,73 +2220,62 @@ const serializeAws_restJson1_1JobTimeout = ( input: JobTimeout, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attemptDurationSeconds !== undefined) { - bodyParams["attemptDurationSeconds"] = input.attemptDurationSeconds; - } - return bodyParams; + return { + ...(input.attemptDurationSeconds !== undefined && { + attemptDurationSeconds: input.attemptDurationSeconds + }) + }; }; const serializeAws_restJson1_1KeyValuePair = ( input: KeyValuePair, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1LaunchTemplateSpecification = ( input: LaunchTemplateSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.launchTemplateId !== undefined) { - bodyParams["launchTemplateId"] = input.launchTemplateId; - } - if (input.launchTemplateName !== undefined) { - bodyParams["launchTemplateName"] = input.launchTemplateName; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.launchTemplateId !== undefined && { + launchTemplateId: input.launchTemplateId + }), + ...(input.launchTemplateName !== undefined && { + launchTemplateName: input.launchTemplateName + }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_restJson1_1LinuxParameters = ( input: LinuxParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.devices !== undefined) { - bodyParams["devices"] = serializeAws_restJson1_1DevicesList( - input.devices, - context - ); - } - return bodyParams; + return { + ...(input.devices !== undefined && { + devices: serializeAws_restJson1_1DevicesList(input.devices, context) + }) + }; }; const serializeAws_restJson1_1MountPoint = ( input: MountPoint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerPath !== undefined) { - bodyParams["containerPath"] = input.containerPath; - } - if (input.readOnly !== undefined) { - bodyParams["readOnly"] = input.readOnly; - } - if (input.sourceVolume !== undefined) { - bodyParams["sourceVolume"] = input.sourceVolume; - } - return bodyParams; + return { + ...(input.containerPath !== undefined && { + containerPath: input.containerPath + }), + ...(input.readOnly !== undefined && { readOnly: input.readOnly }), + ...(input.sourceVolume !== undefined && { + sourceVolume: input.sourceVolume + }) + }; }; const serializeAws_restJson1_1MountPoints = ( @@ -2363,60 +2289,46 @@ const serializeAws_restJson1_1NodeOverrides = ( input: NodeOverrides, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nodePropertyOverrides !== undefined) { - bodyParams[ - "nodePropertyOverrides" - ] = serializeAws_restJson1_1NodePropertyOverrides( - input.nodePropertyOverrides, - context - ); - } - if (input.numNodes !== undefined) { - bodyParams["numNodes"] = input.numNodes; - } - return bodyParams; + return { + ...(input.nodePropertyOverrides !== undefined && { + nodePropertyOverrides: serializeAws_restJson1_1NodePropertyOverrides( + input.nodePropertyOverrides, + context + ) + }), + ...(input.numNodes !== undefined && { numNodes: input.numNodes }) + }; }; const serializeAws_restJson1_1NodeProperties = ( input: NodeProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.mainNode !== undefined) { - bodyParams["mainNode"] = input.mainNode; - } - if (input.nodeRangeProperties !== undefined) { - bodyParams[ - "nodeRangeProperties" - ] = serializeAws_restJson1_1NodeRangeProperties( - input.nodeRangeProperties, - context - ); - } - if (input.numNodes !== undefined) { - bodyParams["numNodes"] = input.numNodes; - } - return bodyParams; + return { + ...(input.mainNode !== undefined && { mainNode: input.mainNode }), + ...(input.nodeRangeProperties !== undefined && { + nodeRangeProperties: serializeAws_restJson1_1NodeRangeProperties( + input.nodeRangeProperties, + context + ) + }), + ...(input.numNodes !== undefined && { numNodes: input.numNodes }) + }; }; const serializeAws_restJson1_1NodePropertyOverride = ( input: NodePropertyOverride, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerOverrides !== undefined) { - bodyParams[ - "containerOverrides" - ] = serializeAws_restJson1_1ContainerOverrides( - input.containerOverrides, - context - ); - } - if (input.targetNodes !== undefined) { - bodyParams["targetNodes"] = input.targetNodes; - } - return bodyParams; + return { + ...(input.containerOverrides !== undefined && { + containerOverrides: serializeAws_restJson1_1ContainerOverrides( + input.containerOverrides, + context + ) + }), + ...(input.targetNodes !== undefined && { targetNodes: input.targetNodes }) + }; }; const serializeAws_restJson1_1NodePropertyOverrides = ( @@ -2441,17 +2353,15 @@ const serializeAws_restJson1_1NodeRangeProperty = ( input: NodeRangeProperty, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.container !== undefined) { - bodyParams["container"] = serializeAws_restJson1_1ContainerProperties( - input.container, - context - ); - } - if (input.targetNodes !== undefined) { - bodyParams["targetNodes"] = input.targetNodes; - } - return bodyParams; + return { + ...(input.container !== undefined && { + container: serializeAws_restJson1_1ContainerProperties( + input.container, + context + ) + }), + ...(input.targetNodes !== undefined && { targetNodes: input.targetNodes }) + }; }; const serializeAws_restJson1_1ParametersMap = ( @@ -2468,14 +2378,10 @@ const serializeAws_restJson1_1ResourceRequirement = ( input: ResourceRequirement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.type !== undefined && { type: input.type }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1ResourceRequirements = ( @@ -2491,11 +2397,9 @@ const serializeAws_restJson1_1RetryStrategy = ( input: RetryStrategy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attempts !== undefined) { - bodyParams["attempts"] = input.attempts; - } - return bodyParams; + return { + ...(input.attempts !== undefined && { attempts: input.attempts }) + }; }; const serializeAws_restJson1_1StringList = ( @@ -2519,17 +2423,11 @@ const serializeAws_restJson1_1Ulimit = ( input: Ulimit, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hardLimit !== undefined) { - bodyParams["hardLimit"] = input.hardLimit; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.softLimit !== undefined) { - bodyParams["softLimit"] = input.softLimit; - } - return bodyParams; + return { + ...(input.hardLimit !== undefined && { hardLimit: input.hardLimit }), + ...(input.name !== undefined && { name: input.name }), + ...(input.softLimit !== undefined && { softLimit: input.softLimit }) + }; }; const serializeAws_restJson1_1Ulimits = ( @@ -2543,14 +2441,12 @@ const serializeAws_restJson1_1Volume = ( input: Volume, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.host !== undefined) { - bodyParams["host"] = serializeAws_restJson1_1Host(input.host, context); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.host !== undefined && { + host: serializeAws_restJson1_1Host(input.host, context) + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1Volumes = ( diff --git a/clients/client-budgets/protocols/Aws_json1_1.ts b/clients/client-budgets/protocols/Aws_json1_1.ts index 6f37ad1d29fd..5289b6d85803 100644 --- a/clients/client-budgets/protocols/Aws_json1_1.ts +++ b/clients/client-budgets/protocols/Aws_json1_1.ts @@ -1970,78 +1970,52 @@ const serializeAws_json1_1Budget = ( input: Budget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BudgetLimit !== undefined) { - bodyParams["BudgetLimit"] = serializeAws_json1_1Spend( - input.BudgetLimit, - context - ); - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.BudgetType !== undefined) { - bodyParams["BudgetType"] = input.BudgetType; - } - if (input.CalculatedSpend !== undefined) { - bodyParams["CalculatedSpend"] = serializeAws_json1_1CalculatedSpend( - input.CalculatedSpend, - context - ); - } - if (input.CostFilters !== undefined) { - bodyParams["CostFilters"] = serializeAws_json1_1CostFilters( - input.CostFilters, - context - ); - } - if (input.CostTypes !== undefined) { - bodyParams["CostTypes"] = serializeAws_json1_1CostTypes( - input.CostTypes, - context - ); - } - if (input.LastUpdatedTime !== undefined) { - bodyParams["LastUpdatedTime"] = Math.round( - input.LastUpdatedTime.getTime() / 1000 - ); - } - if (input.PlannedBudgetLimits !== undefined) { - bodyParams["PlannedBudgetLimits"] = serializeAws_json1_1PlannedBudgetLimits( - input.PlannedBudgetLimits, - context - ); - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1TimePeriod( - input.TimePeriod, - context - ); - } - if (input.TimeUnit !== undefined) { - bodyParams["TimeUnit"] = input.TimeUnit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CalculatedSpend = ( input: CalculatedSpend, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActualSpend !== undefined) { - bodyParams["ActualSpend"] = serializeAws_json1_1Spend( - input.ActualSpend, - context - ); - } - if (input.ForecastedSpend !== undefined) { - bodyParams["ForecastedSpend"] = serializeAws_json1_1Spend( - input.ForecastedSpend, - context - ); - } - return bodyParams; + return { + ...(input.ActualSpend !== undefined && { + ActualSpend: serializeAws_json1_1Spend(input.ActualSpend, context) + }), + ...(input.ForecastedSpend !== undefined && { + ForecastedSpend: serializeAws_json1_1Spend(input.ForecastedSpend, context) + }) + }; }; const serializeAws_json1_1CostFilters = ( @@ -2058,278 +2032,204 @@ const serializeAws_json1_1CostTypes = ( input: CostTypes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IncludeCredit !== undefined) { - bodyParams["IncludeCredit"] = input.IncludeCredit; - } - if (input.IncludeDiscount !== undefined) { - bodyParams["IncludeDiscount"] = input.IncludeDiscount; - } - if (input.IncludeOtherSubscription !== undefined) { - bodyParams["IncludeOtherSubscription"] = input.IncludeOtherSubscription; - } - if (input.IncludeRecurring !== undefined) { - bodyParams["IncludeRecurring"] = input.IncludeRecurring; - } - if (input.IncludeRefund !== undefined) { - bodyParams["IncludeRefund"] = input.IncludeRefund; - } - if (input.IncludeSubscription !== undefined) { - bodyParams["IncludeSubscription"] = input.IncludeSubscription; - } - if (input.IncludeSupport !== undefined) { - bodyParams["IncludeSupport"] = input.IncludeSupport; - } - if (input.IncludeTax !== undefined) { - bodyParams["IncludeTax"] = input.IncludeTax; - } - if (input.IncludeUpfront !== undefined) { - bodyParams["IncludeUpfront"] = input.IncludeUpfront; - } - if (input.UseAmortized !== undefined) { - bodyParams["UseAmortized"] = input.UseAmortized; - } - if (input.UseBlended !== undefined) { - bodyParams["UseBlended"] = input.UseBlended; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateBudgetRequest = ( input: CreateBudgetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.Budget !== undefined) { - bodyParams["Budget"] = serializeAws_json1_1Budget(input.Budget, context); - } - if (input.NotificationsWithSubscribers !== undefined) { - bodyParams[ - "NotificationsWithSubscribers" - ] = serializeAws_json1_1NotificationWithSubscribersList( - input.NotificationsWithSubscribers, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateNotificationRequest = ( input: CreateNotificationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Subscribers !== undefined) { - bodyParams["Subscribers"] = serializeAws_json1_1Subscribers( - input.Subscribers, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateSubscriberRequest = ( input: CreateSubscriberRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Subscriber !== undefined) { - bodyParams["Subscriber"] = serializeAws_json1_1Subscriber( - input.Subscriber, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteBudgetRequest = ( input: DeleteBudgetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }) + }; }; const serializeAws_json1_1DeleteNotificationRequest = ( input: DeleteNotificationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.Notification !== undefined && { + Notification: serializeAws_json1_1Notification( + input.Notification, + context + ) + }) + }; }; const serializeAws_json1_1DeleteSubscriberRequest = ( input: DeleteSubscriberRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Subscriber !== undefined) { - bodyParams["Subscriber"] = serializeAws_json1_1Subscriber( - input.Subscriber, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeBudgetPerformanceHistoryRequest = ( input: DescribeBudgetPerformanceHistoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1TimePeriod( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeBudgetRequest = ( input: DescribeBudgetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }) + }; }; const serializeAws_json1_1DescribeBudgetsRequest = ( input: DescribeBudgetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeNotificationsForBudgetRequest = ( input: DescribeNotificationsForBudgetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeSubscribersForNotificationRequest = ( input: DescribeSubscribersForNotificationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DimensionValues = ( @@ -2343,43 +2243,38 @@ const serializeAws_json1_1Notification = ( input: Notification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.NotificationState !== undefined) { - bodyParams["NotificationState"] = input.NotificationState; - } - if (input.NotificationType !== undefined) { - bodyParams["NotificationType"] = input.NotificationType; - } - if (input.Threshold !== undefined) { - bodyParams["Threshold"] = input.Threshold; - } - if (input.ThresholdType !== undefined) { - bodyParams["ThresholdType"] = input.ThresholdType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1NotificationWithSubscribers = ( input: NotificationWithSubscribers, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Subscribers !== undefined) { - bodyParams["Subscribers"] = serializeAws_json1_1Subscribers( - input.Subscribers, - context - ); - } - return bodyParams; + return { + ...(input.Notification !== undefined && { + Notification: serializeAws_json1_1Notification( + input.Notification, + context + ) + }), + ...(input.Subscribers !== undefined && { + Subscribers: serializeAws_json1_1Subscribers(input.Subscribers, context) + }) + }; }; const serializeAws_json1_1NotificationWithSubscribersList = ( @@ -2405,28 +2300,22 @@ const serializeAws_json1_1Spend = ( input: Spend, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Amount !== undefined) { - bodyParams["Amount"] = input.Amount; - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + return { + ...(input.Amount !== undefined && { Amount: input.Amount }), + ...(input.Unit !== undefined && { Unit: input.Unit }) + }; }; const serializeAws_json1_1Subscriber = ( input: Subscriber, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.SubscriptionType !== undefined) { - bodyParams["SubscriptionType"] = input.SubscriptionType; - } - return bodyParams; + return { + ...(input.Address !== undefined && { Address: input.Address }), + ...(input.SubscriptionType !== undefined && { + SubscriptionType: input.SubscriptionType + }) + }; }; const serializeAws_json1_1Subscribers = ( @@ -2440,89 +2329,76 @@ const serializeAws_json1_1TimePeriod = ( input: TimePeriod, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.End !== undefined) { - bodyParams["End"] = Math.round(input.End.getTime() / 1000); - } - if (input.Start !== undefined) { - bodyParams["Start"] = Math.round(input.Start.getTime() / 1000); - } - return bodyParams; + return { + ...(input.End !== undefined && { + End: Math.round(input.End.getTime() / 1000) + }), + ...(input.Start !== undefined && { + Start: Math.round(input.Start.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UpdateBudgetRequest = ( input: UpdateBudgetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.NewBudget !== undefined) { - bodyParams["NewBudget"] = serializeAws_json1_1Budget( - input.NewBudget, - context - ); - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.NewBudget !== undefined && { + NewBudget: serializeAws_json1_1Budget(input.NewBudget, context) + }) + }; }; const serializeAws_json1_1UpdateNotificationRequest = ( input: UpdateNotificationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.NewNotification !== undefined) { - bodyParams["NewNotification"] = serializeAws_json1_1Notification( - input.NewNotification, - context - ); - } - if (input.OldNotification !== undefined) { - bodyParams["OldNotification"] = serializeAws_json1_1Notification( - input.OldNotification, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateSubscriberRequest = ( input: UpdateSubscriberRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.NewSubscriber !== undefined) { - bodyParams["NewSubscriber"] = serializeAws_json1_1Subscriber( - input.NewSubscriber, - context - ); - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.OldSubscriber !== undefined) { - bodyParams["OldSubscriber"] = serializeAws_json1_1Subscriber( - input.OldSubscriber, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-chime/protocols/Aws_restJson1_1.ts b/clients/client-chime/protocols/Aws_restJson1_1.ts index bd3f8f8a36a3..e4a3dca477b1 100644 --- a/clients/client-chime/protocols/Aws_restJson1_1.ts +++ b/clients/client-chime/protocols/Aws_restJson1_1.ts @@ -16818,39 +16818,37 @@ const serializeAws_restJson1_1AccountSettings = ( input: AccountSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisableRemoteControl !== undefined) { - bodyParams["DisableRemoteControl"] = input.DisableRemoteControl; - } - if (input.EnableDialOut !== undefined) { - bodyParams["EnableDialOut"] = input.EnableDialOut; - } - return bodyParams; + return { + ...(input.DisableRemoteControl !== undefined && { + DisableRemoteControl: input.DisableRemoteControl + }), + ...(input.EnableDialOut !== undefined && { + EnableDialOut: input.EnableDialOut + }) + }; }; const serializeAws_restJson1_1AlexaForBusinessMetadata = ( input: AlexaForBusinessMetadata, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlexaForBusinessRoomArn !== undefined) { - bodyParams["AlexaForBusinessRoomArn"] = input.AlexaForBusinessRoomArn; - } - if (input.IsAlexaForBusinessEnabled !== undefined) { - bodyParams["IsAlexaForBusinessEnabled"] = input.IsAlexaForBusinessEnabled; - } - return bodyParams; + return { + ...(input.AlexaForBusinessRoomArn !== undefined && { + AlexaForBusinessRoomArn: input.AlexaForBusinessRoomArn + }), + ...(input.IsAlexaForBusinessEnabled !== undefined && { + IsAlexaForBusinessEnabled: input.IsAlexaForBusinessEnabled + }) + }; }; const serializeAws_restJson1_1BusinessCallingSettings = ( input: BusinessCallingSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CdrBucket !== undefined) { - bodyParams["CdrBucket"] = input.CdrBucket; - } - return bodyParams; + return { + ...(input.CdrBucket !== undefined && { CdrBucket: input.CdrBucket }) + }; }; const serializeAws_restJson1_1CallingRegionList = ( @@ -16864,11 +16862,11 @@ const serializeAws_restJson1_1CreateAttendeeRequestItem = ( input: CreateAttendeeRequestItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExternalUserId !== undefined) { - bodyParams["ExternalUserId"] = input.ExternalUserId; - } - return bodyParams; + return { + ...(input.ExternalUserId !== undefined && { + ExternalUserId: input.ExternalUserId + }) + }; }; const serializeAws_restJson1_1CreateAttendeeRequestItemList = ( @@ -16884,14 +16882,10 @@ const serializeAws_restJson1_1Credential = ( input: Credential, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_restJson1_1CredentialList = ( @@ -16912,39 +16906,31 @@ const serializeAws_restJson1_1LoggingConfiguration = ( input: LoggingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnableSIPLogs !== undefined) { - bodyParams["EnableSIPLogs"] = input.EnableSIPLogs; - } - return bodyParams; + return { + ...(input.EnableSIPLogs !== undefined && { + EnableSIPLogs: input.EnableSIPLogs + }) + }; }; const serializeAws_restJson1_1MeetingNotificationConfiguration = ( input: MeetingNotificationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnsTopicArn !== undefined) { - bodyParams["SnsTopicArn"] = input.SnsTopicArn; - } - if (input.SqsQueueArn !== undefined) { - bodyParams["SqsQueueArn"] = input.SqsQueueArn; - } - return bodyParams; + return { + ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }), + ...(input.SqsQueueArn !== undefined && { SqsQueueArn: input.SqsQueueArn }) + }; }; const serializeAws_restJson1_1MembershipItem = ( input: MembershipItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MemberId !== undefined) { - bodyParams["MemberId"] = input.MemberId; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - return bodyParams; + return { + ...(input.MemberId !== undefined && { MemberId: input.MemberId }), + ...(input.Role !== undefined && { Role: input.Role }) + }; }; const serializeAws_restJson1_1MembershipItemList = ( @@ -16967,40 +16953,28 @@ const serializeAws_restJson1_1Origination = ( input: Origination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Disabled !== undefined) { - bodyParams["Disabled"] = input.Disabled; - } - if (input.Routes !== undefined) { - bodyParams["Routes"] = serializeAws_restJson1_1OriginationRouteList( - input.Routes, - context - ); - } - return bodyParams; + return { + ...(input.Disabled !== undefined && { Disabled: input.Disabled }), + ...(input.Routes !== undefined && { + Routes: serializeAws_restJson1_1OriginationRouteList( + input.Routes, + context + ) + }) + }; }; const serializeAws_restJson1_1OriginationRoute = ( input: OriginationRoute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.Protocol !== undefined) { - bodyParams["Protocol"] = input.Protocol; - } - if (input.Weight !== undefined) { - bodyParams["Weight"] = input.Weight; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1OriginationRouteList = ( @@ -17023,11 +16997,9 @@ const serializeAws_restJson1_1SigninDelegateGroup = ( input: SigninDelegateGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - return bodyParams; + return { + ...(input.GroupName !== undefined && { GroupName: input.GroupName }) + }; }; const serializeAws_restJson1_1SigninDelegateGroupList = ( @@ -17043,14 +17015,12 @@ const serializeAws_restJson1_1StreamingConfiguration = ( input: StreamingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataRetentionInHours !== undefined) { - bodyParams["DataRetentionInHours"] = input.DataRetentionInHours; - } - if (input.Disabled !== undefined) { - bodyParams["Disabled"] = input.Disabled; - } - return bodyParams; + return { + ...(input.DataRetentionInHours !== undefined && { + DataRetentionInHours: input.DataRetentionInHours + }), + ...(input.Disabled !== undefined && { Disabled: input.Disabled }) + }; }; const serializeAws_restJson1_1StringList = ( @@ -17064,63 +17034,53 @@ const serializeAws_restJson1_1TelephonySettings = ( input: TelephonySettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InboundCalling !== undefined) { - bodyParams["InboundCalling"] = input.InboundCalling; - } - if (input.OutboundCalling !== undefined) { - bodyParams["OutboundCalling"] = input.OutboundCalling; - } - if (input.SMS !== undefined) { - bodyParams["SMS"] = input.SMS; - } - return bodyParams; + return { + ...(input.InboundCalling !== undefined && { + InboundCalling: input.InboundCalling + }), + ...(input.OutboundCalling !== undefined && { + OutboundCalling: input.OutboundCalling + }), + ...(input.SMS !== undefined && { SMS: input.SMS }) + }; }; const serializeAws_restJson1_1Termination = ( input: Termination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CallingRegions !== undefined) { - bodyParams["CallingRegions"] = serializeAws_restJson1_1CallingRegionList( - input.CallingRegions, - context - ); - } - if (input.CidrAllowedList !== undefined) { - bodyParams["CidrAllowedList"] = serializeAws_restJson1_1StringList( - input.CidrAllowedList, - context - ); - } - if (input.CpsLimit !== undefined) { - bodyParams["CpsLimit"] = input.CpsLimit; - } - if (input.DefaultPhoneNumber !== undefined) { - bodyParams["DefaultPhoneNumber"] = input.DefaultPhoneNumber; - } - if (input.Disabled !== undefined) { - bodyParams["Disabled"] = input.Disabled; - } - return bodyParams; + return { + ...(input.CallingRegions !== undefined && { + CallingRegions: serializeAws_restJson1_1CallingRegionList( + input.CallingRegions, + context + ) + }), + ...(input.CidrAllowedList !== undefined && { + CidrAllowedList: serializeAws_restJson1_1StringList( + input.CidrAllowedList, + context + ) + }), + ...(input.CpsLimit !== undefined && { CpsLimit: input.CpsLimit }), + ...(input.DefaultPhoneNumber !== undefined && { + DefaultPhoneNumber: input.DefaultPhoneNumber + }), + ...(input.Disabled !== undefined && { Disabled: input.Disabled }) + }; }; const serializeAws_restJson1_1UpdatePhoneNumberRequestItem = ( input: UpdatePhoneNumberRequestItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CallingName !== undefined) { - bodyParams["CallingName"] = input.CallingName; - } - if (input.PhoneNumberId !== undefined) { - bodyParams["PhoneNumberId"] = input.PhoneNumberId; - } - if (input.ProductType !== undefined) { - bodyParams["ProductType"] = input.ProductType; - } - return bodyParams; + return { + ...(input.CallingName !== undefined && { CallingName: input.CallingName }), + ...(input.PhoneNumberId !== undefined && { + PhoneNumberId: input.PhoneNumberId + }), + ...(input.ProductType !== undefined && { ProductType: input.ProductType }) + }; }; const serializeAws_restJson1_1UpdatePhoneNumberRequestItemList = ( @@ -17136,25 +17096,17 @@ const serializeAws_restJson1_1UpdateUserRequestItem = ( input: UpdateUserRequestItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlexaForBusinessMetadata !== undefined) { - bodyParams[ - "AlexaForBusinessMetadata" - ] = serializeAws_restJson1_1AlexaForBusinessMetadata( - input.AlexaForBusinessMetadata, - context - ); - } - if (input.LicenseType !== undefined) { - bodyParams["LicenseType"] = input.LicenseType; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - if (input.UserType !== undefined) { - bodyParams["UserType"] = input.UserType; - } - return bodyParams; + return { + ...(input.AlexaForBusinessMetadata !== undefined && { + AlexaForBusinessMetadata: serializeAws_restJson1_1AlexaForBusinessMetadata( + input.AlexaForBusinessMetadata, + context + ) + }), + ...(input.LicenseType !== undefined && { LicenseType: input.LicenseType }), + ...(input.UserId !== undefined && { UserId: input.UserId }), + ...(input.UserType !== undefined && { UserType: input.UserType }) + }; }; const serializeAws_restJson1_1UpdateUserRequestItemList = ( @@ -17184,28 +17136,26 @@ const serializeAws_restJson1_1UserSettings = ( input: UserSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Telephony !== undefined) { - bodyParams["Telephony"] = serializeAws_restJson1_1TelephonySettings( - input.Telephony, - context - ); - } - return bodyParams; + return { + ...(input.Telephony !== undefined && { + Telephony: serializeAws_restJson1_1TelephonySettings( + input.Telephony, + context + ) + }) + }; }; const serializeAws_restJson1_1VoiceConnectorItem = ( input: VoiceConnectorItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.VoiceConnectorId !== undefined) { - bodyParams["VoiceConnectorId"] = input.VoiceConnectorId; - } - return bodyParams; + return { + ...(input.Priority !== undefined && { Priority: input.Priority }), + ...(input.VoiceConnectorId !== undefined && { + VoiceConnectorId: input.VoiceConnectorId + }) + }; }; const serializeAws_restJson1_1VoiceConnectorItemList = ( @@ -17221,11 +17171,9 @@ const serializeAws_restJson1_1VoiceConnectorSettings = ( input: VoiceConnectorSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CdrBucket !== undefined) { - bodyParams["CdrBucket"] = input.CdrBucket; - } - return bodyParams; + return { + ...(input.CdrBucket !== undefined && { CdrBucket: input.CdrBucket }) + }; }; const deserializeAws_restJson1_1Account = ( diff --git a/clients/client-cloud9/protocols/Aws_json1_1.ts b/clients/client-cloud9/protocols/Aws_json1_1.ts index a180df0456f4..5f5f098002d3 100644 --- a/clients/client-cloud9/protocols/Aws_json1_1.ts +++ b/clients/client-cloud9/protocols/Aws_json1_1.ts @@ -1672,136 +1672,112 @@ const serializeAws_json1_1CreateEnvironmentEC2Request = ( input: CreateEnvironmentEC2Request, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.automaticStopTimeMinutes !== undefined) { - bodyParams["automaticStopTimeMinutes"] = input.automaticStopTimeMinutes; - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.instanceType !== undefined) { - bodyParams["instanceType"] = input.instanceType; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.ownerArn !== undefined) { - bodyParams["ownerArn"] = input.ownerArn; - } - if (input.subnetId !== undefined) { - bodyParams["subnetId"] = input.subnetId; - } - return bodyParams; + return { + ...(input.automaticStopTimeMinutes !== undefined && { + automaticStopTimeMinutes: input.automaticStopTimeMinutes + }), + ...(input.clientRequestToken !== undefined && { + clientRequestToken: input.clientRequestToken + }), + ...(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 }) + }; }; const serializeAws_json1_1CreateEnvironmentMembershipRequest = ( input: CreateEnvironmentMembershipRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - if (input.permissions !== undefined) { - bodyParams["permissions"] = input.permissions; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + return { + ...(input.environmentId !== undefined && { + environmentId: input.environmentId + }), + ...(input.permissions !== undefined && { permissions: input.permissions }), + ...(input.userArn !== undefined && { userArn: input.userArn }) + }; }; const serializeAws_json1_1DeleteEnvironmentMembershipRequest = ( input: DeleteEnvironmentMembershipRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + return { + ...(input.environmentId !== undefined && { + environmentId: input.environmentId + }), + ...(input.userArn !== undefined && { userArn: input.userArn }) + }; }; const serializeAws_json1_1DeleteEnvironmentRequest = ( input: DeleteEnvironmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - return bodyParams; + return { + ...(input.environmentId !== undefined && { + environmentId: input.environmentId + }) + }; }; const serializeAws_json1_1DescribeEnvironmentMembershipsRequest = ( input: DescribeEnvironmentMembershipsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.permissions !== undefined) { - bodyParams["permissions"] = serializeAws_json1_1PermissionsList( - input.permissions, - context - ); - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEnvironmentStatusRequest = ( input: DescribeEnvironmentStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - return bodyParams; + return { + ...(input.environmentId !== undefined && { + environmentId: input.environmentId + }) + }; }; const serializeAws_json1_1DescribeEnvironmentsRequest = ( input: DescribeEnvironmentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentIds !== undefined) { - bodyParams["environmentIds"] = serializeAws_json1_1BoundedEnvironmentIdList( - input.environmentIds, - context - ); - } - return bodyParams; + return { + ...(input.environmentIds !== undefined && { + environmentIds: serializeAws_json1_1BoundedEnvironmentIdList( + input.environmentIds, + context + ) + }) + }; }; const serializeAws_json1_1ListEnvironmentsRequest = ( input: ListEnvironmentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1PermissionsList = ( @@ -1815,34 +1791,26 @@ const serializeAws_json1_1UpdateEnvironmentMembershipRequest = ( input: UpdateEnvironmentMembershipRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - if (input.permissions !== undefined) { - bodyParams["permissions"] = input.permissions; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + return { + ...(input.environmentId !== undefined && { + environmentId: input.environmentId + }), + ...(input.permissions !== undefined && { permissions: input.permissions }), + ...(input.userArn !== undefined && { userArn: input.userArn }) + }; }; const serializeAws_json1_1UpdateEnvironmentRequest = ( input: UpdateEnvironmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.environmentId !== undefined) { - bodyParams["environmentId"] = input.environmentId; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.environmentId !== undefined && { + environmentId: input.environmentId + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const deserializeAws_json1_1BadRequestException = ( diff --git a/clients/client-clouddirectory/protocols/Aws_restJson1_1.ts b/clients/client-clouddirectory/protocols/Aws_restJson1_1.ts index 115a819e3edc..cf6136f734a8 100644 --- a/clients/client-clouddirectory/protocols/Aws_restJson1_1.ts +++ b/clients/client-clouddirectory/protocols/Aws_restJson1_1.ts @@ -13267,37 +13267,25 @@ const serializeAws_restJson1_1AttributeKey = ( input: AttributeKey, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FacetName !== undefined) { - bodyParams["FacetName"] = input.FacetName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SchemaArn !== undefined) { - bodyParams["SchemaArn"] = input.SchemaArn; - } - return bodyParams; + return { + ...(input.FacetName !== undefined && { FacetName: input.FacetName }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }) + }; }; const serializeAws_restJson1_1AttributeKeyAndValue = ( input: AttributeKeyAndValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_restJson1_1AttributeKey( - input.Key, - context - ); - } - if (input.Value !== undefined) { - bodyParams["Value"] = serializeAws_restJson1_1TypedAttributeValue( - input.Value, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { + Key: serializeAws_restJson1_1AttributeKey(input.Key, context) + }), + ...(input.Value !== undefined && { + Value: serializeAws_restJson1_1TypedAttributeValue(input.Value, context) + }) + }; }; const serializeAws_restJson1_1AttributeKeyAndValueList = ( @@ -13322,17 +13310,14 @@ const serializeAws_restJson1_1AttributeNameAndValue = ( input: AttributeNameAndValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.Value !== undefined) { - bodyParams["Value"] = serializeAws_restJson1_1TypedAttributeValue( - input.Value, - context - ); - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.Value !== undefined && { + Value: serializeAws_restJson1_1TypedAttributeValue(input.Value, context) + }) + }; }; const serializeAws_restJson1_1AttributeNameAndValueList = ( @@ -13355,730 +13340,624 @@ const serializeAws_restJson1_1BatchAddFacetToObject = ( input: BatchAddFacetToObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectAttributeList !== undefined) { - bodyParams[ - "ObjectAttributeList" - ] = serializeAws_restJson1_1AttributeKeyAndValueList( - input.ObjectAttributeList, - context - ); - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - if (input.SchemaFacet !== undefined) { - bodyParams["SchemaFacet"] = serializeAws_restJson1_1SchemaFacet( - input.SchemaFacet, - context - ); - } - return bodyParams; + return { + ...(input.ObjectAttributeList !== undefined && { + ObjectAttributeList: serializeAws_restJson1_1AttributeKeyAndValueList( + input.ObjectAttributeList, + context + ) + }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }), + ...(input.SchemaFacet !== undefined && { + SchemaFacet: serializeAws_restJson1_1SchemaFacet( + input.SchemaFacet, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchAttachObject = ( input: BatchAttachObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChildReference !== undefined) { - bodyParams["ChildReference"] = serializeAws_restJson1_1ObjectReference( - input.ChildReference, - context - ); - } - if (input.LinkName !== undefined) { - bodyParams["LinkName"] = input.LinkName; - } - if (input.ParentReference !== undefined) { - bodyParams["ParentReference"] = serializeAws_restJson1_1ObjectReference( - input.ParentReference, - context - ); - } - return bodyParams; + return { + ...(input.ChildReference !== undefined && { + ChildReference: serializeAws_restJson1_1ObjectReference( + input.ChildReference, + context + ) + }), + ...(input.LinkName !== undefined && { LinkName: input.LinkName }), + ...(input.ParentReference !== undefined && { + ParentReference: serializeAws_restJson1_1ObjectReference( + input.ParentReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchAttachPolicy = ( input: BatchAttachPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - if (input.PolicyReference !== undefined) { - bodyParams["PolicyReference"] = serializeAws_restJson1_1ObjectReference( - input.PolicyReference, - context - ); - } - return bodyParams; + return { + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }), + ...(input.PolicyReference !== undefined && { + PolicyReference: serializeAws_restJson1_1ObjectReference( + input.PolicyReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchAttachToIndex = ( input: BatchAttachToIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexReference !== undefined) { - bodyParams["IndexReference"] = serializeAws_restJson1_1ObjectReference( - input.IndexReference, - context - ); - } - if (input.TargetReference !== undefined) { - bodyParams["TargetReference"] = serializeAws_restJson1_1ObjectReference( - input.TargetReference, - context - ); - } - return bodyParams; + return { + ...(input.IndexReference !== undefined && { + IndexReference: serializeAws_restJson1_1ObjectReference( + input.IndexReference, + context + ) + }), + ...(input.TargetReference !== undefined && { + TargetReference: serializeAws_restJson1_1ObjectReference( + input.TargetReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchAttachTypedLink = ( input: BatchAttachTypedLink, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams[ - "Attributes" - ] = serializeAws_restJson1_1AttributeNameAndValueList( - input.Attributes, - context - ); - } - if (input.SourceObjectReference !== undefined) { - bodyParams[ - "SourceObjectReference" - ] = serializeAws_restJson1_1ObjectReference( - input.SourceObjectReference, - context - ); - } - if (input.TargetObjectReference !== undefined) { - bodyParams[ - "TargetObjectReference" - ] = serializeAws_restJson1_1ObjectReference( - input.TargetObjectReference, - context - ); - } - if (input.TypedLinkFacet !== undefined) { - bodyParams[ - "TypedLinkFacet" - ] = serializeAws_restJson1_1TypedLinkSchemaAndFacetName( - input.TypedLinkFacet, - context - ); - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1AttributeNameAndValueList( + input.Attributes, + context + ) + }), + ...(input.SourceObjectReference !== undefined && { + SourceObjectReference: serializeAws_restJson1_1ObjectReference( + input.SourceObjectReference, + context + ) + }), + ...(input.TargetObjectReference !== undefined && { + TargetObjectReference: serializeAws_restJson1_1ObjectReference( + input.TargetObjectReference, + context + ) + }), + ...(input.TypedLinkFacet !== undefined && { + TypedLinkFacet: serializeAws_restJson1_1TypedLinkSchemaAndFacetName( + input.TypedLinkFacet, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchCreateIndex = ( input: BatchCreateIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchReferenceName !== undefined) { - bodyParams["BatchReferenceName"] = input.BatchReferenceName; - } - if (input.IsUnique !== undefined) { - bodyParams["IsUnique"] = input.IsUnique; - } - if (input.LinkName !== undefined) { - bodyParams["LinkName"] = input.LinkName; - } - if (input.OrderedIndexedAttributeList !== undefined) { - bodyParams[ - "OrderedIndexedAttributeList" - ] = serializeAws_restJson1_1AttributeKeyList( - input.OrderedIndexedAttributeList, - context - ); - } - if (input.ParentReference !== undefined) { - bodyParams["ParentReference"] = serializeAws_restJson1_1ObjectReference( - input.ParentReference, - context - ); - } - return bodyParams; + return { + ...(input.BatchReferenceName !== undefined && { + BatchReferenceName: input.BatchReferenceName + }), + ...(input.IsUnique !== undefined && { IsUnique: input.IsUnique }), + ...(input.LinkName !== undefined && { LinkName: input.LinkName }), + ...(input.OrderedIndexedAttributeList !== undefined && { + OrderedIndexedAttributeList: serializeAws_restJson1_1AttributeKeyList( + input.OrderedIndexedAttributeList, + context + ) + }), + ...(input.ParentReference !== undefined && { + ParentReference: serializeAws_restJson1_1ObjectReference( + input.ParentReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchCreateObject = ( input: BatchCreateObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchReferenceName !== undefined) { - bodyParams["BatchReferenceName"] = input.BatchReferenceName; - } - if (input.LinkName !== undefined) { - bodyParams["LinkName"] = input.LinkName; - } - if (input.ObjectAttributeList !== undefined) { - bodyParams[ - "ObjectAttributeList" - ] = serializeAws_restJson1_1AttributeKeyAndValueList( - input.ObjectAttributeList, - context - ); - } - if (input.ParentReference !== undefined) { - bodyParams["ParentReference"] = serializeAws_restJson1_1ObjectReference( - input.ParentReference, - context - ); - } - if (input.SchemaFacet !== undefined) { - bodyParams["SchemaFacet"] = serializeAws_restJson1_1SchemaFacetList( - input.SchemaFacet, - context - ); - } - return bodyParams; + return { + ...(input.BatchReferenceName !== undefined && { + BatchReferenceName: input.BatchReferenceName + }), + ...(input.LinkName !== undefined && { LinkName: input.LinkName }), + ...(input.ObjectAttributeList !== undefined && { + ObjectAttributeList: serializeAws_restJson1_1AttributeKeyAndValueList( + input.ObjectAttributeList, + context + ) + }), + ...(input.ParentReference !== undefined && { + ParentReference: serializeAws_restJson1_1ObjectReference( + input.ParentReference, + context + ) + }), + ...(input.SchemaFacet !== undefined && { + SchemaFacet: serializeAws_restJson1_1SchemaFacetList( + input.SchemaFacet, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchDeleteObject = ( input: BatchDeleteObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchDetachFromIndex = ( input: BatchDetachFromIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexReference !== undefined) { - bodyParams["IndexReference"] = serializeAws_restJson1_1ObjectReference( - input.IndexReference, - context - ); - } - if (input.TargetReference !== undefined) { - bodyParams["TargetReference"] = serializeAws_restJson1_1ObjectReference( - input.TargetReference, - context - ); - } - return bodyParams; + return { + ...(input.IndexReference !== undefined && { + IndexReference: serializeAws_restJson1_1ObjectReference( + input.IndexReference, + context + ) + }), + ...(input.TargetReference !== undefined && { + TargetReference: serializeAws_restJson1_1ObjectReference( + input.TargetReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchDetachObject = ( input: BatchDetachObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchReferenceName !== undefined) { - bodyParams["BatchReferenceName"] = input.BatchReferenceName; - } - if (input.LinkName !== undefined) { - bodyParams["LinkName"] = input.LinkName; - } - if (input.ParentReference !== undefined) { - bodyParams["ParentReference"] = serializeAws_restJson1_1ObjectReference( - input.ParentReference, - context - ); - } - return bodyParams; + return { + ...(input.BatchReferenceName !== undefined && { + BatchReferenceName: input.BatchReferenceName + }), + ...(input.LinkName !== undefined && { LinkName: input.LinkName }), + ...(input.ParentReference !== undefined && { + ParentReference: serializeAws_restJson1_1ObjectReference( + input.ParentReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchDetachPolicy = ( input: BatchDetachPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - if (input.PolicyReference !== undefined) { - bodyParams["PolicyReference"] = serializeAws_restJson1_1ObjectReference( - input.PolicyReference, - context - ); - } - return bodyParams; + return { + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }), + ...(input.PolicyReference !== undefined && { + PolicyReference: serializeAws_restJson1_1ObjectReference( + input.PolicyReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchDetachTypedLink = ( input: BatchDetachTypedLink, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TypedLinkSpecifier !== undefined) { - bodyParams[ - "TypedLinkSpecifier" - ] = serializeAws_restJson1_1TypedLinkSpecifier( - input.TypedLinkSpecifier, - context - ); - } - return bodyParams; + return { + ...(input.TypedLinkSpecifier !== undefined && { + TypedLinkSpecifier: serializeAws_restJson1_1TypedLinkSpecifier( + input.TypedLinkSpecifier, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchGetLinkAttributes = ( input: BatchGetLinkAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeNames !== undefined) { - bodyParams["AttributeNames"] = serializeAws_restJson1_1AttributeNameList( - input.AttributeNames, - context - ); - } - if (input.TypedLinkSpecifier !== undefined) { - bodyParams[ - "TypedLinkSpecifier" - ] = serializeAws_restJson1_1TypedLinkSpecifier( - input.TypedLinkSpecifier, - context - ); - } - return bodyParams; + return { + ...(input.AttributeNames !== undefined && { + AttributeNames: serializeAws_restJson1_1AttributeNameList( + input.AttributeNames, + context + ) + }), + ...(input.TypedLinkSpecifier !== undefined && { + TypedLinkSpecifier: serializeAws_restJson1_1TypedLinkSpecifier( + input.TypedLinkSpecifier, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchGetObjectAttributes = ( input: BatchGetObjectAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeNames !== undefined) { - bodyParams["AttributeNames"] = serializeAws_restJson1_1AttributeNameList( - input.AttributeNames, - context - ); - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - if (input.SchemaFacet !== undefined) { - bodyParams["SchemaFacet"] = serializeAws_restJson1_1SchemaFacet( - input.SchemaFacet, - context - ); - } - return bodyParams; + return { + ...(input.AttributeNames !== undefined && { + AttributeNames: serializeAws_restJson1_1AttributeNameList( + input.AttributeNames, + context + ) + }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }), + ...(input.SchemaFacet !== undefined && { + SchemaFacet: serializeAws_restJson1_1SchemaFacet( + input.SchemaFacet, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchGetObjectInformation = ( input: BatchGetObjectInformation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListAttachedIndices = ( input: BatchListAttachedIndices, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TargetReference !== undefined) { - bodyParams["TargetReference"] = serializeAws_restJson1_1ObjectReference( - input.TargetReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.TargetReference !== undefined && { + TargetReference: serializeAws_restJson1_1ObjectReference( + input.TargetReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListIncomingTypedLinks = ( input: BatchListIncomingTypedLinks, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FilterAttributeRanges !== undefined) { - bodyParams[ - "FilterAttributeRanges" - ] = serializeAws_restJson1_1TypedLinkAttributeRangeList( - input.FilterAttributeRanges, - context - ); - } - if (input.FilterTypedLink !== undefined) { - bodyParams[ - "FilterTypedLink" - ] = serializeAws_restJson1_1TypedLinkSchemaAndFacetName( - input.FilterTypedLink, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.FilterAttributeRanges !== undefined && { + FilterAttributeRanges: serializeAws_restJson1_1TypedLinkAttributeRangeList( + input.FilterAttributeRanges, + context + ) + }), + ...(input.FilterTypedLink !== undefined && { + FilterTypedLink: serializeAws_restJson1_1TypedLinkSchemaAndFacetName( + input.FilterTypedLink, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListIndex = ( input: BatchListIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexReference !== undefined) { - bodyParams["IndexReference"] = serializeAws_restJson1_1ObjectReference( - input.IndexReference, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.RangesOnIndexedValues !== undefined) { - bodyParams[ - "RangesOnIndexedValues" - ] = serializeAws_restJson1_1ObjectAttributeRangeList( - input.RangesOnIndexedValues, - context - ); - } - return bodyParams; + return { + ...(input.IndexReference !== undefined && { + IndexReference: serializeAws_restJson1_1ObjectReference( + input.IndexReference, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.RangesOnIndexedValues !== undefined && { + RangesOnIndexedValues: serializeAws_restJson1_1ObjectAttributeRangeList( + input.RangesOnIndexedValues, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListObjectAttributes = ( input: BatchListObjectAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FacetFilter !== undefined) { - bodyParams["FacetFilter"] = serializeAws_restJson1_1SchemaFacet( - input.FacetFilter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.FacetFilter !== undefined && { + FacetFilter: serializeAws_restJson1_1SchemaFacet( + input.FacetFilter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListObjectChildren = ( input: BatchListObjectChildren, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListObjectParentPaths = ( input: BatchListObjectParentPaths, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListObjectParents = ( input: BatchListObjectParents, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListObjectPolicies = ( input: BatchListObjectPolicies, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListOutgoingTypedLinks = ( input: BatchListOutgoingTypedLinks, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FilterAttributeRanges !== undefined) { - bodyParams[ - "FilterAttributeRanges" - ] = serializeAws_restJson1_1TypedLinkAttributeRangeList( - input.FilterAttributeRanges, - context - ); - } - if (input.FilterTypedLink !== undefined) { - bodyParams[ - "FilterTypedLink" - ] = serializeAws_restJson1_1TypedLinkSchemaAndFacetName( - input.FilterTypedLink, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.FilterAttributeRanges !== undefined && { + FilterAttributeRanges: serializeAws_restJson1_1TypedLinkAttributeRangeList( + input.FilterAttributeRanges, + context + ) + }), + ...(input.FilterTypedLink !== undefined && { + FilterTypedLink: serializeAws_restJson1_1TypedLinkSchemaAndFacetName( + input.FilterTypedLink, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchListPolicyAttachments = ( input: BatchListPolicyAttachments, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PolicyReference !== undefined) { - bodyParams["PolicyReference"] = serializeAws_restJson1_1ObjectReference( - input.PolicyReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.PolicyReference !== undefined && { + PolicyReference: serializeAws_restJson1_1ObjectReference( + input.PolicyReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchLookupPolicy = ( input: BatchLookupPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchReadOperation = ( input: BatchReadOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GetLinkAttributes !== undefined) { - bodyParams[ - "GetLinkAttributes" - ] = serializeAws_restJson1_1BatchGetLinkAttributes( - input.GetLinkAttributes, - context - ); - } - if (input.GetObjectAttributes !== undefined) { - bodyParams[ - "GetObjectAttributes" - ] = serializeAws_restJson1_1BatchGetObjectAttributes( - input.GetObjectAttributes, - context - ); - } - if (input.GetObjectInformation !== undefined) { - bodyParams[ - "GetObjectInformation" - ] = serializeAws_restJson1_1BatchGetObjectInformation( - input.GetObjectInformation, - context - ); - } - if (input.ListAttachedIndices !== undefined) { - bodyParams[ - "ListAttachedIndices" - ] = serializeAws_restJson1_1BatchListAttachedIndices( - input.ListAttachedIndices, - context - ); - } - if (input.ListIncomingTypedLinks !== undefined) { - bodyParams[ - "ListIncomingTypedLinks" - ] = serializeAws_restJson1_1BatchListIncomingTypedLinks( - input.ListIncomingTypedLinks, - context - ); - } - if (input.ListIndex !== undefined) { - bodyParams["ListIndex"] = serializeAws_restJson1_1BatchListIndex( - input.ListIndex, - context - ); - } - if (input.ListObjectAttributes !== undefined) { - bodyParams[ - "ListObjectAttributes" - ] = serializeAws_restJson1_1BatchListObjectAttributes( - input.ListObjectAttributes, - context - ); - } - if (input.ListObjectChildren !== undefined) { - bodyParams[ - "ListObjectChildren" - ] = serializeAws_restJson1_1BatchListObjectChildren( - input.ListObjectChildren, - context - ); - } - if (input.ListObjectParentPaths !== undefined) { - bodyParams[ - "ListObjectParentPaths" - ] = serializeAws_restJson1_1BatchListObjectParentPaths( - input.ListObjectParentPaths, - context - ); - } - if (input.ListObjectParents !== undefined) { - bodyParams[ - "ListObjectParents" - ] = serializeAws_restJson1_1BatchListObjectParents( - input.ListObjectParents, - context - ); - } - if (input.ListObjectPolicies !== undefined) { - bodyParams[ - "ListObjectPolicies" - ] = serializeAws_restJson1_1BatchListObjectPolicies( - input.ListObjectPolicies, - context - ); - } - if (input.ListOutgoingTypedLinks !== undefined) { - bodyParams[ - "ListOutgoingTypedLinks" - ] = serializeAws_restJson1_1BatchListOutgoingTypedLinks( - input.ListOutgoingTypedLinks, - context - ); - } - if (input.ListPolicyAttachments !== undefined) { - bodyParams[ - "ListPolicyAttachments" - ] = serializeAws_restJson1_1BatchListPolicyAttachments( - input.ListPolicyAttachments, - context - ); - } - if (input.LookupPolicy !== undefined) { - bodyParams["LookupPolicy"] = serializeAws_restJson1_1BatchLookupPolicy( - input.LookupPolicy, - context - ); - } - return bodyParams; + return { + ...(input.GetLinkAttributes !== undefined && { + GetLinkAttributes: serializeAws_restJson1_1BatchGetLinkAttributes( + input.GetLinkAttributes, + context + ) + }), + ...(input.GetObjectAttributes !== undefined && { + GetObjectAttributes: serializeAws_restJson1_1BatchGetObjectAttributes( + input.GetObjectAttributes, + context + ) + }), + ...(input.GetObjectInformation !== undefined && { + GetObjectInformation: serializeAws_restJson1_1BatchGetObjectInformation( + input.GetObjectInformation, + context + ) + }), + ...(input.ListAttachedIndices !== undefined && { + ListAttachedIndices: serializeAws_restJson1_1BatchListAttachedIndices( + input.ListAttachedIndices, + context + ) + }), + ...(input.ListIncomingTypedLinks !== undefined && { + ListIncomingTypedLinks: serializeAws_restJson1_1BatchListIncomingTypedLinks( + input.ListIncomingTypedLinks, + context + ) + }), + ...(input.ListIndex !== undefined && { + ListIndex: serializeAws_restJson1_1BatchListIndex( + input.ListIndex, + context + ) + }), + ...(input.ListObjectAttributes !== undefined && { + ListObjectAttributes: serializeAws_restJson1_1BatchListObjectAttributes( + input.ListObjectAttributes, + context + ) + }), + ...(input.ListObjectChildren !== undefined && { + ListObjectChildren: serializeAws_restJson1_1BatchListObjectChildren( + input.ListObjectChildren, + context + ) + }), + ...(input.ListObjectParentPaths !== undefined && { + ListObjectParentPaths: serializeAws_restJson1_1BatchListObjectParentPaths( + input.ListObjectParentPaths, + context + ) + }), + ...(input.ListObjectParents !== undefined && { + ListObjectParents: serializeAws_restJson1_1BatchListObjectParents( + input.ListObjectParents, + context + ) + }), + ...(input.ListObjectPolicies !== undefined && { + ListObjectPolicies: serializeAws_restJson1_1BatchListObjectPolicies( + input.ListObjectPolicies, + context + ) + }), + ...(input.ListOutgoingTypedLinks !== undefined && { + ListOutgoingTypedLinks: serializeAws_restJson1_1BatchListOutgoingTypedLinks( + input.ListOutgoingTypedLinks, + context + ) + }), + ...(input.ListPolicyAttachments !== undefined && { + ListPolicyAttachments: serializeAws_restJson1_1BatchListPolicyAttachments( + input.ListPolicyAttachments, + context + ) + }), + ...(input.LookupPolicy !== undefined && { + LookupPolicy: serializeAws_restJson1_1BatchLookupPolicy( + input.LookupPolicy, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchReadOperationList = ( @@ -14094,178 +13973,158 @@ const serializeAws_restJson1_1BatchRemoveFacetFromObject = ( input: BatchRemoveFacetFromObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - if (input.SchemaFacet !== undefined) { - bodyParams["SchemaFacet"] = serializeAws_restJson1_1SchemaFacet( - input.SchemaFacet, - context - ); - } - return bodyParams; + return { + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }), + ...(input.SchemaFacet !== undefined && { + SchemaFacet: serializeAws_restJson1_1SchemaFacet( + input.SchemaFacet, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchUpdateLinkAttributes = ( input: BatchUpdateLinkAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeUpdates !== undefined) { - bodyParams[ - "AttributeUpdates" - ] = serializeAws_restJson1_1LinkAttributeUpdateList( - input.AttributeUpdates, - context - ); - } - if (input.TypedLinkSpecifier !== undefined) { - bodyParams[ - "TypedLinkSpecifier" - ] = serializeAws_restJson1_1TypedLinkSpecifier( - input.TypedLinkSpecifier, - context - ); - } - return bodyParams; -}; - -const serializeAws_restJson1_1BatchUpdateObjectAttributes = ( - input: BatchUpdateObjectAttributes, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.AttributeUpdates !== undefined) { - bodyParams[ - "AttributeUpdates" - ] = serializeAws_restJson1_1ObjectAttributeUpdateList( - input.AttributeUpdates, - context - ); - } - if (input.ObjectReference !== undefined) { - bodyParams["ObjectReference"] = serializeAws_restJson1_1ObjectReference( - input.ObjectReference, - context - ); - } - return bodyParams; + return { + ...(input.AttributeUpdates !== undefined && { + AttributeUpdates: serializeAws_restJson1_1LinkAttributeUpdateList( + input.AttributeUpdates, + context + ) + }), + ...(input.TypedLinkSpecifier !== undefined && { + TypedLinkSpecifier: serializeAws_restJson1_1TypedLinkSpecifier( + input.TypedLinkSpecifier, + context + ) + }) + }; }; -const serializeAws_restJson1_1BatchWriteOperation = ( - input: BatchWriteOperation, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.AddFacetToObject !== undefined) { - bodyParams[ - "AddFacetToObject" - ] = serializeAws_restJson1_1BatchAddFacetToObject( - input.AddFacetToObject, - context - ); - } - if (input.AttachObject !== undefined) { - bodyParams["AttachObject"] = serializeAws_restJson1_1BatchAttachObject( - input.AttachObject, - context - ); - } - if (input.AttachPolicy !== undefined) { - bodyParams["AttachPolicy"] = serializeAws_restJson1_1BatchAttachPolicy( - input.AttachPolicy, - context - ); - } - if (input.AttachToIndex !== undefined) { - bodyParams["AttachToIndex"] = serializeAws_restJson1_1BatchAttachToIndex( - input.AttachToIndex, - context - ); - } - if (input.AttachTypedLink !== undefined) { - bodyParams[ - "AttachTypedLink" - ] = serializeAws_restJson1_1BatchAttachTypedLink( - input.AttachTypedLink, - context - ); - } - if (input.CreateIndex !== undefined) { - bodyParams["CreateIndex"] = serializeAws_restJson1_1BatchCreateIndex( - input.CreateIndex, - context - ); - } - if (input.CreateObject !== undefined) { - bodyParams["CreateObject"] = serializeAws_restJson1_1BatchCreateObject( - input.CreateObject, - context - ); - } - if (input.DeleteObject !== undefined) { - bodyParams["DeleteObject"] = serializeAws_restJson1_1BatchDeleteObject( - input.DeleteObject, - context - ); - } - if (input.DetachFromIndex !== undefined) { - bodyParams[ - "DetachFromIndex" - ] = serializeAws_restJson1_1BatchDetachFromIndex( - input.DetachFromIndex, - context - ); - } - if (input.DetachObject !== undefined) { - bodyParams["DetachObject"] = serializeAws_restJson1_1BatchDetachObject( - input.DetachObject, - context - ); - } - if (input.DetachPolicy !== undefined) { - bodyParams["DetachPolicy"] = serializeAws_restJson1_1BatchDetachPolicy( - input.DetachPolicy, - context - ); - } - if (input.DetachTypedLink !== undefined) { - bodyParams[ - "DetachTypedLink" - ] = serializeAws_restJson1_1BatchDetachTypedLink( - input.DetachTypedLink, - context - ); - } - if (input.RemoveFacetFromObject !== undefined) { - bodyParams[ - "RemoveFacetFromObject" - ] = serializeAws_restJson1_1BatchRemoveFacetFromObject( - input.RemoveFacetFromObject, - context - ); - } - if (input.UpdateLinkAttributes !== undefined) { - bodyParams[ - "UpdateLinkAttributes" - ] = serializeAws_restJson1_1BatchUpdateLinkAttributes( - input.UpdateLinkAttributes, - context - ); - } - if (input.UpdateObjectAttributes !== undefined) { - bodyParams[ - "UpdateObjectAttributes" - ] = serializeAws_restJson1_1BatchUpdateObjectAttributes( - input.UpdateObjectAttributes, - context - ); - } - return bodyParams; +const serializeAws_restJson1_1BatchUpdateObjectAttributes = ( + input: BatchUpdateObjectAttributes, + context: __SerdeContext +): any => { + return { + ...(input.AttributeUpdates !== undefined && { + AttributeUpdates: serializeAws_restJson1_1ObjectAttributeUpdateList( + input.AttributeUpdates, + context + ) + }), + ...(input.ObjectReference !== undefined && { + ObjectReference: serializeAws_restJson1_1ObjectReference( + input.ObjectReference, + context + ) + }) + }; +}; + +const serializeAws_restJson1_1BatchWriteOperation = ( + input: BatchWriteOperation, + context: __SerdeContext +): any => { + return { + ...(input.AddFacetToObject !== undefined && { + AddFacetToObject: serializeAws_restJson1_1BatchAddFacetToObject( + input.AddFacetToObject, + context + ) + }), + ...(input.AttachObject !== undefined && { + AttachObject: serializeAws_restJson1_1BatchAttachObject( + input.AttachObject, + context + ) + }), + ...(input.AttachPolicy !== undefined && { + AttachPolicy: serializeAws_restJson1_1BatchAttachPolicy( + input.AttachPolicy, + context + ) + }), + ...(input.AttachToIndex !== undefined && { + AttachToIndex: serializeAws_restJson1_1BatchAttachToIndex( + input.AttachToIndex, + context + ) + }), + ...(input.AttachTypedLink !== undefined && { + AttachTypedLink: serializeAws_restJson1_1BatchAttachTypedLink( + input.AttachTypedLink, + context + ) + }), + ...(input.CreateIndex !== undefined && { + CreateIndex: serializeAws_restJson1_1BatchCreateIndex( + input.CreateIndex, + context + ) + }), + ...(input.CreateObject !== undefined && { + CreateObject: serializeAws_restJson1_1BatchCreateObject( + input.CreateObject, + context + ) + }), + ...(input.DeleteObject !== undefined && { + DeleteObject: serializeAws_restJson1_1BatchDeleteObject( + input.DeleteObject, + context + ) + }), + ...(input.DetachFromIndex !== undefined && { + DetachFromIndex: serializeAws_restJson1_1BatchDetachFromIndex( + input.DetachFromIndex, + context + ) + }), + ...(input.DetachObject !== undefined && { + DetachObject: serializeAws_restJson1_1BatchDetachObject( + input.DetachObject, + context + ) + }), + ...(input.DetachPolicy !== undefined && { + DetachPolicy: serializeAws_restJson1_1BatchDetachPolicy( + input.DetachPolicy, + context + ) + }), + ...(input.DetachTypedLink !== undefined && { + DetachTypedLink: serializeAws_restJson1_1BatchDetachTypedLink( + input.DetachTypedLink, + context + ) + }), + ...(input.RemoveFacetFromObject !== undefined && { + RemoveFacetFromObject: serializeAws_restJson1_1BatchRemoveFacetFromObject( + input.RemoveFacetFromObject, + context + ) + }), + ...(input.UpdateLinkAttributes !== undefined && { + UpdateLinkAttributes: serializeAws_restJson1_1BatchUpdateLinkAttributes( + input.UpdateLinkAttributes, + context + ) + }), + ...(input.UpdateObjectAttributes !== undefined && { + UpdateObjectAttributes: serializeAws_restJson1_1BatchUpdateObjectAttributes( + input.UpdateObjectAttributes, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchWriteOperationList = ( @@ -14281,53 +14140,43 @@ const serializeAws_restJson1_1FacetAttribute = ( input: FacetAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeDefinition !== undefined) { - bodyParams[ - "AttributeDefinition" - ] = serializeAws_restJson1_1FacetAttributeDefinition( - input.AttributeDefinition, - context - ); - } - if (input.AttributeReference !== undefined) { - bodyParams[ - "AttributeReference" - ] = serializeAws_restJson1_1FacetAttributeReference( - input.AttributeReference, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RequiredBehavior !== undefined) { - bodyParams["RequiredBehavior"] = input.RequiredBehavior; - } - return bodyParams; + return { + ...(input.AttributeDefinition !== undefined && { + AttributeDefinition: serializeAws_restJson1_1FacetAttributeDefinition( + input.AttributeDefinition, + context + ) + }), + ...(input.AttributeReference !== undefined && { + AttributeReference: serializeAws_restJson1_1FacetAttributeReference( + input.AttributeReference, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RequiredBehavior !== undefined && { + RequiredBehavior: input.RequiredBehavior + }) + }; }; const serializeAws_restJson1_1FacetAttributeDefinition = ( input: FacetAttributeDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultValue !== undefined) { - bodyParams["DefaultValue"] = serializeAws_restJson1_1TypedAttributeValue( - input.DefaultValue, - context - ); - } - if (input.IsImmutable !== undefined) { - bodyParams["IsImmutable"] = input.IsImmutable; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_restJson1_1RuleMap(input.Rules, context); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.DefaultValue !== undefined && { + DefaultValue: serializeAws_restJson1_1TypedAttributeValue( + input.DefaultValue, + context + ) + }), + ...(input.IsImmutable !== undefined && { IsImmutable: input.IsImmutable }), + ...(input.Rules !== undefined && { + Rules: serializeAws_restJson1_1RuleMap(input.Rules, context) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1FacetAttributeList = ( @@ -14343,31 +14192,29 @@ const serializeAws_restJson1_1FacetAttributeReference = ( input: FacetAttributeReference, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetAttributeName !== undefined) { - bodyParams["TargetAttributeName"] = input.TargetAttributeName; - } - if (input.TargetFacetName !== undefined) { - bodyParams["TargetFacetName"] = input.TargetFacetName; - } - return bodyParams; + return { + ...(input.TargetAttributeName !== undefined && { + TargetAttributeName: input.TargetAttributeName + }), + ...(input.TargetFacetName !== undefined && { + TargetFacetName: input.TargetFacetName + }) + }; }; const serializeAws_restJson1_1FacetAttributeUpdate = ( input: FacetAttributeUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Attribute !== undefined) { - bodyParams["Attribute"] = serializeAws_restJson1_1FacetAttribute( - input.Attribute, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Attribute !== undefined && { + Attribute: serializeAws_restJson1_1FacetAttribute( + input.Attribute, + context + ) + }) + }; }; const serializeAws_restJson1_1FacetAttributeUpdateList = ( @@ -14383,39 +14230,37 @@ const serializeAws_restJson1_1LinkAttributeAction = ( input: LinkAttributeAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeActionType !== undefined) { - bodyParams["AttributeActionType"] = input.AttributeActionType; - } - if (input.AttributeUpdateValue !== undefined) { - bodyParams[ - "AttributeUpdateValue" - ] = serializeAws_restJson1_1TypedAttributeValue( - input.AttributeUpdateValue, - context - ); - } - return bodyParams; + return { + ...(input.AttributeActionType !== undefined && { + AttributeActionType: input.AttributeActionType + }), + ...(input.AttributeUpdateValue !== undefined && { + AttributeUpdateValue: serializeAws_restJson1_1TypedAttributeValue( + input.AttributeUpdateValue, + context + ) + }) + }; }; const serializeAws_restJson1_1LinkAttributeUpdate = ( input: LinkAttributeUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeAction !== undefined) { - bodyParams["AttributeAction"] = serializeAws_restJson1_1LinkAttributeAction( - input.AttributeAction, - context - ); - } - if (input.AttributeKey !== undefined) { - bodyParams["AttributeKey"] = serializeAws_restJson1_1AttributeKey( - input.AttributeKey, - context - ); - } - return bodyParams; + return { + ...(input.AttributeAction !== undefined && { + AttributeAction: serializeAws_restJson1_1LinkAttributeAction( + input.AttributeAction, + context + ) + }), + ...(input.AttributeKey !== undefined && { + AttributeKey: serializeAws_restJson1_1AttributeKey( + input.AttributeKey, + context + ) + }) + }; }; const serializeAws_restJson1_1LinkAttributeUpdateList = ( @@ -14431,39 +14276,37 @@ const serializeAws_restJson1_1ObjectAttributeAction = ( input: ObjectAttributeAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectAttributeActionType !== undefined) { - bodyParams["ObjectAttributeActionType"] = input.ObjectAttributeActionType; - } - if (input.ObjectAttributeUpdateValue !== undefined) { - bodyParams[ - "ObjectAttributeUpdateValue" - ] = serializeAws_restJson1_1TypedAttributeValue( - input.ObjectAttributeUpdateValue, - context - ); - } - return bodyParams; + return { + ...(input.ObjectAttributeActionType !== undefined && { + ObjectAttributeActionType: input.ObjectAttributeActionType + }), + ...(input.ObjectAttributeUpdateValue !== undefined && { + ObjectAttributeUpdateValue: serializeAws_restJson1_1TypedAttributeValue( + input.ObjectAttributeUpdateValue, + context + ) + }) + }; }; const serializeAws_restJson1_1ObjectAttributeRange = ( input: ObjectAttributeRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeKey !== undefined) { - bodyParams["AttributeKey"] = serializeAws_restJson1_1AttributeKey( - input.AttributeKey, - context - ); - } - if (input.Range !== undefined) { - bodyParams["Range"] = serializeAws_restJson1_1TypedAttributeValueRange( - input.Range, - context - ); - } - return bodyParams; + return { + ...(input.AttributeKey !== undefined && { + AttributeKey: serializeAws_restJson1_1AttributeKey( + input.AttributeKey, + context + ) + }), + ...(input.Range !== undefined && { + Range: serializeAws_restJson1_1TypedAttributeValueRange( + input.Range, + context + ) + }) + }; }; const serializeAws_restJson1_1ObjectAttributeRangeList = ( @@ -14479,22 +14322,20 @@ const serializeAws_restJson1_1ObjectAttributeUpdate = ( input: ObjectAttributeUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ObjectAttributeAction !== undefined) { - bodyParams[ - "ObjectAttributeAction" - ] = serializeAws_restJson1_1ObjectAttributeAction( - input.ObjectAttributeAction, - context - ); - } - if (input.ObjectAttributeKey !== undefined) { - bodyParams["ObjectAttributeKey"] = serializeAws_restJson1_1AttributeKey( - input.ObjectAttributeKey, - context - ); - } - return bodyParams; + return { + ...(input.ObjectAttributeAction !== undefined && { + ObjectAttributeAction: serializeAws_restJson1_1ObjectAttributeAction( + input.ObjectAttributeAction, + context + ) + }), + ...(input.ObjectAttributeKey !== undefined && { + ObjectAttributeKey: serializeAws_restJson1_1AttributeKey( + input.ObjectAttributeKey, + context + ) + }) + }; }; const serializeAws_restJson1_1ObjectAttributeUpdateList = ( @@ -14510,28 +14351,24 @@ const serializeAws_restJson1_1ObjectReference = ( input: ObjectReference, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Selector !== undefined) { - bodyParams["Selector"] = input.Selector; - } - return bodyParams; + return { + ...(input.Selector !== undefined && { Selector: input.Selector }) + }; }; const serializeAws_restJson1_1Rule = ( input: Rule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_restJson1_1RuleParameterMap( - input.Parameters, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Parameters !== undefined && { + Parameters: serializeAws_restJson1_1RuleParameterMap( + input.Parameters, + context + ) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1RuleMap = ( @@ -14558,14 +14395,10 @@ const serializeAws_restJson1_1SchemaFacet = ( input: SchemaFacet, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FacetName !== undefined) { - bodyParams["FacetName"] = input.FacetName; - } - if (input.SchemaArn !== undefined) { - bodyParams["SchemaArn"] = input.SchemaArn; - } - return bodyParams; + return { + ...(input.FacetName !== undefined && { FacetName: input.FacetName }), + ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }) + }; }; const serializeAws_restJson1_1SchemaFacetList = ( @@ -14581,14 +14414,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagKeyList = ( @@ -14609,80 +14438,64 @@ const serializeAws_restJson1_1TypedAttributeValue = ( input: TypedAttributeValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BinaryValue !== undefined) { - bodyParams["BinaryValue"] = context.base64Encoder(input.BinaryValue); - } - if (input.BooleanValue !== undefined) { - bodyParams["BooleanValue"] = input.BooleanValue; - } - if (input.DatetimeValue !== undefined) { - bodyParams["DatetimeValue"] = Math.round( - input.DatetimeValue.getTime() / 1000 - ); - } - if (input.NumberValue !== undefined) { - bodyParams["NumberValue"] = input.NumberValue; - } - if (input.StringValue !== undefined) { - bodyParams["StringValue"] = input.StringValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1TypedAttributeValueRange = ( input: TypedAttributeValueRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndMode !== undefined) { - bodyParams["EndMode"] = input.EndMode; - } - if (input.EndValue !== undefined) { - bodyParams["EndValue"] = serializeAws_restJson1_1TypedAttributeValue( - input.EndValue, - context - ); - } - if (input.StartMode !== undefined) { - bodyParams["StartMode"] = input.StartMode; - } - if (input.StartValue !== undefined) { - bodyParams["StartValue"] = serializeAws_restJson1_1TypedAttributeValue( - input.StartValue, - context - ); - } - return bodyParams; + return { + ...(input.EndMode !== undefined && { EndMode: input.EndMode }), + ...(input.EndValue !== undefined && { + EndValue: serializeAws_restJson1_1TypedAttributeValue( + input.EndValue, + context + ) + }), + ...(input.StartMode !== undefined && { StartMode: input.StartMode }), + ...(input.StartValue !== undefined && { + StartValue: serializeAws_restJson1_1TypedAttributeValue( + input.StartValue, + context + ) + }) + }; }; const serializeAws_restJson1_1TypedLinkAttributeDefinition = ( input: TypedLinkAttributeDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultValue !== undefined) { - bodyParams["DefaultValue"] = serializeAws_restJson1_1TypedAttributeValue( - input.DefaultValue, - context - ); - } - if (input.IsImmutable !== undefined) { - bodyParams["IsImmutable"] = input.IsImmutable; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RequiredBehavior !== undefined) { - bodyParams["RequiredBehavior"] = input.RequiredBehavior; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_restJson1_1RuleMap(input.Rules, context); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.DefaultValue !== undefined && { + DefaultValue: serializeAws_restJson1_1TypedAttributeValue( + 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_restJson1_1RuleMap(input.Rules, context) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1TypedLinkAttributeDefinitionList = ( @@ -14698,17 +14511,17 @@ const serializeAws_restJson1_1TypedLinkAttributeRange = ( input: TypedLinkAttributeRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.Range !== undefined) { - bodyParams["Range"] = serializeAws_restJson1_1TypedAttributeValueRange( - input.Range, - context - ); - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.Range !== undefined && { + Range: serializeAws_restJson1_1TypedAttributeValueRange( + input.Range, + context + ) + }) + }; }; const serializeAws_restJson1_1TypedLinkAttributeRangeList = ( @@ -14724,46 +14537,36 @@ const serializeAws_restJson1_1TypedLinkFacet = ( input: TypedLinkFacet, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams[ - "Attributes" - ] = serializeAws_restJson1_1TypedLinkAttributeDefinitionList( - input.Attributes, - context - ); - } - if (input.IdentityAttributeOrder !== undefined) { - bodyParams[ - "IdentityAttributeOrder" - ] = serializeAws_restJson1_1AttributeNameList( - input.IdentityAttributeOrder, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1TypedLinkAttributeDefinitionList( + input.Attributes, + context + ) + }), + ...(input.IdentityAttributeOrder !== undefined && { + IdentityAttributeOrder: serializeAws_restJson1_1AttributeNameList( + input.IdentityAttributeOrder, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_restJson1_1TypedLinkFacetAttributeUpdate = ( input: TypedLinkFacetAttributeUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Attribute !== undefined) { - bodyParams[ - "Attribute" - ] = serializeAws_restJson1_1TypedLinkAttributeDefinition( - input.Attribute, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Attribute !== undefined && { + Attribute: serializeAws_restJson1_1TypedLinkAttributeDefinition( + input.Attribute, + context + ) + }) + }; }; const serializeAws_restJson1_1TypedLinkFacetAttributeUpdateList = ( @@ -14779,54 +14582,44 @@ const serializeAws_restJson1_1TypedLinkSchemaAndFacetName = ( input: TypedLinkSchemaAndFacetName, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SchemaArn !== undefined) { - bodyParams["SchemaArn"] = input.SchemaArn; - } - if (input.TypedLinkName !== undefined) { - bodyParams["TypedLinkName"] = input.TypedLinkName; - } - return bodyParams; + return { + ...(input.SchemaArn !== undefined && { SchemaArn: input.SchemaArn }), + ...(input.TypedLinkName !== undefined && { + TypedLinkName: input.TypedLinkName + }) + }; }; const serializeAws_restJson1_1TypedLinkSpecifier = ( input: TypedLinkSpecifier, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityAttributeValues !== undefined) { - bodyParams[ - "IdentityAttributeValues" - ] = serializeAws_restJson1_1AttributeNameAndValueList( - input.IdentityAttributeValues, - context - ); - } - if (input.SourceObjectReference !== undefined) { - bodyParams[ - "SourceObjectReference" - ] = serializeAws_restJson1_1ObjectReference( - input.SourceObjectReference, - context - ); - } - if (input.TargetObjectReference !== undefined) { - bodyParams[ - "TargetObjectReference" - ] = serializeAws_restJson1_1ObjectReference( - input.TargetObjectReference, - context - ); - } - if (input.TypedLinkFacet !== undefined) { - bodyParams[ - "TypedLinkFacet" - ] = serializeAws_restJson1_1TypedLinkSchemaAndFacetName( - input.TypedLinkFacet, - context - ); - } - return bodyParams; + return { + ...(input.IdentityAttributeValues !== undefined && { + IdentityAttributeValues: serializeAws_restJson1_1AttributeNameAndValueList( + input.IdentityAttributeValues, + context + ) + }), + ...(input.SourceObjectReference !== undefined && { + SourceObjectReference: serializeAws_restJson1_1ObjectReference( + input.SourceObjectReference, + context + ) + }), + ...(input.TargetObjectReference !== undefined && { + TargetObjectReference: serializeAws_restJson1_1ObjectReference( + input.TargetObjectReference, + context + ) + }), + ...(input.TypedLinkFacet !== undefined && { + TypedLinkFacet: serializeAws_restJson1_1TypedLinkSchemaAndFacetName( + input.TypedLinkFacet, + context + ) + }) + }; }; const deserializeAws_restJson1_1Arns = ( diff --git a/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts b/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts index 336a1a93fa9d..463b1e36427b 100644 --- a/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm-v2/protocols/Aws_json1_1.ts @@ -1834,136 +1834,105 @@ const serializeAws_json1_1CopyBackupToRegionRequest = ( input: CopyBackupToRegionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - if (input.DestinationRegion !== undefined) { - bodyParams["DestinationRegion"] = input.DestinationRegion; - } - if (input.TagList !== undefined) { - bodyParams["TagList"] = serializeAws_json1_1TagList(input.TagList, context); - } - return bodyParams; + return { + ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ...(input.DestinationRegion !== undefined && { + DestinationRegion: input.DestinationRegion + }), + ...(input.TagList !== undefined && { + TagList: serializeAws_json1_1TagList(input.TagList, context) + }) + }; }; const serializeAws_json1_1CreateClusterRequest = ( input: CreateClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HsmType !== undefined) { - bodyParams["HsmType"] = input.HsmType; - } - if (input.SourceBackupId !== undefined) { - bodyParams["SourceBackupId"] = input.SourceBackupId; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.TagList !== undefined) { - bodyParams["TagList"] = serializeAws_json1_1TagList(input.TagList, context); - } - return bodyParams; + return { + ...(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) + }) + }; }; const serializeAws_json1_1CreateHsmRequest = ( input: CreateHsmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.IpAddress !== undefined) { - bodyParams["IpAddress"] = input.IpAddress; - } - return bodyParams; + return { + ...(input.AvailabilityZone !== undefined && { + AvailabilityZone: input.AvailabilityZone + }), + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.IpAddress !== undefined && { IpAddress: input.IpAddress }) + }; }; const serializeAws_json1_1DeleteBackupRequest = ( input: DeleteBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - return bodyParams; + return { + ...(input.BackupId !== undefined && { BackupId: input.BackupId }) + }; }; const serializeAws_json1_1DeleteClusterRequest = ( input: DeleteClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }) + }; }; const serializeAws_json1_1DeleteHsmRequest = ( input: DeleteHsmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.EniId !== undefined) { - bodyParams["EniId"] = input.EniId; - } - if (input.EniIp !== undefined) { - bodyParams["EniIp"] = input.EniIp; - } - if (input.HsmId !== undefined) { - bodyParams["HsmId"] = input.HsmId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeBackupsRequest = ( input: DescribeBackupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortAscending !== undefined) { - bodyParams["SortAscending"] = input.SortAscending; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeClustersRequest = ( input: DescribeClustersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1Filters = ( @@ -1980,45 +1949,31 @@ const serializeAws_json1_1InitializeClusterRequest = ( input: InitializeClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.SignedCert !== undefined) { - bodyParams["SignedCert"] = input.SignedCert; - } - if (input.TrustAnchor !== undefined) { - bodyParams["TrustAnchor"] = input.TrustAnchor; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.SignedCert !== undefined && { SignedCert: input.SignedCert }), + ...(input.TrustAnchor !== undefined && { TrustAnchor: input.TrustAnchor }) + }; }; const serializeAws_json1_1ListTagsRequest = ( input: ListTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1RestoreBackupRequest = ( input: RestoreBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - return bodyParams; + return { + ...(input.BackupId !== undefined && { BackupId: input.BackupId }) + }; }; const serializeAws_json1_1Strings = ( @@ -2036,14 +1991,10 @@ const serializeAws_json1_1SubnetIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -2064,31 +2015,24 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagList !== undefined) { - bodyParams["TagList"] = serializeAws_json1_1TagList(input.TagList, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagList !== undefined && { + TagList: serializeAws_json1_1TagList(input.TagList, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagKeyList !== undefined) { - bodyParams["TagKeyList"] = serializeAws_json1_1TagKeyList( - input.TagKeyList, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagKeyList !== undefined && { + TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) + }) + }; }; const deserializeAws_json1_1Backup = ( diff --git a/clients/client-cloudhsm/protocols/Aws_json1_1.ts b/clients/client-cloudhsm/protocols/Aws_json1_1.ts index 65ddfdbaf3fd..ef10e27fea50 100644 --- a/clients/client-cloudhsm/protocols/Aws_json1_1.ts +++ b/clients/client-cloudhsm/protocols/Aws_json1_1.ts @@ -2108,163 +2108,124 @@ const serializeAws_json1_1AddTagsToResourceRequest = ( input: AddTagsToResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagList !== undefined) { - bodyParams["TagList"] = serializeAws_json1_1TagList(input.TagList, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagList !== undefined && { + TagList: serializeAws_json1_1TagList(input.TagList, context) + }) + }; }; const serializeAws_json1_1CreateHapgRequest = ( input: CreateHapgRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Label !== undefined) { - bodyParams["Label"] = input.Label; - } - return bodyParams; + return { + ...(input.Label !== undefined && { Label: input.Label }) + }; }; const serializeAws_json1_1CreateHsmRequest = ( input: CreateHsmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.EniIp !== undefined) { - bodyParams["EniIp"] = input.EniIp; - } - if (input.ExternalId !== undefined) { - bodyParams["ExternalId"] = input.ExternalId; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.SshKey !== undefined) { - bodyParams["SshKey"] = input.SshKey; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.SubscriptionType !== undefined) { - bodyParams["SubscriptionType"] = input.SubscriptionType; - } - if (input.SyslogIp !== undefined) { - bodyParams["SyslogIp"] = input.SyslogIp; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateLunaClientRequest = ( input: CreateLunaClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.Label !== undefined) { - bodyParams["Label"] = input.Label; - } - return bodyParams; + return { + ...(input.Certificate !== undefined && { Certificate: input.Certificate }), + ...(input.Label !== undefined && { Label: input.Label }) + }; }; const serializeAws_json1_1DeleteHapgRequest = ( input: DeleteHapgRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HapgArn !== undefined) { - bodyParams["HapgArn"] = input.HapgArn; - } - return bodyParams; + return { + ...(input.HapgArn !== undefined && { HapgArn: input.HapgArn }) + }; }; const serializeAws_json1_1DeleteHsmRequest = ( input: DeleteHsmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HsmArn !== undefined) { - bodyParams["HsmArn"] = input.HsmArn; - } - return bodyParams; + return { + ...(input.HsmArn !== undefined && { HsmArn: input.HsmArn }) + }; }; const serializeAws_json1_1DeleteLunaClientRequest = ( input: DeleteLunaClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientArn !== undefined) { - bodyParams["ClientArn"] = input.ClientArn; - } - return bodyParams; + return { + ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }) + }; }; const serializeAws_json1_1DescribeHapgRequest = ( input: DescribeHapgRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HapgArn !== undefined) { - bodyParams["HapgArn"] = input.HapgArn; - } - return bodyParams; + return { + ...(input.HapgArn !== undefined && { HapgArn: input.HapgArn }) + }; }; const serializeAws_json1_1DescribeHsmRequest = ( input: DescribeHsmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HsmArn !== undefined) { - bodyParams["HsmArn"] = input.HsmArn; - } - if (input.HsmSerialNumber !== undefined) { - bodyParams["HsmSerialNumber"] = input.HsmSerialNumber; - } - return bodyParams; + return { + ...(input.HsmArn !== undefined && { HsmArn: input.HsmArn }), + ...(input.HsmSerialNumber !== undefined && { + HsmSerialNumber: input.HsmSerialNumber + }) + }; }; const serializeAws_json1_1DescribeLunaClientRequest = ( input: DescribeLunaClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateFingerprint !== undefined) { - bodyParams["CertificateFingerprint"] = input.CertificateFingerprint; - } - if (input.ClientArn !== undefined) { - bodyParams["ClientArn"] = input.ClientArn; - } - return bodyParams; + return { + ...(input.CertificateFingerprint !== undefined && { + CertificateFingerprint: input.CertificateFingerprint + }), + ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }) + }; }; const serializeAws_json1_1GetConfigRequest = ( input: GetConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientArn !== undefined) { - bodyParams["ClientArn"] = input.ClientArn; - } - if (input.ClientVersion !== undefined) { - bodyParams["ClientVersion"] = input.ClientVersion; - } - if (input.HapgList !== undefined) { - bodyParams["HapgList"] = serializeAws_json1_1HapgList( - input.HapgList, - context - ); - } - return bodyParams; + return { + ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }), + ...(input.ClientVersion !== undefined && { + ClientVersion: input.ClientVersion + }), + ...(input.HapgList !== undefined && { + HapgList: serializeAws_json1_1HapgList(input.HapgList, context) + }) + }; }; const serializeAws_json1_1HapgList = ( @@ -2278,112 +2239,83 @@ const serializeAws_json1_1ListAvailableZonesRequest = ( input: ListAvailableZonesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ListHapgsRequest = ( input: ListHapgsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListHsmsRequest = ( input: ListHsmsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListLunaClientsRequest = ( input: ListLunaClientsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ModifyHapgRequest = ( input: ModifyHapgRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HapgArn !== undefined) { - bodyParams["HapgArn"] = input.HapgArn; - } - if (input.Label !== undefined) { - bodyParams["Label"] = input.Label; - } - if (input.PartitionSerialList !== undefined) { - bodyParams["PartitionSerialList"] = serializeAws_json1_1PartitionSerialList( - input.PartitionSerialList, - context - ); - } - return bodyParams; + return { + ...(input.HapgArn !== undefined && { HapgArn: input.HapgArn }), + ...(input.Label !== undefined && { Label: input.Label }), + ...(input.PartitionSerialList !== undefined && { + PartitionSerialList: serializeAws_json1_1PartitionSerialList( + input.PartitionSerialList, + context + ) + }) + }; }; const serializeAws_json1_1ModifyHsmRequest = ( input: ModifyHsmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EniIp !== undefined) { - bodyParams["EniIp"] = input.EniIp; - } - if (input.ExternalId !== undefined) { - bodyParams["ExternalId"] = input.ExternalId; - } - if (input.HsmArn !== undefined) { - bodyParams["HsmArn"] = input.HsmArn; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.SyslogIp !== undefined) { - bodyParams["SyslogIp"] = input.SyslogIp; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ModifyLunaClientRequest = ( input: ModifyLunaClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.ClientArn !== undefined) { - bodyParams["ClientArn"] = input.ClientArn; - } - return bodyParams; + return { + ...(input.Certificate !== undefined && { Certificate: input.Certificate }), + ...(input.ClientArn !== undefined && { ClientArn: input.ClientArn }) + }; }; const serializeAws_json1_1PartitionSerialList = ( @@ -2397,28 +2329,19 @@ const serializeAws_json1_1RemoveTagsFromResourceRequest = ( input: RemoveTagsFromResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeyList !== undefined) { - bodyParams["TagKeyList"] = serializeAws_json1_1TagKeyList( - input.TagKeyList, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeyList !== undefined && { + TagKeyList: serializeAws_json1_1TagKeyList(input.TagKeyList, context) + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( diff --git a/clients/client-cloudtrail/protocols/Aws_json1_1.ts b/clients/client-cloudtrail/protocols/Aws_json1_1.ts index de666be646e0..a9aaa37bf8ae 100644 --- a/clients/client-cloudtrail/protocols/Aws_json1_1.ts +++ b/clients/client-cloudtrail/protocols/Aws_json1_1.ts @@ -3710,81 +3710,62 @@ const serializeAws_json1_1AddTagsRequest = ( input: AddTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagsList !== undefined) { - bodyParams["TagsList"] = serializeAws_json1_1TagsList( - input.TagsList, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagsList !== undefined && { + TagsList: serializeAws_json1_1TagsList(input.TagsList, context) + }) + }; }; const serializeAws_json1_1CreateTrailRequest = ( input: CreateTrailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogsLogGroupArn !== undefined) { - bodyParams["CloudWatchLogsLogGroupArn"] = input.CloudWatchLogsLogGroupArn; - } - if (input.CloudWatchLogsRoleArn !== undefined) { - bodyParams["CloudWatchLogsRoleArn"] = input.CloudWatchLogsRoleArn; - } - if (input.EnableLogFileValidation !== undefined) { - bodyParams["EnableLogFileValidation"] = input.EnableLogFileValidation; - } - if (input.IncludeGlobalServiceEvents !== undefined) { - bodyParams["IncludeGlobalServiceEvents"] = input.IncludeGlobalServiceEvents; - } - if (input.IsMultiRegionTrail !== undefined) { - bodyParams["IsMultiRegionTrail"] = input.IsMultiRegionTrail; - } - if (input.IsOrganizationTrail !== undefined) { - bodyParams["IsOrganizationTrail"] = input.IsOrganizationTrail; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - if (input.S3KeyPrefix !== undefined) { - bodyParams["S3KeyPrefix"] = input.S3KeyPrefix; - } - if (input.SnsTopicName !== undefined) { - bodyParams["SnsTopicName"] = input.SnsTopicName; - } - if (input.TagsList !== undefined) { - bodyParams["TagsList"] = serializeAws_json1_1TagsList( - input.TagsList, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DataResource = ( input: DataResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1DataResourceValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1DataResourceValues(input.Values, context) + }) + }; }; const serializeAws_json1_1DataResourceValues = ( @@ -3805,56 +3786,52 @@ const serializeAws_json1_1DeleteTrailRequest = ( input: DeleteTrailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeTrailsRequest = ( input: DescribeTrailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.includeShadowTrails !== undefined) { - bodyParams["includeShadowTrails"] = input.includeShadowTrails; - } - if (input.trailNameList !== undefined) { - bodyParams["trailNameList"] = serializeAws_json1_1TrailNameList( - input.trailNameList, - context - ); - } - return bodyParams; + return { + ...(input.includeShadowTrails !== undefined && { + includeShadowTrails: input.includeShadowTrails + }), + ...(input.trailNameList !== undefined && { + trailNameList: serializeAws_json1_1TrailNameList( + input.trailNameList, + context + ) + }) + }; }; const serializeAws_json1_1EventSelector = ( input: EventSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataResources !== undefined) { - bodyParams["DataResources"] = serializeAws_json1_1DataResources( - input.DataResources, - context - ); - } - if (input.ExcludeManagementEventSources !== undefined) { - bodyParams[ - "ExcludeManagementEventSources" - ] = serializeAws_json1_1ExcludeManagementEventSources( - input.ExcludeManagementEventSources, - context - ); - } - if (input.IncludeManagementEvents !== undefined) { - bodyParams["IncludeManagementEvents"] = input.IncludeManagementEvents; - } - if (input.ReadWriteType !== undefined) { - bodyParams["ReadWriteType"] = input.ReadWriteType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EventSelectors = ( @@ -3875,55 +3852,45 @@ const serializeAws_json1_1GetEventSelectorsRequest = ( input: GetEventSelectorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrailName !== undefined) { - bodyParams["TrailName"] = input.TrailName; - } - return bodyParams; + return { + ...(input.TrailName !== undefined && { TrailName: input.TrailName }) + }; }; const serializeAws_json1_1GetInsightSelectorsRequest = ( input: GetInsightSelectorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrailName !== undefined) { - bodyParams["TrailName"] = input.TrailName; - } - return bodyParams; + return { + ...(input.TrailName !== undefined && { TrailName: input.TrailName }) + }; }; const serializeAws_json1_1GetTrailRequest = ( input: GetTrailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetTrailStatusRequest = ( input: GetTrailStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1InsightSelector = ( input: InsightSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InsightType !== undefined) { - bodyParams["InsightType"] = input.InsightType; - } - return bodyParams; + return { + ...(input.InsightType !== undefined && { InsightType: input.InsightType }) + }; }; const serializeAws_json1_1InsightSelectors = ( @@ -3939,59 +3906,53 @@ const serializeAws_json1_1ListPublicKeysRequest = ( input: ListPublicKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListTagsRequest = ( input: ListTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceIdList !== undefined) { - bodyParams["ResourceIdList"] = serializeAws_json1_1ResourceIdList( - input.ResourceIdList, - context - ); - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceIdList !== undefined && { + ResourceIdList: serializeAws_json1_1ResourceIdList( + input.ResourceIdList, + context + ) + }) + }; }; const serializeAws_json1_1ListTrailsRequest = ( input: ListTrailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1LookupAttribute = ( input: LookupAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeKey !== undefined) { - bodyParams["AttributeKey"] = input.AttributeKey; - } - if (input.AttributeValue !== undefined) { - bodyParams["AttributeValue"] = input.AttributeValue; - } - return bodyParams; + return { + ...(input.AttributeKey !== undefined && { + AttributeKey: input.AttributeKey + }), + ...(input.AttributeValue !== undefined && { + AttributeValue: input.AttributeValue + }) + }; }; const serializeAws_json1_1LookupAttributesList = ( @@ -4007,80 +3968,67 @@ const serializeAws_json1_1LookupEventsRequest = ( input: LookupEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.EventCategory !== undefined) { - bodyParams["EventCategory"] = input.EventCategory; - } - if (input.LookupAttributes !== undefined) { - bodyParams["LookupAttributes"] = serializeAws_json1_1LookupAttributesList( - input.LookupAttributes, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutEventSelectorsRequest = ( input: PutEventSelectorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventSelectors !== undefined) { - bodyParams["EventSelectors"] = serializeAws_json1_1EventSelectors( - input.EventSelectors, - context - ); - } - if (input.TrailName !== undefined) { - bodyParams["TrailName"] = input.TrailName; - } - return bodyParams; + return { + ...(input.EventSelectors !== undefined && { + EventSelectors: serializeAws_json1_1EventSelectors( + input.EventSelectors, + context + ) + }), + ...(input.TrailName !== undefined && { TrailName: input.TrailName }) + }; }; const serializeAws_json1_1PutInsightSelectorsRequest = ( input: PutInsightSelectorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InsightSelectors !== undefined) { - bodyParams["InsightSelectors"] = serializeAws_json1_1InsightSelectors( - input.InsightSelectors, - context - ); - } - if (input.TrailName !== undefined) { - bodyParams["TrailName"] = input.TrailName; - } - return bodyParams; + return { + ...(input.InsightSelectors !== undefined && { + InsightSelectors: serializeAws_json1_1InsightSelectors( + input.InsightSelectors, + context + ) + }), + ...(input.TrailName !== undefined && { TrailName: input.TrailName }) + }; }; const serializeAws_json1_1RemoveTagsRequest = ( input: RemoveTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagsList !== undefined) { - bodyParams["TagsList"] = serializeAws_json1_1TagsList( - input.TagsList, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagsList !== undefined && { + TagsList: serializeAws_json1_1TagsList(input.TagsList, context) + }) + }; }; const serializeAws_json1_1ResourceIdList = ( @@ -4094,33 +4042,25 @@ const serializeAws_json1_1StartLoggingRequest = ( input: StartLoggingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StopLoggingRequest = ( input: StopLoggingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagsList = ( @@ -4141,41 +4081,35 @@ const serializeAws_json1_1UpdateTrailRequest = ( input: UpdateTrailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogsLogGroupArn !== undefined) { - bodyParams["CloudWatchLogsLogGroupArn"] = input.CloudWatchLogsLogGroupArn; - } - if (input.CloudWatchLogsRoleArn !== undefined) { - bodyParams["CloudWatchLogsRoleArn"] = input.CloudWatchLogsRoleArn; - } - if (input.EnableLogFileValidation !== undefined) { - bodyParams["EnableLogFileValidation"] = input.EnableLogFileValidation; - } - if (input.IncludeGlobalServiceEvents !== undefined) { - bodyParams["IncludeGlobalServiceEvents"] = input.IncludeGlobalServiceEvents; - } - if (input.IsMultiRegionTrail !== undefined) { - bodyParams["IsMultiRegionTrail"] = input.IsMultiRegionTrail; - } - if (input.IsOrganizationTrail !== undefined) { - bodyParams["IsOrganizationTrail"] = input.IsOrganizationTrail; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - if (input.S3KeyPrefix !== undefined) { - bodyParams["S3KeyPrefix"] = input.S3KeyPrefix; - } - if (input.SnsTopicName !== undefined) { - bodyParams["SnsTopicName"] = input.SnsTopicName; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1AddTagsResponse = ( diff --git a/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts index a50c71250105..58f84eddf2c7 100644 --- a/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-events/protocols/Aws_json1_1.ts @@ -3299,286 +3299,231 @@ const serializeAws_json1_1ActivateEventSourceRequest = ( input: ActivateEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1AwsVpcConfiguration = ( input: AwsVpcConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignPublicIp !== undefined) { - bodyParams["AssignPublicIp"] = input.AssignPublicIp; - } - if (input.SecurityGroups !== undefined) { - bodyParams["SecurityGroups"] = serializeAws_json1_1StringList( - input.SecurityGroups, - context - ); - } - if (input.Subnets !== undefined) { - bodyParams["Subnets"] = serializeAws_json1_1StringList( - input.Subnets, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1BatchArrayProperties = ( input: BatchArrayProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - return bodyParams; + return { + ...(input.Size !== undefined && { Size: input.Size }) + }; }; const serializeAws_json1_1BatchParameters = ( input: BatchParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ArrayProperties !== undefined) { - bodyParams["ArrayProperties"] = serializeAws_json1_1BatchArrayProperties( - input.ArrayProperties, - context - ); - } - if (input.JobDefinition !== undefined) { - bodyParams["JobDefinition"] = input.JobDefinition; - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.RetryStrategy !== undefined) { - bodyParams["RetryStrategy"] = serializeAws_json1_1BatchRetryStrategy( - input.RetryStrategy, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1BatchRetryStrategy = ( input: BatchRetryStrategy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attempts !== undefined) { - bodyParams["Attempts"] = input.Attempts; - } - return bodyParams; + return { + ...(input.Attempts !== undefined && { Attempts: input.Attempts }) + }; }; const serializeAws_json1_1Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1CreateEventBusRequest = ( input: CreateEventBusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventSourceName !== undefined) { - bodyParams["EventSourceName"] = input.EventSourceName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventSourceName !== undefined && { + EventSourceName: input.EventSourceName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreatePartnerEventSourceRequest = ( input: CreatePartnerEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Account !== undefined) { - bodyParams["Account"] = input.Account; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Account !== undefined && { Account: input.Account }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeactivateEventSourceRequest = ( input: DeactivateEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteEventBusRequest = ( input: DeleteEventBusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeletePartnerEventSourceRequest = ( input: DeletePartnerEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Account !== undefined) { - bodyParams["Account"] = input.Account; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Account !== undefined && { Account: input.Account }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteRuleRequest = ( input: DeleteRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Force !== undefined) { - bodyParams["Force"] = input.Force; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Force !== undefined && { Force: input.Force }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeEventBusRequest = ( input: DescribeEventBusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeEventSourceRequest = ( input: DescribeEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribePartnerEventSourceRequest = ( input: DescribePartnerEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeRuleRequest = ( input: DescribeRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DisableRuleRequest = ( input: DisableRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1EcsParameters = ( input: EcsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Group !== undefined) { - bodyParams["Group"] = input.Group; - } - if (input.LaunchType !== undefined) { - bodyParams["LaunchType"] = input.LaunchType; - } - if (input.NetworkConfiguration !== undefined) { - bodyParams[ - "NetworkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.NetworkConfiguration, - context - ); - } - if (input.PlatformVersion !== undefined) { - bodyParams["PlatformVersion"] = input.PlatformVersion; - } - if (input.TaskCount !== undefined) { - bodyParams["TaskCount"] = input.TaskCount; - } - if (input.TaskDefinitionArn !== undefined) { - bodyParams["TaskDefinitionArn"] = input.TaskDefinitionArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EnableRuleRequest = ( input: EnableRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1EventResourceList = ( @@ -3592,224 +3537,173 @@ const serializeAws_json1_1InputTransformer = ( input: InputTransformer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputPathsMap !== undefined) { - bodyParams["InputPathsMap"] = serializeAws_json1_1TransformerPaths( - input.InputPathsMap, - context - ); - } - if (input.InputTemplate !== undefined) { - bodyParams["InputTemplate"] = input.InputTemplate; - } - return bodyParams; + return { + ...(input.InputPathsMap !== undefined && { + InputPathsMap: serializeAws_json1_1TransformerPaths( + input.InputPathsMap, + context + ) + }), + ...(input.InputTemplate !== undefined && { + InputTemplate: input.InputTemplate + }) + }; }; const serializeAws_json1_1KinesisParameters = ( input: KinesisParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PartitionKeyPath !== undefined) { - bodyParams["PartitionKeyPath"] = input.PartitionKeyPath; - } - return bodyParams; + return { + ...(input.PartitionKeyPath !== undefined && { + PartitionKeyPath: input.PartitionKeyPath + }) + }; }; const serializeAws_json1_1ListEventBusesRequest = ( input: ListEventBusesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEventSourcesRequest = ( input: ListEventSourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPartnerEventSourceAccountsRequest = ( input: ListPartnerEventSourceAccountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventSourceName !== undefined) { - bodyParams["EventSourceName"] = input.EventSourceName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.EventSourceName !== undefined && { + EventSourceName: input.EventSourceName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPartnerEventSourcesRequest = ( input: ListPartnerEventSourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListRuleNamesByTargetRequest = ( input: ListRuleNamesByTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TargetArn !== undefined) { - bodyParams["TargetArn"] = input.TargetArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListRulesRequest = ( input: ListRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListTargetsByRuleRequest = ( input: ListTargetsByRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Rule !== undefined) { - bodyParams["Rule"] = input.Rule; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NetworkConfiguration = ( input: NetworkConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsvpcConfiguration !== undefined) { - bodyParams["awsvpcConfiguration"] = serializeAws_json1_1AwsVpcConfiguration( - input.awsvpcConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.awsvpcConfiguration !== undefined && { + awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration( + input.awsvpcConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1PutEventsRequest = ( input: PutEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Entries !== undefined) { - bodyParams["Entries"] = serializeAws_json1_1PutEventsRequestEntryList( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1PutEventsRequestEntryList( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1PutEventsRequestEntry = ( input: PutEventsRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Detail !== undefined) { - bodyParams["Detail"] = input.Detail; - } - if (input.DetailType !== undefined) { - bodyParams["DetailType"] = input.DetailType; - } - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1EventResourceList( - input.Resources, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Time !== undefined) { - bodyParams["Time"] = Math.round(input.Time.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutEventsRequestEntryList = ( @@ -3825,42 +3719,31 @@ const serializeAws_json1_1PutPartnerEventsRequest = ( input: PutPartnerEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Entries !== undefined) { - bodyParams[ - "Entries" - ] = serializeAws_json1_1PutPartnerEventsRequestEntryList( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1PutPartnerEventsRequestEntryList( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1PutPartnerEventsRequestEntry = ( input: PutPartnerEventsRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Detail !== undefined) { - bodyParams["Detail"] = input.Detail; - } - if (input.DetailType !== undefined) { - bodyParams["DetailType"] = input.DetailType; - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1EventResourceList( - input.Resources, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Time !== undefined) { - bodyParams["Time"] = Math.round(input.Time.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutPartnerEventsRequestEntryList = ( @@ -3876,143 +3759,110 @@ const serializeAws_json1_1PutPermissionRequest = ( input: PutPermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Condition !== undefined) { - bodyParams["Condition"] = serializeAws_json1_1Condition( - input.Condition, - context - ); - } - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = input.Principal; - } - if (input.StatementId !== undefined) { - bodyParams["StatementId"] = input.StatementId; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Condition !== undefined && { + Condition: serializeAws_json1_1Condition(input.Condition, context) + }), + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Principal !== undefined && { Principal: input.Principal }), + ...(input.StatementId !== undefined && { StatementId: input.StatementId }) + }; }; const serializeAws_json1_1PutRuleRequest = ( input: PutRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.EventPattern !== undefined) { - bodyParams["EventPattern"] = input.EventPattern; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutTargetsRequest = ( input: PutTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Rule !== undefined) { - bodyParams["Rule"] = input.Rule; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1TargetList( - input.Targets, - context - ); - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Rule !== undefined && { Rule: input.Rule }), + ...(input.Targets !== undefined && { + Targets: serializeAws_json1_1TargetList(input.Targets, context) + }) + }; }; const serializeAws_json1_1RemovePermissionRequest = ( input: RemovePermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.StatementId !== undefined) { - bodyParams["StatementId"] = input.StatementId; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.StatementId !== undefined && { StatementId: input.StatementId }) + }; }; const serializeAws_json1_1RemoveTargetsRequest = ( input: RemoveTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Force !== undefined) { - bodyParams["Force"] = input.Force; - } - if (input.Ids !== undefined) { - bodyParams["Ids"] = serializeAws_json1_1TargetIdList(input.Ids, context); - } - if (input.Rule !== undefined) { - bodyParams["Rule"] = input.Rule; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RunCommandParameters = ( input: RunCommandParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RunCommandTargets !== undefined) { - bodyParams["RunCommandTargets"] = serializeAws_json1_1RunCommandTargets( - input.RunCommandTargets, - context - ); - } - return bodyParams; + return { + ...(input.RunCommandTargets !== undefined && { + RunCommandTargets: serializeAws_json1_1RunCommandTargets( + input.RunCommandTargets, + context + ) + }) + }; }; const serializeAws_json1_1RunCommandTarget = ( input: RunCommandTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1RunCommandTargetValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1RunCommandTargetValues(input.Values, context) + }) + }; }; const serializeAws_json1_1RunCommandTargetValues = ( @@ -4035,11 +3885,11 @@ const serializeAws_json1_1SqsParameters = ( input: SqsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageGroupId !== undefined) { - bodyParams["MessageGroupId"] = input.MessageGroupId; - } - return bodyParams; + return { + ...(input.MessageGroupId !== undefined && { + MessageGroupId: input.MessageGroupId + }) + }; }; const serializeAws_json1_1StringList = ( @@ -4050,14 +3900,10 @@ const serializeAws_json1_1StringList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -4078,75 +3924,61 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1Target = ( input: Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.BatchParameters !== undefined) { - bodyParams["BatchParameters"] = serializeAws_json1_1BatchParameters( - input.BatchParameters, - context - ); - } - if (input.EcsParameters !== undefined) { - bodyParams["EcsParameters"] = serializeAws_json1_1EcsParameters( - input.EcsParameters, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Input !== undefined) { - bodyParams["Input"] = input.Input; - } - if (input.InputPath !== undefined) { - bodyParams["InputPath"] = input.InputPath; - } - if (input.InputTransformer !== undefined) { - bodyParams["InputTransformer"] = serializeAws_json1_1InputTransformer( - input.InputTransformer, - context - ); - } - if (input.KinesisParameters !== undefined) { - bodyParams["KinesisParameters"] = serializeAws_json1_1KinesisParameters( - input.KinesisParameters, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.RunCommandParameters !== undefined) { - bodyParams[ - "RunCommandParameters" - ] = serializeAws_json1_1RunCommandParameters( - input.RunCommandParameters, - context - ); - } - if (input.SqsParameters !== undefined) { - bodyParams["SqsParameters"] = serializeAws_json1_1SqsParameters( - input.SqsParameters, - context - ); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.BatchParameters !== undefined && { + BatchParameters: serializeAws_json1_1BatchParameters( + input.BatchParameters, + context + ) + }), + ...(input.EcsParameters !== undefined && { + EcsParameters: serializeAws_json1_1EcsParameters( + input.EcsParameters, + 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.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 + ) + }) + }; }; const serializeAws_json1_1TargetIdList = ( @@ -4167,14 +3999,12 @@ const serializeAws_json1_1TestEventPatternRequest = ( input: TestEventPatternRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Event !== undefined) { - bodyParams["Event"] = input.Event; - } - if (input.EventPattern !== undefined) { - bodyParams["EventPattern"] = input.EventPattern; - } - return bodyParams; + return { + ...(input.Event !== undefined && { Event: input.Event }), + ...(input.EventPattern !== undefined && { + EventPattern: input.EventPattern + }) + }; }; const serializeAws_json1_1TransformerPaths = ( @@ -4191,17 +4021,12 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const deserializeAws_json1_1AwsVpcConfiguration = ( diff --git a/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts b/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts index 6e8f1ede9409..030b7b8daacb 100644 --- a/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts +++ b/clients/client-cloudwatch-logs/protocols/Aws_json1_1.ts @@ -4415,459 +4415,369 @@ const serializeAws_json1_1AssociateKmsKeyRequest = ( input: AssociateKmsKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.kmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.kmsKeyId; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1CancelExportTaskRequest = ( input: CancelExportTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.taskId !== undefined) { - bodyParams["taskId"] = input.taskId; - } - return bodyParams; + return { + ...(input.taskId !== undefined && { taskId: input.taskId }) + }; }; const serializeAws_json1_1CreateExportTaskRequest = ( input: CreateExportTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destination !== undefined) { - bodyParams["destination"] = input.destination; - } - if (input.destinationPrefix !== undefined) { - bodyParams["destinationPrefix"] = input.destinationPrefix; - } - if (input.from !== undefined) { - bodyParams["from"] = input.from; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamNamePrefix !== undefined) { - bodyParams["logStreamNamePrefix"] = input.logStreamNamePrefix; - } - if (input.taskName !== undefined) { - bodyParams["taskName"] = input.taskName; - } - if (input.to !== undefined) { - bodyParams["to"] = input.to; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateLogGroupRequest = ( input: CreateLogGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.kmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.kmsKeyId; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + return { + ...(input.kmsKeyId !== undefined && { kmsKeyId: input.kmsKeyId }), + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1Tags(input.tags, context) + }) + }; }; const serializeAws_json1_1CreateLogStreamRequest = ( input: CreateLogStreamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamName !== undefined) { - bodyParams["logStreamName"] = input.logStreamName; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.logStreamName !== undefined && { + logStreamName: input.logStreamName + }) + }; }; const serializeAws_json1_1DeleteDestinationRequest = ( input: DeleteDestinationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destinationName !== undefined) { - bodyParams["destinationName"] = input.destinationName; - } - return bodyParams; + return { + ...(input.destinationName !== undefined && { + destinationName: input.destinationName + }) + }; }; const serializeAws_json1_1DeleteLogGroupRequest = ( input: DeleteLogGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1DeleteLogStreamRequest = ( input: DeleteLogStreamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamName !== undefined) { - bodyParams["logStreamName"] = input.logStreamName; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.logStreamName !== undefined && { + logStreamName: input.logStreamName + }) + }; }; const serializeAws_json1_1DeleteMetricFilterRequest = ( input: DeleteMetricFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filterName !== undefined) { - bodyParams["filterName"] = input.filterName; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.filterName !== undefined && { filterName: input.filterName }), + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1DeleteResourcePolicyRequest = ( input: DeleteResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.policyName !== undefined) { - bodyParams["policyName"] = input.policyName; - } - return bodyParams; + return { + ...(input.policyName !== undefined && { policyName: input.policyName }) + }; }; const serializeAws_json1_1DeleteRetentionPolicyRequest = ( input: DeleteRetentionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1DeleteSubscriptionFilterRequest = ( input: DeleteSubscriptionFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filterName !== undefined) { - bodyParams["filterName"] = input.filterName; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.filterName !== undefined && { filterName: input.filterName }), + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1DescribeDestinationsRequest = ( input: DescribeDestinationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationNamePrefix !== undefined) { - bodyParams["DestinationNamePrefix"] = input.DestinationNamePrefix; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.DestinationNamePrefix !== undefined && { + DestinationNamePrefix: input.DestinationNamePrefix + }), + ...(input.limit !== undefined && { limit: input.limit }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeExportTasksRequest = ( input: DescribeExportTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.statusCode !== undefined) { - bodyParams["statusCode"] = input.statusCode; - } - if (input.taskId !== undefined) { - bodyParams["taskId"] = input.taskId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeLogGroupsRequest = ( input: DescribeLogGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupNamePrefix !== undefined) { - bodyParams["logGroupNamePrefix"] = input.logGroupNamePrefix; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.limit !== undefined && { limit: input.limit }), + ...(input.logGroupNamePrefix !== undefined && { + logGroupNamePrefix: input.logGroupNamePrefix + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeLogStreamsRequest = ( input: DescribeLogStreamsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.descending !== undefined) { - bodyParams["descending"] = input.descending; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamNamePrefix !== undefined) { - bodyParams["logStreamNamePrefix"] = input.logStreamNamePrefix; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.orderBy !== undefined) { - bodyParams["orderBy"] = input.orderBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMetricFiltersRequest = ( input: DescribeMetricFiltersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filterNamePrefix !== undefined) { - bodyParams["filterNamePrefix"] = input.filterNamePrefix; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.metricNamespace !== undefined) { - bodyParams["metricNamespace"] = input.metricNamespace; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeQueriesRequest = ( input: DescribeQueriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeResourcePoliciesRequest = ( input: DescribeResourcePoliciesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.limit !== undefined && { limit: input.limit }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeSubscriptionFiltersRequest = ( input: DescribeSubscriptionFiltersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filterNamePrefix !== undefined) { - bodyParams["filterNamePrefix"] = input.filterNamePrefix; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DisassociateKmsKeyRequest = ( input: DisassociateKmsKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1FilterLogEventsRequest = ( input: FilterLogEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = input.endTime; - } - if (input.filterPattern !== undefined) { - bodyParams["filterPattern"] = input.filterPattern; - } - if (input.interleaved !== undefined) { - bodyParams["interleaved"] = input.interleaved; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamNamePrefix !== undefined) { - bodyParams["logStreamNamePrefix"] = input.logStreamNamePrefix; - } - if (input.logStreamNames !== undefined) { - bodyParams["logStreamNames"] = serializeAws_json1_1InputLogStreamNames( - input.logStreamNames, - context - ); - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = input.startTime; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetLogEventsRequest = ( input: GetLogEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = input.endTime; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamName !== undefined) { - bodyParams["logStreamName"] = input.logStreamName; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.startFromHead !== undefined) { - bodyParams["startFromHead"] = input.startFromHead; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = input.startTime; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetLogGroupFieldsRequest = ( input: GetLogGroupFieldsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.time !== undefined) { - bodyParams["time"] = input.time; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.time !== undefined && { time: input.time }) + }; }; const serializeAws_json1_1GetLogRecordRequest = ( input: GetLogRecordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logRecordPointer !== undefined) { - bodyParams["logRecordPointer"] = input.logRecordPointer; - } - return bodyParams; + return { + ...(input.logRecordPointer !== undefined && { + logRecordPointer: input.logRecordPointer + }) + }; }; const serializeAws_json1_1GetQueryResultsRequest = ( input: GetQueryResultsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.queryId !== undefined) { - bodyParams["queryId"] = input.queryId; - } - return bodyParams; + return { + ...(input.queryId !== undefined && { queryId: input.queryId }) + }; }; const serializeAws_json1_1InputLogEvent = ( input: InputLogEvent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.message !== undefined) { - bodyParams["message"] = input.message; - } - if (input.timestamp !== undefined) { - bodyParams["timestamp"] = input.timestamp; - } - return bodyParams; + return { + ...(input.message !== undefined && { message: input.message }), + ...(input.timestamp !== undefined && { timestamp: input.timestamp }) + }; }; const serializeAws_json1_1InputLogEvents = ( @@ -4888,11 +4798,11 @@ const serializeAws_json1_1ListTagsLogGroupRequest = ( input: ListTagsLogGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }) + }; }; const serializeAws_json1_1LogGroupNames = ( @@ -4906,20 +4816,16 @@ const serializeAws_json1_1MetricTransformation = ( input: MetricTransformation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultValue !== undefined) { - bodyParams["defaultValue"] = input.defaultValue; - } - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.metricNamespace !== undefined) { - bodyParams["metricNamespace"] = input.metricNamespace; - } - if (input.metricValue !== undefined) { - bodyParams["metricValue"] = input.metricValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1MetricTransformations = ( @@ -4935,173 +4841,146 @@ const serializeAws_json1_1PutDestinationPolicyRequest = ( input: PutDestinationPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.accessPolicy !== undefined) { - bodyParams["accessPolicy"] = input.accessPolicy; - } - if (input.destinationName !== undefined) { - bodyParams["destinationName"] = input.destinationName; - } - return bodyParams; + return { + ...(input.accessPolicy !== undefined && { + accessPolicy: input.accessPolicy + }), + ...(input.destinationName !== undefined && { + destinationName: input.destinationName + }) + }; }; const serializeAws_json1_1PutDestinationRequest = ( input: PutDestinationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destinationName !== undefined) { - bodyParams["destinationName"] = input.destinationName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.targetArn !== undefined) { - bodyParams["targetArn"] = input.targetArn; - } - return bodyParams; + return { + ...(input.destinationName !== undefined && { + destinationName: input.destinationName + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.targetArn !== undefined && { targetArn: input.targetArn }) + }; }; const serializeAws_json1_1PutLogEventsRequest = ( input: PutLogEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logEvents !== undefined) { - bodyParams["logEvents"] = serializeAws_json1_1InputLogEvents( - input.logEvents, - context - ); - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logStreamName !== undefined) { - bodyParams["logStreamName"] = input.logStreamName; - } - if (input.sequenceToken !== undefined) { - bodyParams["sequenceToken"] = input.sequenceToken; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1PutMetricFilterRequest = ( input: PutMetricFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filterName !== undefined) { - bodyParams["filterName"] = input.filterName; - } - if (input.filterPattern !== undefined) { - bodyParams["filterPattern"] = input.filterPattern; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.metricTransformations !== undefined) { - bodyParams[ - "metricTransformations" - ] = serializeAws_json1_1MetricTransformations( - input.metricTransformations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutResourcePolicyRequest = ( input: PutResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.policyDocument !== undefined) { - bodyParams["policyDocument"] = input.policyDocument; - } - if (input.policyName !== undefined) { - bodyParams["policyName"] = input.policyName; - } - return bodyParams; + return { + ...(input.policyDocument !== undefined && { + policyDocument: input.policyDocument + }), + ...(input.policyName !== undefined && { policyName: input.policyName }) + }; }; const serializeAws_json1_1PutRetentionPolicyRequest = ( input: PutRetentionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.retentionInDays !== undefined) { - bodyParams["retentionInDays"] = input.retentionInDays; - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.retentionInDays !== undefined && { + retentionInDays: input.retentionInDays + }) + }; }; const serializeAws_json1_1PutSubscriptionFilterRequest = ( input: PutSubscriptionFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destinationArn !== undefined) { - bodyParams["destinationArn"] = input.destinationArn; - } - if (input.distribution !== undefined) { - bodyParams["distribution"] = input.distribution; - } - if (input.filterName !== undefined) { - bodyParams["filterName"] = input.filterName; - } - if (input.filterPattern !== undefined) { - bodyParams["filterPattern"] = input.filterPattern; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartQueryRequest = ( input: StartQueryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = input.endTime; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.logGroupNames !== undefined) { - bodyParams["logGroupNames"] = serializeAws_json1_1LogGroupNames( - input.logGroupNames, - context - ); - } - if (input.queryString !== undefined) { - bodyParams["queryString"] = input.queryString; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = input.startTime; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StopQueryRequest = ( input: StopQueryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.queryId !== undefined) { - bodyParams["queryId"] = input.queryId; - } - return bodyParams; + return { + ...(input.queryId !== undefined && { queryId: input.queryId }) + }; }; const serializeAws_json1_1TagList = ( @@ -5115,14 +4994,14 @@ const serializeAws_json1_1TagLogGroupRequest = ( input: TagLogGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1Tags(input.tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -5146,31 +5025,31 @@ const serializeAws_json1_1TestMetricFilterRequest = ( input: TestMetricFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filterPattern !== undefined) { - bodyParams["filterPattern"] = input.filterPattern; - } - if (input.logEventMessages !== undefined) { - bodyParams["logEventMessages"] = serializeAws_json1_1TestEventMessages( - input.logEventMessages, - context - ); - } - return bodyParams; + return { + ...(input.filterPattern !== undefined && { + filterPattern: input.filterPattern + }), + ...(input.logEventMessages !== undefined && { + logEventMessages: serializeAws_json1_1TestEventMessages( + input.logEventMessages, + context + ) + }) + }; }; const serializeAws_json1_1UntagLogGroupRequest = ( input: UntagLogGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupName !== undefined) { - bodyParams["logGroupName"] = input.logGroupName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.logGroupName !== undefined && { + logGroupName: input.logGroupName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const deserializeAws_json1_1CreateExportTaskResponse = ( diff --git a/clients/client-codebuild/protocols/Aws_json1_1.ts b/clients/client-codebuild/protocols/Aws_json1_1.ts index 7ea873a3195c..efa5c3584211 100644 --- a/clients/client-codebuild/protocols/Aws_json1_1.ts +++ b/clients/client-codebuild/protocols/Aws_json1_1.ts @@ -3173,64 +3173,58 @@ const serializeAws_json1_1BatchDeleteBuildsInput = ( input: BatchDeleteBuildsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ids !== undefined) { - bodyParams["ids"] = serializeAws_json1_1BuildIds(input.ids, context); - } - return bodyParams; + return { + ...(input.ids !== undefined && { + ids: serializeAws_json1_1BuildIds(input.ids, context) + }) + }; }; const serializeAws_json1_1BatchGetBuildsInput = ( input: BatchGetBuildsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ids !== undefined) { - bodyParams["ids"] = serializeAws_json1_1BuildIds(input.ids, context); - } - return bodyParams; + return { + ...(input.ids !== undefined && { + ids: serializeAws_json1_1BuildIds(input.ids, context) + }) + }; }; const serializeAws_json1_1BatchGetProjectsInput = ( input: BatchGetProjectsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.names !== undefined) { - bodyParams["names"] = serializeAws_json1_1ProjectNames( - input.names, - context - ); - } - return bodyParams; + return { + ...(input.names !== undefined && { + names: serializeAws_json1_1ProjectNames(input.names, context) + }) + }; }; const serializeAws_json1_1BatchGetReportGroupsInput = ( input: BatchGetReportGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.reportGroupArns !== undefined) { - bodyParams["reportGroupArns"] = serializeAws_json1_1ReportGroupArns( - input.reportGroupArns, - context - ); - } - return bodyParams; + return { + ...(input.reportGroupArns !== undefined && { + reportGroupArns: serializeAws_json1_1ReportGroupArns( + input.reportGroupArns, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetReportsInput = ( input: BatchGetReportsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.reportArns !== undefined) { - bodyParams["reportArns"] = serializeAws_json1_1ReportArns( - input.reportArns, - context - ); - } - return bodyParams; + return { + ...(input.reportArns !== undefined && { + reportArns: serializeAws_json1_1ReportArns(input.reportArns, context) + }) + }; }; const serializeAws_json1_1BuildIds = ( @@ -3244,254 +3238,192 @@ const serializeAws_json1_1CloudWatchLogsConfig = ( input: CloudWatchLogsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.groupName !== undefined) { - bodyParams["groupName"] = input.groupName; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - if (input.streamName !== undefined) { - bodyParams["streamName"] = input.streamName; - } - return bodyParams; + return { + ...(input.groupName !== undefined && { groupName: input.groupName }), + ...(input.status !== undefined && { status: input.status }), + ...(input.streamName !== undefined && { streamName: input.streamName }) + }; }; const serializeAws_json1_1CreateProjectInput = ( input: CreateProjectInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.artifacts !== undefined) { - bodyParams["artifacts"] = serializeAws_json1_1ProjectArtifacts( - input.artifacts, - context - ); - } - if (input.badgeEnabled !== undefined) { - bodyParams["badgeEnabled"] = input.badgeEnabled; - } - if (input.cache !== undefined) { - bodyParams["cache"] = serializeAws_json1_1ProjectCache( - input.cache, - context - ); - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.encryptionKey !== undefined) { - bodyParams["encryptionKey"] = input.encryptionKey; - } - if (input.environment !== undefined) { - bodyParams["environment"] = serializeAws_json1_1ProjectEnvironment( - input.environment, - context - ); - } - if (input.logsConfig !== undefined) { - bodyParams["logsConfig"] = serializeAws_json1_1LogsConfig( - input.logsConfig, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.queuedTimeoutInMinutes !== undefined) { - bodyParams["queuedTimeoutInMinutes"] = input.queuedTimeoutInMinutes; - } - if (input.secondaryArtifacts !== undefined) { - bodyParams["secondaryArtifacts"] = serializeAws_json1_1ProjectArtifactsList( - input.secondaryArtifacts, - context - ); - } - if (input.secondarySourceVersions !== undefined) { - bodyParams[ - "secondarySourceVersions" - ] = serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourceVersions, - context - ); - } - if (input.secondarySources !== undefined) { - bodyParams["secondarySources"] = serializeAws_json1_1ProjectSources( - input.secondarySources, - context - ); - } - if (input.serviceRole !== undefined) { - bodyParams["serviceRole"] = input.serviceRole; - } - if (input.source !== undefined) { - bodyParams["source"] = serializeAws_json1_1ProjectSource( - input.source, - context - ); - } - if (input.sourceVersion !== undefined) { - bodyParams["sourceVersion"] = input.sourceVersion; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.timeoutInMinutes !== undefined) { - bodyParams["timeoutInMinutes"] = input.timeoutInMinutes; - } - if (input.vpcConfig !== undefined) { - bodyParams["vpcConfig"] = serializeAws_json1_1VpcConfig( - input.vpcConfig, - context - ); - } - return bodyParams; + return { + ...(input.artifacts !== undefined && { + artifacts: serializeAws_json1_1ProjectArtifacts(input.artifacts, context) + }), + ...(input.badgeEnabled !== undefined && { + badgeEnabled: input.badgeEnabled + }), + ...(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.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) + }) + }; }; const serializeAws_json1_1CreateReportGroupInput = ( input: CreateReportGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exportConfig !== undefined) { - bodyParams["exportConfig"] = serializeAws_json1_1ReportExportConfig( - input.exportConfig, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.exportConfig !== undefined && { + exportConfig: serializeAws_json1_1ReportExportConfig( + input.exportConfig, + context + ) + }), + ...(input.name !== undefined && { name: input.name }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1CreateWebhookInput = ( input: CreateWebhookInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchFilter !== undefined) { - bodyParams["branchFilter"] = input.branchFilter; - } - if (input.filterGroups !== undefined) { - bodyParams["filterGroups"] = serializeAws_json1_1FilterGroups( - input.filterGroups, - context - ); - } - if (input.projectName !== undefined) { - bodyParams["projectName"] = input.projectName; - } - return bodyParams; + return { + ...(input.branchFilter !== undefined && { + branchFilter: input.branchFilter + }), + ...(input.filterGroups !== undefined && { + filterGroups: serializeAws_json1_1FilterGroups( + input.filterGroups, + context + ) + }), + ...(input.projectName !== undefined && { projectName: input.projectName }) + }; }; const serializeAws_json1_1DeleteProjectInput = ( input: DeleteProjectInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1DeleteReportGroupInput = ( input: DeleteReportGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteReportInput = ( input: DeleteReportInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteResourcePolicyInput = ( input: DeleteResourcePolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1DeleteSourceCredentialsInput = ( input: DeleteSourceCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteWebhookInput = ( input: DeleteWebhookInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectName !== undefined) { - bodyParams["projectName"] = input.projectName; - } - return bodyParams; + return { + ...(input.projectName !== undefined && { projectName: input.projectName }) + }; }; const serializeAws_json1_1DescribeTestCasesInput = ( input: DescribeTestCasesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1TestCaseFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.reportArn !== undefined) { - bodyParams["reportArn"] = input.reportArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EnvironmentVariable = ( input: EnvironmentVariable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.type !== undefined && { type: input.type }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1EnvironmentVariables = ( @@ -3521,284 +3453,199 @@ const serializeAws_json1_1GetResourcePolicyInput = ( input: GetResourcePolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1GitSubmodulesConfig = ( input: GitSubmodulesConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fetchSubmodules !== undefined) { - bodyParams["fetchSubmodules"] = input.fetchSubmodules; - } - return bodyParams; + return { + ...(input.fetchSubmodules !== undefined && { + fetchSubmodules: input.fetchSubmodules + }) + }; }; const serializeAws_json1_1ImportSourceCredentialsInput = ( input: ImportSourceCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authType !== undefined) { - bodyParams["authType"] = input.authType; - } - if (input.serverType !== undefined) { - bodyParams["serverType"] = input.serverType; - } - if (input.shouldOverwrite !== undefined) { - bodyParams["shouldOverwrite"] = input.shouldOverwrite; - } - if (input.token !== undefined) { - bodyParams["token"] = input.token; - } - if (input.username !== undefined) { - bodyParams["username"] = input.username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1InvalidateProjectCacheInput = ( input: InvalidateProjectCacheInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectName !== undefined) { - bodyParams["projectName"] = input.projectName; - } - return bodyParams; + return { + ...(input.projectName !== undefined && { projectName: input.projectName }) + }; }; const serializeAws_json1_1ListBuildsForProjectInput = ( input: ListBuildsForProjectInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.projectName !== undefined) { - bodyParams["projectName"] = input.projectName; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.projectName !== undefined && { projectName: input.projectName }), + ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }) + }; }; const serializeAws_json1_1ListBuildsInput = ( input: ListBuildsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }) + }; }; const serializeAws_json1_1ListCuratedEnvironmentImagesInput = ( input: ListCuratedEnvironmentImagesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ListProjectsInput = ( input: ListProjectsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sortBy !== undefined) { - bodyParams["sortBy"] = input.sortBy; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.sortBy !== undefined && { sortBy: input.sortBy }), + ...(input.sortOrder !== undefined && { sortOrder: input.sortOrder }) + }; }; const serializeAws_json1_1ListReportGroupsInput = ( input: ListReportGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sortBy !== undefined) { - bodyParams["sortBy"] = input.sortBy; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListReportsForReportGroupInput = ( input: ListReportsForReportGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1ReportFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.reportGroupArn !== undefined) { - bodyParams["reportGroupArn"] = input.reportGroupArn; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListReportsInput = ( input: ListReportsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1ReportFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListSharedProjectsInput = ( input: ListSharedProjectsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sortBy !== undefined) { - bodyParams["sortBy"] = input.sortBy; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListSharedReportGroupsInput = ( input: ListSharedReportGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sortBy !== undefined) { - bodyParams["sortBy"] = input.sortBy; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListSourceCredentialsInput = ( input: ListSourceCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1LogsConfig = ( input: LogsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cloudWatchLogs !== undefined) { - bodyParams["cloudWatchLogs"] = serializeAws_json1_1CloudWatchLogsConfig( - input.cloudWatchLogs, - context - ); - } - if (input.s3Logs !== undefined) { - bodyParams["s3Logs"] = serializeAws_json1_1S3LogsConfig( - input.s3Logs, - context - ); - } - return bodyParams; + return { + ...(input.cloudWatchLogs !== undefined && { + cloudWatchLogs: serializeAws_json1_1CloudWatchLogsConfig( + input.cloudWatchLogs, + context + ) + }), + ...(input.s3Logs !== undefined && { + s3Logs: serializeAws_json1_1S3LogsConfig(input.s3Logs, context) + }) + }; }; const serializeAws_json1_1ProjectArtifacts = ( input: ProjectArtifacts, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.artifactIdentifier !== undefined) { - bodyParams["artifactIdentifier"] = input.artifactIdentifier; - } - if (input.encryptionDisabled !== undefined) { - bodyParams["encryptionDisabled"] = input.encryptionDisabled; - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.namespaceType !== undefined) { - bodyParams["namespaceType"] = input.namespaceType; - } - if (input.overrideArtifactName !== undefined) { - bodyParams["overrideArtifactName"] = input.overrideArtifactName; - } - if (input.packaging !== undefined) { - bodyParams["packaging"] = input.packaging; - } - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ProjectArtifactsList = ( @@ -3814,20 +3661,13 @@ const serializeAws_json1_1ProjectCache = ( input: ProjectCache, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.modes !== undefined) { - bodyParams["modes"] = serializeAws_json1_1ProjectCacheModes( - input.modes, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.location !== undefined && { location: input.location }), + ...(input.modes !== undefined && { + modes: serializeAws_json1_1ProjectCacheModes(input.modes, context) + }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ProjectCacheModes = ( @@ -3841,40 +3681,30 @@ const serializeAws_json1_1ProjectEnvironment = ( input: ProjectEnvironment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificate !== undefined) { - bodyParams["certificate"] = input.certificate; - } - if (input.computeType !== undefined) { - bodyParams["computeType"] = input.computeType; - } - if (input.environmentVariables !== undefined) { - bodyParams[ - "environmentVariables" - ] = serializeAws_json1_1EnvironmentVariables( - input.environmentVariables, - context - ); - } - if (input.image !== undefined) { - bodyParams["image"] = input.image; - } - if (input.imagePullCredentialsType !== undefined) { - bodyParams["imagePullCredentialsType"] = input.imagePullCredentialsType; - } - if (input.privilegedMode !== undefined) { - bodyParams["privilegedMode"] = input.privilegedMode; - } - if (input.registryCredential !== undefined) { - bodyParams["registryCredential"] = serializeAws_json1_1RegistryCredential( - input.registryCredential, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ProjectNames = ( @@ -3897,52 +3727,44 @@ const serializeAws_json1_1ProjectSource = ( input: ProjectSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.auth !== undefined) { - bodyParams["auth"] = serializeAws_json1_1SourceAuth(input.auth, context); - } - if (input.buildspec !== undefined) { - bodyParams["buildspec"] = input.buildspec; - } - if (input.gitCloneDepth !== undefined) { - bodyParams["gitCloneDepth"] = input.gitCloneDepth; - } - if (input.gitSubmodulesConfig !== undefined) { - bodyParams["gitSubmodulesConfig"] = serializeAws_json1_1GitSubmodulesConfig( - input.gitSubmodulesConfig, - context - ); - } - if (input.insecureSsl !== undefined) { - bodyParams["insecureSsl"] = input.insecureSsl; - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.reportBuildStatus !== undefined) { - bodyParams["reportBuildStatus"] = input.reportBuildStatus; - } - if (input.sourceIdentifier !== undefined) { - bodyParams["sourceIdentifier"] = input.sourceIdentifier; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.auth !== undefined && { + auth: serializeAws_json1_1SourceAuth(input.auth, 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 }) + }; }; const serializeAws_json1_1ProjectSourceVersion = ( input: ProjectSourceVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.sourceIdentifier !== undefined) { - bodyParams["sourceIdentifier"] = input.sourceIdentifier; - } - if (input.sourceVersion !== undefined) { - bodyParams["sourceVersion"] = input.sourceVersion; - } - return bodyParams; + return { + ...(input.sourceIdentifier !== undefined && { + sourceIdentifier: input.sourceIdentifier + }), + ...(input.sourceVersion !== undefined && { + sourceVersion: input.sourceVersion + }) + }; }; const serializeAws_json1_1ProjectSources = ( @@ -3956,28 +3778,22 @@ const serializeAws_json1_1PutResourcePolicyInput = ( input: PutResourcePolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.policy !== undefined) { - bodyParams["policy"] = input.policy; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.policy !== undefined && { policy: input.policy }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1RegistryCredential = ( input: RegistryCredential, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.credential !== undefined) { - bodyParams["credential"] = input.credential; - } - if (input.credentialProvider !== undefined) { - bodyParams["credentialProvider"] = input.credentialProvider; - } - return bodyParams; + return { + ...(input.credential !== undefined && { credential: input.credential }), + ...(input.credentialProvider !== undefined && { + credentialProvider: input.credentialProvider + }) + }; }; const serializeAws_json1_1ReportArns = ( @@ -3991,28 +3807,26 @@ const serializeAws_json1_1ReportExportConfig = ( input: ReportExportConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exportConfigType !== undefined) { - bodyParams["exportConfigType"] = input.exportConfigType; - } - if (input.s3Destination !== undefined) { - bodyParams["s3Destination"] = serializeAws_json1_1S3ReportExportConfig( - input.s3Destination, - context - ); - } - return bodyParams; + return { + ...(input.exportConfigType !== undefined && { + exportConfigType: input.exportConfigType + }), + ...(input.s3Destination !== undefined && { + s3Destination: serializeAws_json1_1S3ReportExportConfig( + input.s3Destination, + context + ) + }) + }; }; const serializeAws_json1_1ReportFilter = ( input: ReportFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1ReportGroupArns = ( @@ -4026,40 +3840,30 @@ const serializeAws_json1_1S3LogsConfig = ( input: S3LogsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.encryptionDisabled !== undefined) { - bodyParams["encryptionDisabled"] = input.encryptionDisabled; - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.encryptionDisabled !== undefined && { + encryptionDisabled: input.encryptionDisabled + }), + ...(input.location !== undefined && { location: input.location }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1S3ReportExportConfig = ( input: S3ReportExportConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.encryptionDisabled !== undefined) { - bodyParams["encryptionDisabled"] = input.encryptionDisabled; - } - if (input.encryptionKey !== undefined) { - bodyParams["encryptionKey"] = input.encryptionKey; - } - if (input.packaging !== undefined) { - bodyParams["packaging"] = input.packaging; - } - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SecurityGroupIds = ( @@ -4073,162 +3877,142 @@ const serializeAws_json1_1SourceAuth = ( input: SourceAuth, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resource !== undefined) { - bodyParams["resource"] = input.resource; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.resource !== undefined && { resource: input.resource }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1StartBuildInput = ( input: StartBuildInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.artifactsOverride !== undefined) { - bodyParams["artifactsOverride"] = serializeAws_json1_1ProjectArtifacts( - input.artifactsOverride, - context - ); - } - if (input.buildspecOverride !== undefined) { - bodyParams["buildspecOverride"] = input.buildspecOverride; - } - if (input.cacheOverride !== undefined) { - bodyParams["cacheOverride"] = serializeAws_json1_1ProjectCache( - input.cacheOverride, - context - ); - } - if (input.certificateOverride !== undefined) { - bodyParams["certificateOverride"] = input.certificateOverride; - } - if (input.computeTypeOverride !== undefined) { - bodyParams["computeTypeOverride"] = input.computeTypeOverride; - } - if (input.encryptionKeyOverride !== undefined) { - bodyParams["encryptionKeyOverride"] = input.encryptionKeyOverride; - } - if (input.environmentTypeOverride !== undefined) { - bodyParams["environmentTypeOverride"] = input.environmentTypeOverride; - } - if (input.environmentVariablesOverride !== undefined) { - bodyParams[ - "environmentVariablesOverride" - ] = serializeAws_json1_1EnvironmentVariables( - input.environmentVariablesOverride, - context - ); - } - if (input.gitCloneDepthOverride !== undefined) { - bodyParams["gitCloneDepthOverride"] = input.gitCloneDepthOverride; - } - if (input.gitSubmodulesConfigOverride !== undefined) { - bodyParams[ - "gitSubmodulesConfigOverride" - ] = serializeAws_json1_1GitSubmodulesConfig( - input.gitSubmodulesConfigOverride, - context - ); - } - if (input.idempotencyToken !== undefined) { - bodyParams["idempotencyToken"] = input.idempotencyToken; - } - if (input.imageOverride !== undefined) { - bodyParams["imageOverride"] = input.imageOverride; - } - if (input.imagePullCredentialsTypeOverride !== undefined) { - bodyParams["imagePullCredentialsTypeOverride"] = - input.imagePullCredentialsTypeOverride; - } - if (input.insecureSslOverride !== undefined) { - bodyParams["insecureSslOverride"] = input.insecureSslOverride; - } - if (input.logsConfigOverride !== undefined) { - bodyParams["logsConfigOverride"] = serializeAws_json1_1LogsConfig( - input.logsConfigOverride, - context - ); - } - if (input.privilegedModeOverride !== undefined) { - bodyParams["privilegedModeOverride"] = input.privilegedModeOverride; - } - if (input.projectName !== undefined) { - bodyParams["projectName"] = input.projectName; - } - if (input.queuedTimeoutInMinutesOverride !== undefined) { - bodyParams["queuedTimeoutInMinutesOverride"] = - input.queuedTimeoutInMinutesOverride; - } - if (input.registryCredentialOverride !== undefined) { - bodyParams[ - "registryCredentialOverride" - ] = serializeAws_json1_1RegistryCredential( - input.registryCredentialOverride, - context - ); - } - if (input.reportBuildStatusOverride !== undefined) { - bodyParams["reportBuildStatusOverride"] = input.reportBuildStatusOverride; - } - if (input.secondaryArtifactsOverride !== undefined) { - bodyParams[ - "secondaryArtifactsOverride" - ] = serializeAws_json1_1ProjectArtifactsList( - input.secondaryArtifactsOverride, - context - ); - } - if (input.secondarySourcesOverride !== undefined) { - bodyParams["secondarySourcesOverride"] = serializeAws_json1_1ProjectSources( - input.secondarySourcesOverride, - context - ); - } - if (input.secondarySourcesVersionOverride !== undefined) { - bodyParams[ - "secondarySourcesVersionOverride" - ] = serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourcesVersionOverride, - context - ); - } - if (input.serviceRoleOverride !== undefined) { - bodyParams["serviceRoleOverride"] = input.serviceRoleOverride; - } - if (input.sourceAuthOverride !== undefined) { - bodyParams["sourceAuthOverride"] = serializeAws_json1_1SourceAuth( - input.sourceAuthOverride, - context - ); - } - if (input.sourceLocationOverride !== undefined) { - bodyParams["sourceLocationOverride"] = input.sourceLocationOverride; - } - if (input.sourceTypeOverride !== undefined) { - bodyParams["sourceTypeOverride"] = input.sourceTypeOverride; - } - if (input.sourceVersion !== undefined) { - bodyParams["sourceVersion"] = input.sourceVersion; - } - if (input.timeoutInMinutesOverride !== undefined) { - bodyParams["timeoutInMinutesOverride"] = input.timeoutInMinutesOverride; - } - return bodyParams; + return { + ...(input.artifactsOverride !== undefined && { + artifactsOverride: serializeAws_json1_1ProjectArtifacts( + input.artifactsOverride, + 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.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 + }) + }; }; const serializeAws_json1_1StopBuildInput = ( input: StopBuildInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1Subnets = ( @@ -4239,14 +4023,10 @@ const serializeAws_json1_1Subnets = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagList = ( @@ -4260,179 +4040,144 @@ const serializeAws_json1_1TestCaseFilter = ( input: TestCaseFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1UpdateProjectInput = ( input: UpdateProjectInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.artifacts !== undefined) { - bodyParams["artifacts"] = serializeAws_json1_1ProjectArtifacts( - input.artifacts, - context - ); - } - if (input.badgeEnabled !== undefined) { - bodyParams["badgeEnabled"] = input.badgeEnabled; - } - if (input.cache !== undefined) { - bodyParams["cache"] = serializeAws_json1_1ProjectCache( - input.cache, - context - ); - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.encryptionKey !== undefined) { - bodyParams["encryptionKey"] = input.encryptionKey; - } - if (input.environment !== undefined) { - bodyParams["environment"] = serializeAws_json1_1ProjectEnvironment( - input.environment, - context - ); - } - if (input.logsConfig !== undefined) { - bodyParams["logsConfig"] = serializeAws_json1_1LogsConfig( - input.logsConfig, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.queuedTimeoutInMinutes !== undefined) { - bodyParams["queuedTimeoutInMinutes"] = input.queuedTimeoutInMinutes; - } - if (input.secondaryArtifacts !== undefined) { - bodyParams["secondaryArtifacts"] = serializeAws_json1_1ProjectArtifactsList( - input.secondaryArtifacts, - context - ); - } - if (input.secondarySourceVersions !== undefined) { - bodyParams[ - "secondarySourceVersions" - ] = serializeAws_json1_1ProjectSecondarySourceVersions( - input.secondarySourceVersions, - context - ); - } - if (input.secondarySources !== undefined) { - bodyParams["secondarySources"] = serializeAws_json1_1ProjectSources( - input.secondarySources, - context - ); - } - if (input.serviceRole !== undefined) { - bodyParams["serviceRole"] = input.serviceRole; - } - if (input.source !== undefined) { - bodyParams["source"] = serializeAws_json1_1ProjectSource( - input.source, - context - ); - } - if (input.sourceVersion !== undefined) { - bodyParams["sourceVersion"] = input.sourceVersion; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.timeoutInMinutes !== undefined) { - bodyParams["timeoutInMinutes"] = input.timeoutInMinutes; - } - if (input.vpcConfig !== undefined) { - bodyParams["vpcConfig"] = serializeAws_json1_1VpcConfig( - input.vpcConfig, - context - ); - } - return bodyParams; + return { + ...(input.artifacts !== undefined && { + artifacts: serializeAws_json1_1ProjectArtifacts(input.artifacts, context) + }), + ...(input.badgeEnabled !== undefined && { + badgeEnabled: input.badgeEnabled + }), + ...(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.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) + }) + }; }; const serializeAws_json1_1UpdateReportGroupInput = ( input: UpdateReportGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.exportConfig !== undefined) { - bodyParams["exportConfig"] = serializeAws_json1_1ReportExportConfig( - input.exportConfig, - context - ); - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.exportConfig !== undefined && { + exportConfig: serializeAws_json1_1ReportExportConfig( + input.exportConfig, + context + ) + }) + }; }; const serializeAws_json1_1UpdateWebhookInput = ( input: UpdateWebhookInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchFilter !== undefined) { - bodyParams["branchFilter"] = input.branchFilter; - } - if (input.filterGroups !== undefined) { - bodyParams["filterGroups"] = serializeAws_json1_1FilterGroups( - input.filterGroups, - context - ); - } - if (input.projectName !== undefined) { - bodyParams["projectName"] = input.projectName; - } - if (input.rotateSecret !== undefined) { - bodyParams["rotateSecret"] = input.rotateSecret; - } - return bodyParams; + return { + ...(input.branchFilter !== undefined && { + branchFilter: input.branchFilter + }), + ...(input.filterGroups !== undefined && { + filterGroups: serializeAws_json1_1FilterGroups( + input.filterGroups, + context + ) + }), + ...(input.projectName !== undefined && { projectName: input.projectName }), + ...(input.rotateSecret !== undefined && { + rotateSecret: input.rotateSecret + }) + }; }; const serializeAws_json1_1VpcConfig = ( input: VpcConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.securityGroupIds !== undefined) { - bodyParams["securityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.securityGroupIds, - context - ); - } - if (input.subnets !== undefined) { - bodyParams["subnets"] = serializeAws_json1_1Subnets(input.subnets, context); - } - if (input.vpcId !== undefined) { - bodyParams["vpcId"] = input.vpcId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1WebhookFilter = ( input: WebhookFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.excludeMatchedPattern !== undefined) { - bodyParams["excludeMatchedPattern"] = input.excludeMatchedPattern; - } - if (input.pattern !== undefined) { - bodyParams["pattern"] = input.pattern; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.excludeMatchedPattern !== undefined && { + excludeMatchedPattern: input.excludeMatchedPattern + }), + ...(input.pattern !== undefined && { pattern: input.pattern }), + ...(input.type !== undefined && { type: input.type }) + }; }; const deserializeAws_json1_1AccountLimitExceededException = ( diff --git a/clients/client-codecommit/protocols/Aws_json1_1.ts b/clients/client-codecommit/protocols/Aws_json1_1.ts index 49274fe6f152..c32b9b0733c8 100644 --- a/clients/client-codecommit/protocols/Aws_json1_1.ts +++ b/clients/client-codecommit/protocols/Aws_json1_1.ts @@ -20501,120 +20501,113 @@ const serializeAws_json1_1AssociateApprovalRuleTemplateWithRepositoryInput = ( input: AssociateApprovalRuleTemplateWithRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1BatchAssociateApprovalRuleTemplateWithRepositoriesInput = ( input: BatchAssociateApprovalRuleTemplateWithRepositoriesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - if (input.repositoryNames !== undefined) { - bodyParams["repositoryNames"] = serializeAws_json1_1RepositoryNameList( - input.repositoryNames, - context - ); - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }), + ...(input.repositoryNames !== undefined && { + repositoryNames: serializeAws_json1_1RepositoryNameList( + input.repositoryNames, + context + ) + }) + }; }; const serializeAws_json1_1BatchDescribeMergeConflictsInput = ( input: BatchDescribeMergeConflictsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.filePaths !== undefined) { - bodyParams["filePaths"] = serializeAws_json1_1FilePaths( - input.filePaths, - context - ); - } - if (input.maxConflictFiles !== undefined) { - bodyParams["maxConflictFiles"] = input.maxConflictFiles; - } - if (input.maxMergeHunks !== undefined) { - bodyParams["maxMergeHunks"] = input.maxMergeHunks; - } - if (input.mergeOption !== undefined) { - bodyParams["mergeOption"] = input.mergeOption; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1BatchDisassociateApprovalRuleTemplateFromRepositoriesInput = ( input: BatchDisassociateApprovalRuleTemplateFromRepositoriesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - if (input.repositoryNames !== undefined) { - bodyParams["repositoryNames"] = serializeAws_json1_1RepositoryNameList( - input.repositoryNames, - context - ); - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }), + ...(input.repositoryNames !== undefined && { + repositoryNames: serializeAws_json1_1RepositoryNameList( + input.repositoryNames, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetCommitsInput = ( input: BatchGetCommitsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commitIds !== undefined) { - bodyParams["commitIds"] = serializeAws_json1_1CommitIdsInputList( - input.commitIds, - context - ); - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.commitIds !== undefined && { + commitIds: serializeAws_json1_1CommitIdsInputList( + input.commitIds, + context + ) + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1BatchGetRepositoriesInput = ( input: BatchGetRepositoriesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryNames !== undefined) { - bodyParams["repositoryNames"] = serializeAws_json1_1RepositoryNameList( - input.repositoryNames, - context - ); - } - return bodyParams; + return { + ...(input.repositoryNames !== undefined && { + repositoryNames: serializeAws_json1_1RepositoryNameList( + input.repositoryNames, + context + ) + }) + }; }; const serializeAws_json1_1BranchNameList = ( @@ -20635,249 +20628,212 @@ const serializeAws_json1_1ConflictResolution = ( input: ConflictResolution, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deleteFiles !== undefined) { - bodyParams["deleteFiles"] = serializeAws_json1_1DeleteFileEntries( - input.deleteFiles, - context - ); - } - if (input.replaceContents !== undefined) { - bodyParams["replaceContents"] = serializeAws_json1_1ReplaceContentEntries( - input.replaceContents, - context - ); - } - if (input.setFileModes !== undefined) { - bodyParams["setFileModes"] = serializeAws_json1_1SetFileModeEntries( - input.setFileModes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateApprovalRuleTemplateInput = ( input: CreateApprovalRuleTemplateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateContent !== undefined) { - bodyParams["approvalRuleTemplateContent"] = - input.approvalRuleTemplateContent; - } - if (input.approvalRuleTemplateDescription !== undefined) { - bodyParams["approvalRuleTemplateDescription"] = - input.approvalRuleTemplateDescription; - } - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateContent !== undefined && { + approvalRuleTemplateContent: input.approvalRuleTemplateContent + }), + ...(input.approvalRuleTemplateDescription !== undefined && { + approvalRuleTemplateDescription: input.approvalRuleTemplateDescription + }), + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }) + }; }; const serializeAws_json1_1CreateBranchInput = ( input: CreateBranchInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.commitId !== undefined) { - bodyParams["commitId"] = input.commitId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.branchName !== undefined && { branchName: input.branchName }), + ...(input.commitId !== undefined && { commitId: input.commitId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1CreateCommitInput = ( input: CreateCommitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorName !== undefined) { - bodyParams["authorName"] = input.authorName; - } - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.deleteFiles !== undefined) { - bodyParams["deleteFiles"] = serializeAws_json1_1DeleteFileEntries( - input.deleteFiles, - context - ); - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.parentCommitId !== undefined) { - bodyParams["parentCommitId"] = input.parentCommitId; - } - if (input.putFiles !== undefined) { - bodyParams["putFiles"] = serializeAws_json1_1PutFileEntries( - input.putFiles, - context - ); - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.setFileModes !== undefined) { - bodyParams["setFileModes"] = serializeAws_json1_1SetFileModeEntries( - input.setFileModes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreatePullRequestApprovalRuleInput = ( input: CreatePullRequestApprovalRuleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleContent !== undefined) { - bodyParams["approvalRuleContent"] = input.approvalRuleContent; - } - if (input.approvalRuleName !== undefined) { - bodyParams["approvalRuleName"] = input.approvalRuleName; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - return bodyParams; + return { + ...(input.approvalRuleContent !== undefined && { + approvalRuleContent: input.approvalRuleContent + }), + ...(input.approvalRuleName !== undefined && { + approvalRuleName: input.approvalRuleName + }), + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }) + }; }; const serializeAws_json1_1CreatePullRequestInput = ( input: CreatePullRequestInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken === undefined) { - input.clientRequestToken = generateIdempotencyToken(); - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.targets !== undefined) { - bodyParams["targets"] = serializeAws_json1_1TargetList( - input.targets, - context - ); - } - if (input.title !== undefined) { - bodyParams["title"] = input.title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateRepositoryInput = ( input: CreateRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryDescription !== undefined) { - bodyParams["repositoryDescription"] = input.repositoryDescription; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagsMap(input.tags, context); - } - return bodyParams; + return { + ...(input.repositoryDescription !== undefined && { + repositoryDescription: input.repositoryDescription + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagsMap(input.tags, context) + }) + }; }; const serializeAws_json1_1CreateUnreferencedMergeCommitInput = ( input: CreateUnreferencedMergeCommitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorName !== undefined) { - bodyParams["authorName"] = input.authorName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolution !== undefined) { - bodyParams["conflictResolution"] = serializeAws_json1_1ConflictResolution( - input.conflictResolution, - context - ); - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.mergeOption !== undefined) { - bodyParams["mergeOption"] = input.mergeOption; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteApprovalRuleTemplateInput = ( input: DeleteApprovalRuleTemplateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }) + }; }; const serializeAws_json1_1DeleteBranchInput = ( input: DeleteBranchInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.branchName !== undefined && { branchName: input.branchName }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1DeleteCommentContentInput = ( input: DeleteCommentContentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commentId !== undefined) { - bodyParams["commentId"] = input.commentId; - } - return bodyParams; + return { + ...(input.commentId !== undefined && { commentId: input.commentId }) + }; }; const serializeAws_json1_1DeleteFileEntries = ( @@ -20893,154 +20849,130 @@ const serializeAws_json1_1DeleteFileEntry = ( input: DeleteFileEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - return bodyParams; + return { + ...(input.filePath !== undefined && { filePath: input.filePath }) + }; }; const serializeAws_json1_1DeleteFileInput = ( input: DeleteFileInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.parentCommitId !== undefined) { - bodyParams["parentCommitId"] = input.parentCommitId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeletePullRequestApprovalRuleInput = ( input: DeletePullRequestApprovalRuleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleName !== undefined) { - bodyParams["approvalRuleName"] = input.approvalRuleName; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - return bodyParams; + return { + ...(input.approvalRuleName !== undefined && { + approvalRuleName: input.approvalRuleName + }), + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }) + }; }; const serializeAws_json1_1DeleteRepositoryInput = ( input: DeleteRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1DescribeMergeConflictsInput = ( input: DescribeMergeConflictsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.maxMergeHunks !== undefined) { - bodyParams["maxMergeHunks"] = input.maxMergeHunks; - } - if (input.mergeOption !== undefined) { - bodyParams["mergeOption"] = input.mergeOption; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribePullRequestEventsInput = ( input: DescribePullRequestEventsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actorArn !== undefined) { - bodyParams["actorArn"] = input.actorArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.pullRequestEventType !== undefined) { - bodyParams["pullRequestEventType"] = input.pullRequestEventType; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DisassociateApprovalRuleTemplateFromRepositoryInput = ( input: DisassociateApprovalRuleTemplateFromRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1EvaluatePullRequestApprovalRulesInput = ( input: EvaluatePullRequestApprovalRulesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.revisionId !== undefined) { - bodyParams["revisionId"] = input.revisionId; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.revisionId !== undefined && { revisionId: input.revisionId }) + }; }; const serializeAws_json1_1FilePaths = ( @@ -21054,759 +20986,644 @@ const serializeAws_json1_1GetApprovalRuleTemplateInput = ( input: GetApprovalRuleTemplateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }) + }; }; const serializeAws_json1_1GetBlobInput = ( input: GetBlobInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.blobId !== undefined) { - bodyParams["blobId"] = input.blobId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.blobId !== undefined && { blobId: input.blobId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetBranchInput = ( input: GetBranchInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.branchName !== undefined && { branchName: input.branchName }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetCommentInput = ( input: GetCommentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commentId !== undefined) { - bodyParams["commentId"] = input.commentId; - } - return bodyParams; + return { + ...(input.commentId !== undefined && { commentId: input.commentId }) + }; }; const serializeAws_json1_1GetCommentsForComparedCommitInput = ( input: GetCommentsForComparedCommitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.afterCommitId !== undefined) { - bodyParams["afterCommitId"] = input.afterCommitId; - } - if (input.beforeCommitId !== undefined) { - bodyParams["beforeCommitId"] = input.beforeCommitId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetCommentsForPullRequestInput = ( input: GetCommentsForPullRequestInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.afterCommitId !== undefined) { - bodyParams["afterCommitId"] = input.afterCommitId; - } - if (input.beforeCommitId !== undefined) { - bodyParams["beforeCommitId"] = input.beforeCommitId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetCommitInput = ( input: GetCommitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commitId !== undefined) { - bodyParams["commitId"] = input.commitId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.commitId !== undefined && { commitId: input.commitId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetDifferencesInput = ( input: GetDifferencesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.afterCommitSpecifier !== undefined) { - bodyParams["afterCommitSpecifier"] = input.afterCommitSpecifier; - } - if (input.afterPath !== undefined) { - bodyParams["afterPath"] = input.afterPath; - } - if (input.beforeCommitSpecifier !== undefined) { - bodyParams["beforeCommitSpecifier"] = input.beforeCommitSpecifier; - } - if (input.beforePath !== undefined) { - bodyParams["beforePath"] = input.beforePath; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetFileInput = ( input: GetFileInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commitSpecifier !== undefined) { - bodyParams["commitSpecifier"] = input.commitSpecifier; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.commitSpecifier !== undefined && { + commitSpecifier: input.commitSpecifier + }), + ...(input.filePath !== undefined && { filePath: input.filePath }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetFolderInput = ( input: GetFolderInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commitSpecifier !== undefined) { - bodyParams["commitSpecifier"] = input.commitSpecifier; - } - if (input.folderPath !== undefined) { - bodyParams["folderPath"] = input.folderPath; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.commitSpecifier !== undefined && { + commitSpecifier: input.commitSpecifier + }), + ...(input.folderPath !== undefined && { folderPath: input.folderPath }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetMergeCommitInput = ( input: GetMergeCommitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetMergeConflictsInput = ( input: GetMergeConflictsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.maxConflictFiles !== undefined) { - bodyParams["maxConflictFiles"] = input.maxConflictFiles; - } - if (input.mergeOption !== undefined) { - bodyParams["mergeOption"] = input.mergeOption; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetMergeOptionsInput = ( input: GetMergeOptionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetPullRequestApprovalStatesInput = ( input: GetPullRequestApprovalStatesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.revisionId !== undefined) { - bodyParams["revisionId"] = input.revisionId; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.revisionId !== undefined && { revisionId: input.revisionId }) + }; }; const serializeAws_json1_1GetPullRequestInput = ( input: GetPullRequestInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }) + }; }; const serializeAws_json1_1GetPullRequestOverrideStateInput = ( input: GetPullRequestOverrideStateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.revisionId !== undefined) { - bodyParams["revisionId"] = input.revisionId; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.revisionId !== undefined && { revisionId: input.revisionId }) + }; }; const serializeAws_json1_1GetRepositoryInput = ( input: GetRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetRepositoryTriggersInput = ( input: GetRepositoryTriggersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1ListApprovalRuleTemplatesInput = ( input: ListApprovalRuleTemplatesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListAssociatedApprovalRuleTemplatesForRepositoryInput = ( input: ListAssociatedApprovalRuleTemplatesForRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1ListBranchesInput = ( input: ListBranchesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1ListPullRequestsInput = ( input: ListPullRequestsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorArn !== undefined) { - bodyParams["authorArn"] = input.authorArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.pullRequestStatus !== undefined) { - bodyParams["pullRequestStatus"] = input.pullRequestStatus; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListRepositoriesForApprovalRuleTemplateInput = ( input: ListRepositoriesForApprovalRuleTemplateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListRepositoriesInput = ( input: ListRepositoriesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.order !== undefined) { - bodyParams["order"] = input.order; - } - if (input.sortBy !== undefined) { - bodyParams["sortBy"] = input.sortBy; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.order !== undefined && { order: input.order }), + ...(input.sortBy !== undefined && { sortBy: input.sortBy }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1Location = ( input: Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.filePosition !== undefined) { - bodyParams["filePosition"] = input.filePosition; - } - if (input.relativeFileVersion !== undefined) { - bodyParams["relativeFileVersion"] = input.relativeFileVersion; - } - return bodyParams; + return { + ...(input.filePath !== undefined && { filePath: input.filePath }), + ...(input.filePosition !== undefined && { + filePosition: input.filePosition + }), + ...(input.relativeFileVersion !== undefined && { + relativeFileVersion: input.relativeFileVersion + }) + }; }; const serializeAws_json1_1MergeBranchesByFastForwardInput = ( input: MergeBranchesByFastForwardInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - if (input.targetBranch !== undefined) { - bodyParams["targetBranch"] = input.targetBranch; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MergeBranchesBySquashInput = ( input: MergeBranchesBySquashInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorName !== undefined) { - bodyParams["authorName"] = input.authorName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolution !== undefined) { - bodyParams["conflictResolution"] = serializeAws_json1_1ConflictResolution( - input.conflictResolution, - context - ); - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - if (input.targetBranch !== undefined) { - bodyParams["targetBranch"] = input.targetBranch; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MergeBranchesByThreeWayInput = ( input: MergeBranchesByThreeWayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorName !== undefined) { - bodyParams["authorName"] = input.authorName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolution !== undefined) { - bodyParams["conflictResolution"] = serializeAws_json1_1ConflictResolution( - input.conflictResolution, - context - ); - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.destinationCommitSpecifier !== undefined) { - bodyParams["destinationCommitSpecifier"] = input.destinationCommitSpecifier; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitSpecifier !== undefined) { - bodyParams["sourceCommitSpecifier"] = input.sourceCommitSpecifier; - } - if (input.targetBranch !== undefined) { - bodyParams["targetBranch"] = input.targetBranch; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MergePullRequestByFastForwardInput = ( input: MergePullRequestByFastForwardInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitId !== undefined) { - bodyParams["sourceCommitId"] = input.sourceCommitId; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }), + ...(input.sourceCommitId !== undefined && { + sourceCommitId: input.sourceCommitId + }) + }; }; const serializeAws_json1_1MergePullRequestBySquashInput = ( input: MergePullRequestBySquashInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorName !== undefined) { - bodyParams["authorName"] = input.authorName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolution !== undefined) { - bodyParams["conflictResolution"] = serializeAws_json1_1ConflictResolution( - input.conflictResolution, - context - ); - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitId !== undefined) { - bodyParams["sourceCommitId"] = input.sourceCommitId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MergePullRequestByThreeWayInput = ( input: MergePullRequestByThreeWayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authorName !== undefined) { - bodyParams["authorName"] = input.authorName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.conflictDetailLevel !== undefined) { - bodyParams["conflictDetailLevel"] = input.conflictDetailLevel; - } - if (input.conflictResolution !== undefined) { - bodyParams["conflictResolution"] = serializeAws_json1_1ConflictResolution( - input.conflictResolution, - context - ); - } - if (input.conflictResolutionStrategy !== undefined) { - bodyParams["conflictResolutionStrategy"] = input.conflictResolutionStrategy; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.keepEmptyFolders !== undefined) { - bodyParams["keepEmptyFolders"] = input.keepEmptyFolders; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceCommitId !== undefined) { - bodyParams["sourceCommitId"] = input.sourceCommitId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1OverridePullRequestApprovalRulesInput = ( input: OverridePullRequestApprovalRulesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.overrideStatus !== undefined) { - bodyParams["overrideStatus"] = input.overrideStatus; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.revisionId !== undefined) { - bodyParams["revisionId"] = input.revisionId; - } - return bodyParams; + return { + ...(input.overrideStatus !== undefined && { + overrideStatus: input.overrideStatus + }), + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.revisionId !== undefined && { revisionId: input.revisionId }) + }; }; const serializeAws_json1_1PostCommentForComparedCommitInput = ( input: PostCommentForComparedCommitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.afterCommitId !== undefined) { - bodyParams["afterCommitId"] = input.afterCommitId; - } - if (input.beforeCommitId !== undefined) { - bodyParams["beforeCommitId"] = input.beforeCommitId; - } - if (input.clientRequestToken === undefined) { - input.clientRequestToken = generateIdempotencyToken(); - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - if (input.location !== undefined) { - bodyParams["location"] = serializeAws_json1_1Location( - input.location, - context - ); - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.afterCommitId !== undefined && { + afterCommitId: input.afterCommitId + }), + ...(input.beforeCommitId !== undefined && { + 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 + }) + }; }; const serializeAws_json1_1PostCommentForPullRequestInput = ( input: PostCommentForPullRequestInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.afterCommitId !== undefined) { - bodyParams["afterCommitId"] = input.afterCommitId; - } - if (input.beforeCommitId !== undefined) { - bodyParams["beforeCommitId"] = input.beforeCommitId; - } - if (input.clientRequestToken === undefined) { - input.clientRequestToken = generateIdempotencyToken(); - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - if (input.location !== undefined) { - bodyParams["location"] = serializeAws_json1_1Location( - input.location, - context - ); - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.afterCommitId !== undefined && { + afterCommitId: input.afterCommitId + }), + ...(input.beforeCommitId !== undefined && { + 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 + }) + }; }; const serializeAws_json1_1PostCommentReplyInput = ( input: PostCommentReplyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken === undefined) { - input.clientRequestToken = generateIdempotencyToken(); - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - if (input.inReplyTo !== undefined) { - bodyParams["inReplyTo"] = input.inReplyTo; - } - return bodyParams; + return { + clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), + ...(input.content !== undefined && { content: input.content }), + ...(input.inReplyTo !== undefined && { inReplyTo: input.inReplyTo }) + }; }; const serializeAws_json1_1PutFileEntries = ( @@ -21820,75 +21637,61 @@ const serializeAws_json1_1PutFileEntry = ( input: PutFileEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fileContent !== undefined) { - bodyParams["fileContent"] = context.base64Encoder(input.fileContent); - } - if (input.fileMode !== undefined) { - bodyParams["fileMode"] = input.fileMode; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.sourceFile !== undefined) { - bodyParams["sourceFile"] = serializeAws_json1_1SourceFileSpecifier( - input.sourceFile, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutFileInput = ( input: PutFileInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branchName !== undefined) { - bodyParams["branchName"] = input.branchName; - } - if (input.commitMessage !== undefined) { - bodyParams["commitMessage"] = input.commitMessage; - } - if (input.email !== undefined) { - bodyParams["email"] = input.email; - } - if (input.fileContent !== undefined) { - bodyParams["fileContent"] = context.base64Encoder(input.fileContent); - } - if (input.fileMode !== undefined) { - bodyParams["fileMode"] = input.fileMode; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.parentCommitId !== undefined) { - bodyParams["parentCommitId"] = input.parentCommitId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1PutRepositoryTriggersInput = ( input: PutRepositoryTriggersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.triggers !== undefined) { - bodyParams["triggers"] = serializeAws_json1_1RepositoryTriggersList( - input.triggers, - context - ); - } - return bodyParams; + return { + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }), + ...(input.triggers !== undefined && { + triggers: serializeAws_json1_1RepositoryTriggersList( + input.triggers, + context + ) + }) + }; }; const serializeAws_json1_1ReplaceContentEntries = ( @@ -21904,20 +21707,16 @@ const serializeAws_json1_1ReplaceContentEntry = ( input: ReplaceContentEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.content !== undefined) { - bodyParams["content"] = context.base64Encoder(input.content); - } - if (input.fileMode !== undefined) { - bodyParams["fileMode"] = input.fileMode; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.replacementType !== undefined) { - bodyParams["replacementType"] = input.replacementType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1RepositoryNameList = ( @@ -21931,29 +21730,22 @@ const serializeAws_json1_1RepositoryTrigger = ( input: RepositoryTrigger, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.branches !== undefined) { - bodyParams["branches"] = serializeAws_json1_1BranchNameList( - input.branches, - context - ); - } - if (input.customData !== undefined) { - bodyParams["customData"] = input.customData; - } - if (input.destinationArn !== undefined) { - bodyParams["destinationArn"] = input.destinationArn; - } - if (input.events !== undefined) { - bodyParams["events"] = serializeAws_json1_1RepositoryTriggerEventList( - input.events, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RepositoryTriggerEventList = ( @@ -21985,28 +21777,20 @@ const serializeAws_json1_1SetFileModeEntry = ( input: SetFileModeEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fileMode !== undefined) { - bodyParams["fileMode"] = input.fileMode; - } - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - return bodyParams; + return { + ...(input.fileMode !== undefined && { fileMode: input.fileMode }), + ...(input.filePath !== undefined && { filePath: input.filePath }) + }; }; const serializeAws_json1_1SourceFileSpecifier = ( input: SourceFileSpecifier, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filePath !== undefined) { - bodyParams["filePath"] = input.filePath; - } - if (input.isMove !== undefined) { - bodyParams["isMove"] = input.isMove; - } - return bodyParams; + return { + ...(input.filePath !== undefined && { filePath: input.filePath }), + ...(input.isMove !== undefined && { isMove: input.isMove }) + }; }; const serializeAws_json1_1TagKeysList = ( @@ -22020,14 +21804,12 @@ const serializeAws_json1_1TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagsMap(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagsMap(input.tags, context) + }) + }; }; const serializeAws_json1_1TagsMap = ( @@ -22044,17 +21826,17 @@ const serializeAws_json1_1Target = ( input: Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destinationReference !== undefined) { - bodyParams["destinationReference"] = input.destinationReference; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.sourceReference !== undefined) { - bodyParams["sourceReference"] = input.sourceReference; - } - return bodyParams; + return { + ...(input.destinationReference !== undefined && { + destinationReference: input.destinationReference + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }), + ...(input.sourceReference !== undefined && { + sourceReference: input.sourceReference + }) + }; }; const serializeAws_json1_1TargetList = ( @@ -22068,217 +21850,195 @@ const serializeAws_json1_1TestRepositoryTriggersInput = ( input: TestRepositoryTriggersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.triggers !== undefined) { - bodyParams["triggers"] = serializeAws_json1_1RepositoryTriggersList( - input.triggers, - context - ); - } - return bodyParams; + return { + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }), + ...(input.triggers !== undefined && { + triggers: serializeAws_json1_1RepositoryTriggersList( + input.triggers, + context + ) + }) + }; }; const serializeAws_json1_1UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeysList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeysList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateApprovalRuleTemplateContentInput = ( input: UpdateApprovalRuleTemplateContentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - if (input.existingRuleContentSha256 !== undefined) { - bodyParams["existingRuleContentSha256"] = input.existingRuleContentSha256; - } - if (input.newRuleContent !== undefined) { - bodyParams["newRuleContent"] = input.newRuleContent; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }), + ...(input.existingRuleContentSha256 !== undefined && { + existingRuleContentSha256: input.existingRuleContentSha256 + }), + ...(input.newRuleContent !== undefined && { + newRuleContent: input.newRuleContent + }) + }; }; const serializeAws_json1_1UpdateApprovalRuleTemplateDescriptionInput = ( input: UpdateApprovalRuleTemplateDescriptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleTemplateDescription !== undefined) { - bodyParams["approvalRuleTemplateDescription"] = - input.approvalRuleTemplateDescription; - } - if (input.approvalRuleTemplateName !== undefined) { - bodyParams["approvalRuleTemplateName"] = input.approvalRuleTemplateName; - } - return bodyParams; + return { + ...(input.approvalRuleTemplateDescription !== undefined && { + approvalRuleTemplateDescription: input.approvalRuleTemplateDescription + }), + ...(input.approvalRuleTemplateName !== undefined && { + approvalRuleTemplateName: input.approvalRuleTemplateName + }) + }; }; const serializeAws_json1_1UpdateApprovalRuleTemplateNameInput = ( input: UpdateApprovalRuleTemplateNameInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.newApprovalRuleTemplateName !== undefined) { - bodyParams["newApprovalRuleTemplateName"] = - input.newApprovalRuleTemplateName; - } - if (input.oldApprovalRuleTemplateName !== undefined) { - bodyParams["oldApprovalRuleTemplateName"] = - input.oldApprovalRuleTemplateName; - } - return bodyParams; + return { + ...(input.newApprovalRuleTemplateName !== undefined && { + newApprovalRuleTemplateName: input.newApprovalRuleTemplateName + }), + ...(input.oldApprovalRuleTemplateName !== undefined && { + oldApprovalRuleTemplateName: input.oldApprovalRuleTemplateName + }) + }; }; const serializeAws_json1_1UpdateCommentInput = ( input: UpdateCommentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commentId !== undefined) { - bodyParams["commentId"] = input.commentId; - } - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - return bodyParams; + return { + ...(input.commentId !== undefined && { commentId: input.commentId }), + ...(input.content !== undefined && { content: input.content }) + }; }; const serializeAws_json1_1UpdateDefaultBranchInput = ( input: UpdateDefaultBranchInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultBranchName !== undefined) { - bodyParams["defaultBranchName"] = input.defaultBranchName; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.defaultBranchName !== undefined && { + defaultBranchName: input.defaultBranchName + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1UpdatePullRequestApprovalRuleContentInput = ( input: UpdatePullRequestApprovalRuleContentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalRuleName !== undefined) { - bodyParams["approvalRuleName"] = input.approvalRuleName; - } - if (input.existingRuleContentSha256 !== undefined) { - bodyParams["existingRuleContentSha256"] = input.existingRuleContentSha256; - } - if (input.newRuleContent !== undefined) { - bodyParams["newRuleContent"] = input.newRuleContent; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdatePullRequestApprovalStateInput = ( input: UpdatePullRequestApprovalStateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.approvalState !== undefined) { - bodyParams["approvalState"] = input.approvalState; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.revisionId !== undefined) { - bodyParams["revisionId"] = input.revisionId; - } - return bodyParams; + return { + ...(input.approvalState !== undefined && { + approvalState: input.approvalState + }), + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.revisionId !== undefined && { revisionId: input.revisionId }) + }; }; const serializeAws_json1_1UpdatePullRequestDescriptionInput = ( input: UpdatePullRequestDescriptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }) + }; }; const serializeAws_json1_1UpdatePullRequestStatusInput = ( input: UpdatePullRequestStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.pullRequestStatus !== undefined) { - bodyParams["pullRequestStatus"] = input.pullRequestStatus; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.pullRequestStatus !== undefined && { + pullRequestStatus: input.pullRequestStatus + }) + }; }; const serializeAws_json1_1UpdatePullRequestTitleInput = ( input: UpdatePullRequestTitleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pullRequestId !== undefined) { - bodyParams["pullRequestId"] = input.pullRequestId; - } - if (input.title !== undefined) { - bodyParams["title"] = input.title; - } - return bodyParams; + return { + ...(input.pullRequestId !== undefined && { + pullRequestId: input.pullRequestId + }), + ...(input.title !== undefined && { title: input.title }) + }; }; const serializeAws_json1_1UpdateRepositoryDescriptionInput = ( input: UpdateRepositoryDescriptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.repositoryDescription !== undefined) { - bodyParams["repositoryDescription"] = input.repositoryDescription; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.repositoryDescription !== undefined && { + repositoryDescription: input.repositoryDescription + }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1UpdateRepositoryNameInput = ( input: UpdateRepositoryNameInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.newName !== undefined) { - bodyParams["newName"] = input.newName; - } - if (input.oldName !== undefined) { - bodyParams["oldName"] = input.oldName; - } - return bodyParams; + return { + ...(input.newName !== undefined && { newName: input.newName }), + ...(input.oldName !== undefined && { oldName: input.oldName }) + }; }; const deserializeAws_json1_1ActorDoesNotExistException = ( diff --git a/clients/client-codedeploy/protocols/Aws_json1_1.ts b/clients/client-codedeploy/protocols/Aws_json1_1.ts index d72905c9bb4a..54d3a7fcc66b 100644 --- a/clients/client-codedeploy/protocols/Aws_json1_1.ts +++ b/clients/client-codedeploy/protocols/Aws_json1_1.ts @@ -8989,45 +8989,41 @@ const serializeAws_json1_1AddTagsToOnPremisesInstancesInput = ( input: AddTagsToOnPremisesInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1InstanceNameList( - input.instanceNames, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.instanceNames !== undefined && { + instanceNames: serializeAws_json1_1InstanceNameList( + input.instanceNames, + context + ) + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1Alarm = ( input: Alarm, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1AlarmConfiguration = ( input: AlarmConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.alarms !== undefined) { - bodyParams["alarms"] = serializeAws_json1_1AlarmList(input.alarms, context); - } - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - if (input.ignorePollAlarmFailure !== undefined) { - bodyParams["ignorePollAlarmFailure"] = input.ignorePollAlarmFailure; - } - return bodyParams; + return { + ...(input.alarms !== undefined && { + alarms: serializeAws_json1_1AlarmList(input.alarms, context) + }), + ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.ignorePollAlarmFailure !== undefined && { + ignorePollAlarmFailure: input.ignorePollAlarmFailure + }) + }; }; const serializeAws_json1_1AlarmList = ( @@ -9041,14 +9037,10 @@ const serializeAws_json1_1AppSpecContent = ( input: AppSpecContent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - if (input.sha256 !== undefined) { - bodyParams["sha256"] = input.sha256; - } - return bodyParams; + return { + ...(input.content !== undefined && { content: input.content }), + ...(input.sha256 !== undefined && { sha256: input.sha256 }) + }; }; const serializeAws_json1_1ApplicationsList = ( @@ -9062,17 +9054,12 @@ const serializeAws_json1_1AutoRollbackConfiguration = ( input: AutoRollbackConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - if (input.events !== undefined) { - bodyParams["events"] = serializeAws_json1_1AutoRollbackEventsList( - input.events, - context - ); - } - return bodyParams; + return { + ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.events !== undefined && { + events: serializeAws_json1_1AutoRollbackEventsList(input.events, context) + }) + }; }; const serializeAws_json1_1AutoRollbackEventsList = ( @@ -9093,419 +9080,378 @@ const serializeAws_json1_1BatchGetApplicationRevisionsInput = ( input: BatchGetApplicationRevisionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.revisions !== undefined) { - bodyParams["revisions"] = serializeAws_json1_1RevisionLocationList( - input.revisions, - context - ); - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.revisions !== undefined && { + revisions: serializeAws_json1_1RevisionLocationList( + input.revisions, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetApplicationsInput = ( input: BatchGetApplicationsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationNames !== undefined) { - bodyParams["applicationNames"] = serializeAws_json1_1ApplicationsList( - input.applicationNames, - context - ); - } - return bodyParams; + return { + ...(input.applicationNames !== undefined && { + applicationNames: serializeAws_json1_1ApplicationsList( + input.applicationNames, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetDeploymentGroupsInput = ( input: BatchGetDeploymentGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.deploymentGroupNames !== undefined) { - bodyParams[ - "deploymentGroupNames" - ] = serializeAws_json1_1DeploymentGroupsList( - input.deploymentGroupNames, - context - ); - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.deploymentGroupNames !== undefined && { + deploymentGroupNames: serializeAws_json1_1DeploymentGroupsList( + input.deploymentGroupNames, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetDeploymentInstancesInput = ( input: BatchGetDeploymentInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.instanceIds !== undefined) { - bodyParams["instanceIds"] = serializeAws_json1_1InstancesList( - input.instanceIds, - context - ); - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.instanceIds !== undefined && { + instanceIds: serializeAws_json1_1InstancesList(input.instanceIds, context) + }) + }; }; const serializeAws_json1_1BatchGetDeploymentTargetsInput = ( input: BatchGetDeploymentTargetsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.targetIds !== undefined) { - bodyParams["targetIds"] = serializeAws_json1_1TargetIdList( - input.targetIds, - context - ); - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.targetIds !== undefined && { + targetIds: serializeAws_json1_1TargetIdList(input.targetIds, context) + }) + }; }; const serializeAws_json1_1BatchGetDeploymentsInput = ( input: BatchGetDeploymentsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentIds !== undefined) { - bodyParams["deploymentIds"] = serializeAws_json1_1DeploymentsList( - input.deploymentIds, - context - ); - } - return bodyParams; + return { + ...(input.deploymentIds !== undefined && { + deploymentIds: serializeAws_json1_1DeploymentsList( + input.deploymentIds, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetOnPremisesInstancesInput = ( input: BatchGetOnPremisesInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1InstanceNameList( - input.instanceNames, - context - ); - } - return bodyParams; + return { + ...(input.instanceNames !== undefined && { + instanceNames: serializeAws_json1_1InstanceNameList( + input.instanceNames, + context + ) + }) + }; }; const serializeAws_json1_1BlueGreenDeploymentConfiguration = ( input: BlueGreenDeploymentConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentReadyOption !== undefined) { - bodyParams[ - "deploymentReadyOption" - ] = serializeAws_json1_1DeploymentReadyOption( - input.deploymentReadyOption, - context - ); - } - if (input.greenFleetProvisioningOption !== undefined) { - bodyParams[ - "greenFleetProvisioningOption" - ] = serializeAws_json1_1GreenFleetProvisioningOption( - input.greenFleetProvisioningOption, - context - ); - } - if (input.terminateBlueInstancesOnDeploymentSuccess !== undefined) { - bodyParams[ - "terminateBlueInstancesOnDeploymentSuccess" - ] = serializeAws_json1_1BlueInstanceTerminationOption( - input.terminateBlueInstancesOnDeploymentSuccess, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1BlueInstanceTerminationOption = ( input: BlueInstanceTerminationOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = input.action; - } - if (input.terminationWaitTimeInMinutes !== undefined) { - bodyParams["terminationWaitTimeInMinutes"] = - input.terminationWaitTimeInMinutes; - } - return bodyParams; + return { + ...(input.action !== undefined && { action: input.action }), + ...(input.terminationWaitTimeInMinutes !== undefined && { + terminationWaitTimeInMinutes: input.terminationWaitTimeInMinutes + }) + }; }; const serializeAws_json1_1ContinueDeploymentInput = ( input: ContinueDeploymentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.deploymentWaitType !== undefined) { - bodyParams["deploymentWaitType"] = input.deploymentWaitType; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.deploymentWaitType !== undefined && { + deploymentWaitType: input.deploymentWaitType + }) + }; }; const serializeAws_json1_1CreateApplicationInput = ( input: CreateApplicationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.computePlatform !== undefined) { - bodyParams["computePlatform"] = input.computePlatform; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.computePlatform !== undefined && { + computePlatform: input.computePlatform + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1CreateDeploymentConfigInput = ( input: CreateDeploymentConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.computePlatform !== undefined) { - bodyParams["computePlatform"] = input.computePlatform; - } - if (input.deploymentConfigName !== undefined) { - bodyParams["deploymentConfigName"] = input.deploymentConfigName; - } - if (input.minimumHealthyHosts !== undefined) { - bodyParams["minimumHealthyHosts"] = serializeAws_json1_1MinimumHealthyHosts( - input.minimumHealthyHosts, - context - ); - } - if (input.trafficRoutingConfig !== undefined) { - bodyParams[ - "trafficRoutingConfig" - ] = serializeAws_json1_1TrafficRoutingConfig( - input.trafficRoutingConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateDeploymentGroupInput = ( input: CreateDeploymentGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.alarmConfiguration !== undefined) { - bodyParams["alarmConfiguration"] = serializeAws_json1_1AlarmConfiguration( - input.alarmConfiguration, - context - ); - } - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.autoRollbackConfiguration !== undefined) { - bodyParams[ - "autoRollbackConfiguration" - ] = serializeAws_json1_1AutoRollbackConfiguration( - input.autoRollbackConfiguration, - context - ); - } - if (input.autoScalingGroups !== undefined) { - bodyParams[ - "autoScalingGroups" - ] = serializeAws_json1_1AutoScalingGroupNameList( - input.autoScalingGroups, - context - ); - } - if (input.blueGreenDeploymentConfiguration !== undefined) { - bodyParams[ - "blueGreenDeploymentConfiguration" - ] = serializeAws_json1_1BlueGreenDeploymentConfiguration( - input.blueGreenDeploymentConfiguration, - context - ); - } - if (input.deploymentConfigName !== undefined) { - bodyParams["deploymentConfigName"] = input.deploymentConfigName; - } - if (input.deploymentGroupName !== undefined) { - bodyParams["deploymentGroupName"] = input.deploymentGroupName; - } - if (input.deploymentStyle !== undefined) { - bodyParams["deploymentStyle"] = serializeAws_json1_1DeploymentStyle( - input.deploymentStyle, - context - ); - } - if (input.ec2TagFilters !== undefined) { - bodyParams["ec2TagFilters"] = serializeAws_json1_1EC2TagFilterList( - input.ec2TagFilters, - context - ); - } - if (input.ec2TagSet !== undefined) { - bodyParams["ec2TagSet"] = serializeAws_json1_1EC2TagSet( - input.ec2TagSet, - context - ); - } - if (input.ecsServices !== undefined) { - bodyParams["ecsServices"] = serializeAws_json1_1ECSServiceList( - input.ecsServices, - context - ); - } - if (input.loadBalancerInfo !== undefined) { - bodyParams["loadBalancerInfo"] = serializeAws_json1_1LoadBalancerInfo( - input.loadBalancerInfo, - context - ); - } - if (input.onPremisesInstanceTagFilters !== undefined) { - bodyParams[ - "onPremisesInstanceTagFilters" - ] = serializeAws_json1_1TagFilterList( - input.onPremisesInstanceTagFilters, - context - ); - } - if (input.onPremisesTagSet !== undefined) { - bodyParams["onPremisesTagSet"] = serializeAws_json1_1OnPremisesTagSet( - input.onPremisesTagSet, - context - ); - } - if (input.serviceRoleArn !== undefined) { - bodyParams["serviceRoleArn"] = input.serviceRoleArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.triggerConfigurations !== undefined) { - bodyParams["triggerConfigurations"] = serializeAws_json1_1TriggerConfigList( - input.triggerConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateDeploymentInput = ( input: CreateDeploymentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.autoRollbackConfiguration !== undefined) { - bodyParams[ - "autoRollbackConfiguration" - ] = serializeAws_json1_1AutoRollbackConfiguration( - input.autoRollbackConfiguration, - context - ); - } - if (input.deploymentConfigName !== undefined) { - bodyParams["deploymentConfigName"] = input.deploymentConfigName; - } - if (input.deploymentGroupName !== undefined) { - bodyParams["deploymentGroupName"] = input.deploymentGroupName; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.fileExistsBehavior !== undefined) { - bodyParams["fileExistsBehavior"] = input.fileExistsBehavior; - } - if (input.ignoreApplicationStopFailures !== undefined) { - bodyParams["ignoreApplicationStopFailures"] = - input.ignoreApplicationStopFailures; - } - if (input.revision !== undefined) { - bodyParams["revision"] = serializeAws_json1_1RevisionLocation( - input.revision, - context - ); - } - if (input.targetInstances !== undefined) { - bodyParams["targetInstances"] = serializeAws_json1_1TargetInstances( - input.targetInstances, - context - ); - } - if (input.updateOutdatedInstancesOnly !== undefined) { - bodyParams["updateOutdatedInstancesOnly"] = - input.updateOutdatedInstancesOnly; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteApplicationInput = ( input: DeleteApplicationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }) + }; }; const serializeAws_json1_1DeleteDeploymentConfigInput = ( input: DeleteDeploymentConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentConfigName !== undefined) { - bodyParams["deploymentConfigName"] = input.deploymentConfigName; - } - return bodyParams; + return { + ...(input.deploymentConfigName !== undefined && { + deploymentConfigName: input.deploymentConfigName + }) + }; }; const serializeAws_json1_1DeleteDeploymentGroupInput = ( input: DeleteDeploymentGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.deploymentGroupName !== undefined) { - bodyParams["deploymentGroupName"] = input.deploymentGroupName; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.deploymentGroupName !== undefined && { + deploymentGroupName: input.deploymentGroupName + }) + }; }; const serializeAws_json1_1DeleteGitHubAccountTokenInput = ( input: DeleteGitHubAccountTokenInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tokenName !== undefined) { - bodyParams["tokenName"] = input.tokenName; - } - return bodyParams; + return { + ...(input.tokenName !== undefined && { tokenName: input.tokenName }) + }; }; const serializeAws_json1_1DeploymentGroupsList = ( @@ -9519,14 +9465,14 @@ const serializeAws_json1_1DeploymentReadyOption = ( input: DeploymentReadyOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionOnTimeout !== undefined) { - bodyParams["actionOnTimeout"] = input.actionOnTimeout; - } - if (input.waitTimeInMinutes !== undefined) { - bodyParams["waitTimeInMinutes"] = input.waitTimeInMinutes; - } - return bodyParams; + return { + ...(input.actionOnTimeout !== undefined && { + actionOnTimeout: input.actionOnTimeout + }), + ...(input.waitTimeInMinutes !== undefined && { + waitTimeInMinutes: input.waitTimeInMinutes + }) + }; }; const serializeAws_json1_1DeploymentStatusList = ( @@ -9540,14 +9486,14 @@ const serializeAws_json1_1DeploymentStyle = ( input: DeploymentStyle, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentOption !== undefined) { - bodyParams["deploymentOption"] = input.deploymentOption; - } - if (input.deploymentType !== undefined) { - bodyParams["deploymentType"] = input.deploymentType; - } - return bodyParams; + return { + ...(input.deploymentOption !== undefined && { + deploymentOption: input.deploymentOption + }), + ...(input.deploymentType !== undefined && { + deploymentType: input.deploymentType + }) + }; }; const serializeAws_json1_1DeploymentsList = ( @@ -9561,28 +9507,22 @@ const serializeAws_json1_1DeregisterOnPremisesInstanceInput = ( input: DeregisterOnPremisesInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1EC2TagFilter = ( input: EC2TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1EC2TagFilterList = ( @@ -9596,14 +9536,14 @@ const serializeAws_json1_1EC2TagSet = ( input: EC2TagSet, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ec2TagSetList !== undefined) { - bodyParams["ec2TagSetList"] = serializeAws_json1_1EC2TagSetList( - input.ec2TagSetList, - context - ); - } - return bodyParams; + return { + ...(input.ec2TagSetList !== undefined && { + ec2TagSetList: serializeAws_json1_1EC2TagSetList( + input.ec2TagSetList, + context + ) + }) + }; }; const serializeAws_json1_1EC2TagSetList = ( @@ -9619,14 +9559,10 @@ const serializeAws_json1_1ECSService = ( input: ECSService, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clusterName !== undefined) { - bodyParams["clusterName"] = input.clusterName; - } - if (input.serviceName !== undefined) { - bodyParams["serviceName"] = input.serviceName; - } - return bodyParams; + return { + ...(input.clusterName !== undefined && { clusterName: input.clusterName }), + ...(input.serviceName !== undefined && { serviceName: input.serviceName }) + }; }; const serializeAws_json1_1ECSServiceList = ( @@ -9640,11 +9576,9 @@ const serializeAws_json1_1ELBInfo = ( input: ELBInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1ELBInfoList = ( @@ -9665,128 +9599,115 @@ const serializeAws_json1_1GetApplicationInput = ( input: GetApplicationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }) + }; }; const serializeAws_json1_1GetApplicationRevisionInput = ( input: GetApplicationRevisionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.revision !== undefined) { - bodyParams["revision"] = serializeAws_json1_1RevisionLocation( - input.revision, - context - ); - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.revision !== undefined && { + revision: serializeAws_json1_1RevisionLocation(input.revision, context) + }) + }; }; const serializeAws_json1_1GetDeploymentConfigInput = ( input: GetDeploymentConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentConfigName !== undefined) { - bodyParams["deploymentConfigName"] = input.deploymentConfigName; - } - return bodyParams; + return { + ...(input.deploymentConfigName !== undefined && { + deploymentConfigName: input.deploymentConfigName + }) + }; }; const serializeAws_json1_1GetDeploymentGroupInput = ( input: GetDeploymentGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.deploymentGroupName !== undefined) { - bodyParams["deploymentGroupName"] = input.deploymentGroupName; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.deploymentGroupName !== undefined && { + deploymentGroupName: input.deploymentGroupName + }) + }; }; const serializeAws_json1_1GetDeploymentInput = ( input: GetDeploymentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }) + }; }; const serializeAws_json1_1GetDeploymentInstanceInput = ( input: GetDeploymentInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.instanceId !== undefined) { - bodyParams["instanceId"] = input.instanceId; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.instanceId !== undefined && { instanceId: input.instanceId }) + }; }; const serializeAws_json1_1GetDeploymentTargetInput = ( input: GetDeploymentTargetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.targetId !== undefined) { - bodyParams["targetId"] = input.targetId; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.targetId !== undefined && { targetId: input.targetId }) + }; }; const serializeAws_json1_1GetOnPremisesInstanceInput = ( input: GetOnPremisesInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1GitHubLocation = ( input: GitHubLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.commitId !== undefined) { - bodyParams["commitId"] = input.commitId; - } - if (input.repository !== undefined) { - bodyParams["repository"] = input.repository; - } - return bodyParams; + return { + ...(input.commitId !== undefined && { commitId: input.commitId }), + ...(input.repository !== undefined && { repository: input.repository }) + }; }; const serializeAws_json1_1GreenFleetProvisioningOption = ( input: GreenFleetProvisioningOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = input.action; - } - return bodyParams; + return { + ...(input.action !== undefined && { action: input.action }) + }; }; const serializeAws_json1_1InstanceNameList = ( @@ -9821,187 +9742,150 @@ const serializeAws_json1_1ListApplicationRevisionsInput = ( input: ListApplicationRevisionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.deployed !== undefined) { - bodyParams["deployed"] = input.deployed; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.s3Bucket !== undefined) { - bodyParams["s3Bucket"] = input.s3Bucket; - } - if (input.s3KeyPrefix !== undefined) { - bodyParams["s3KeyPrefix"] = input.s3KeyPrefix; - } - if (input.sortBy !== undefined) { - bodyParams["sortBy"] = input.sortBy; - } - if (input.sortOrder !== undefined) { - bodyParams["sortOrder"] = input.sortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListApplicationsInput = ( input: ListApplicationsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListDeploymentConfigsInput = ( input: ListDeploymentConfigsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListDeploymentGroupsInput = ( input: ListDeploymentGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListDeploymentInstancesInput = ( input: ListDeploymentInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.instanceStatusFilter !== undefined) { - bodyParams["instanceStatusFilter"] = serializeAws_json1_1InstanceStatusList( - input.instanceStatusFilter, - context - ); - } - if (input.instanceTypeFilter !== undefined) { - bodyParams["instanceTypeFilter"] = serializeAws_json1_1InstanceTypeList( - input.instanceTypeFilter, - context - ); - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListDeploymentTargetsInput = ( input: ListDeploymentTargetsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.targetFilters !== undefined) { - bodyParams["targetFilters"] = serializeAws_json1_1TargetFilters( - input.targetFilters, - context - ); - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.targetFilters !== undefined && { + targetFilters: serializeAws_json1_1TargetFilters( + input.targetFilters, + context + ) + }) + }; }; const serializeAws_json1_1ListDeploymentsInput = ( input: ListDeploymentsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.createTimeRange !== undefined) { - bodyParams["createTimeRange"] = serializeAws_json1_1TimeRange( - input.createTimeRange, - context - ); - } - if (input.deploymentGroupName !== undefined) { - bodyParams["deploymentGroupName"] = input.deploymentGroupName; - } - if (input.includeOnlyStatuses !== undefined) { - bodyParams[ - "includeOnlyStatuses" - ] = serializeAws_json1_1DeploymentStatusList( - input.includeOnlyStatuses, - context - ); - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.createTimeRange !== undefined && { + createTimeRange: serializeAws_json1_1TimeRange( + input.createTimeRange, + context + ) + }), + ...(input.deploymentGroupName !== undefined && { + deploymentGroupName: input.deploymentGroupName + }), + ...(input.includeOnlyStatuses !== undefined && { + includeOnlyStatuses: serializeAws_json1_1DeploymentStatusList( + input.includeOnlyStatuses, + context + ) + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListGitHubAccountTokenNamesInput = ( input: ListGitHubAccountTokenNamesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListOnPremisesInstancesInput = ( input: ListOnPremisesInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.registrationStatus !== undefined) { - bodyParams["registrationStatus"] = input.registrationStatus; - } - if (input.tagFilters !== undefined) { - bodyParams["tagFilters"] = serializeAws_json1_1TagFilterList( - input.tagFilters, - context - ); - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.registrationStatus !== undefined && { + registrationStatus: input.registrationStatus + }), + ...(input.tagFilters !== undefined && { + tagFilters: serializeAws_json1_1TagFilterList(input.tagFilters, context) + }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListenerArnList = ( @@ -10015,58 +9899,47 @@ const serializeAws_json1_1LoadBalancerInfo = ( input: LoadBalancerInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.elbInfoList !== undefined) { - bodyParams["elbInfoList"] = serializeAws_json1_1ELBInfoList( - input.elbInfoList, - context - ); - } - if (input.targetGroupInfoList !== undefined) { - bodyParams["targetGroupInfoList"] = serializeAws_json1_1TargetGroupInfoList( - input.targetGroupInfoList, - context - ); - } - if (input.targetGroupPairInfoList !== undefined) { - bodyParams[ - "targetGroupPairInfoList" - ] = serializeAws_json1_1TargetGroupPairInfoList( - input.targetGroupPairInfoList, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1MinimumHealthyHosts = ( input: MinimumHealthyHosts, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.type !== undefined && { type: input.type }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1OnPremisesTagSet = ( input: OnPremisesTagSet, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.onPremisesTagSetList !== undefined) { - bodyParams[ - "onPremisesTagSetList" - ] = serializeAws_json1_1OnPremisesTagSetList( - input.onPremisesTagSetList, - context - ); - } - return bodyParams; + return { + ...(input.onPremisesTagSetList !== undefined && { + onPremisesTagSetList: serializeAws_json1_1OnPremisesTagSetList( + input.onPremisesTagSetList, + context + ) + }) + }; }; const serializeAws_json1_1OnPremisesTagSetList = ( @@ -10080,118 +9953,101 @@ const serializeAws_json1_1PutLifecycleEventHookExecutionStatusInput = ( input: PutLifecycleEventHookExecutionStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - if (input.lifecycleEventHookExecutionId !== undefined) { - bodyParams["lifecycleEventHookExecutionId"] = - input.lifecycleEventHookExecutionId; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }), + ...(input.lifecycleEventHookExecutionId !== undefined && { + lifecycleEventHookExecutionId: input.lifecycleEventHookExecutionId + }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1RawString = ( input: RawString, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - if (input.sha256 !== undefined) { - bodyParams["sha256"] = input.sha256; - } - return bodyParams; + return { + ...(input.content !== undefined && { content: input.content }), + ...(input.sha256 !== undefined && { sha256: input.sha256 }) + }; }; const serializeAws_json1_1RegisterApplicationRevisionInput = ( input: RegisterApplicationRevisionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.revision !== undefined) { - bodyParams["revision"] = serializeAws_json1_1RevisionLocation( - input.revision, - context - ); - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.description !== undefined && { description: input.description }), + ...(input.revision !== undefined && { + revision: serializeAws_json1_1RevisionLocation(input.revision, context) + }) + }; }; const serializeAws_json1_1RegisterOnPremisesInstanceInput = ( input: RegisterOnPremisesInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.iamSessionArn !== undefined) { - bodyParams["iamSessionArn"] = input.iamSessionArn; - } - if (input.iamUserArn !== undefined) { - bodyParams["iamUserArn"] = input.iamUserArn; - } - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.iamSessionArn !== undefined && { + iamSessionArn: input.iamSessionArn + }), + ...(input.iamUserArn !== undefined && { iamUserArn: input.iamUserArn }), + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1RemoveTagsFromOnPremisesInstancesInput = ( input: RemoveTagsFromOnPremisesInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1InstanceNameList( - input.instanceNames, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.instanceNames !== undefined && { + instanceNames: serializeAws_json1_1InstanceNameList( + input.instanceNames, + context + ) + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1RevisionLocation = ( input: RevisionLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appSpecContent !== undefined) { - bodyParams["appSpecContent"] = serializeAws_json1_1AppSpecContent( - input.appSpecContent, - context - ); - } - if (input.gitHubLocation !== undefined) { - bodyParams["gitHubLocation"] = serializeAws_json1_1GitHubLocation( - input.gitHubLocation, - context - ); - } - if (input.revisionType !== undefined) { - bodyParams["revisionType"] = input.revisionType; - } - if (input.s3Location !== undefined) { - bodyParams["s3Location"] = serializeAws_json1_1S3Location( - input.s3Location, - context - ); - } - if (input.string !== undefined) { - bodyParams["string"] = serializeAws_json1_1RawString(input.string, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RevisionLocationList = ( @@ -10207,76 +10063,56 @@ const serializeAws_json1_1S3Location = ( input: S3Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.bundleType !== undefined) { - bodyParams["bundleType"] = input.bundleType; - } - if (input.eTag !== undefined) { - bodyParams["eTag"] = input.eTag; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SkipWaitTimeForInstanceTerminationInput = ( input: SkipWaitTimeForInstanceTerminationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - return bodyParams; + return { + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }) + }; }; const serializeAws_json1_1StopDeploymentInput = ( input: StopDeploymentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.autoRollbackEnabled !== undefined) { - bodyParams["autoRollbackEnabled"] = input.autoRollbackEnabled; - } - if (input.deploymentId !== undefined) { - bodyParams["deploymentId"] = input.deploymentId; - } - return bodyParams; + return { + ...(input.autoRollbackEnabled !== undefined && { + autoRollbackEnabled: input.autoRollbackEnabled + }), + ...(input.deploymentId !== undefined && { + deploymentId: input.deploymentId + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagFilter = ( input: TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagFilterList = ( @@ -10304,14 +10140,12 @@ const serializeAws_json1_1TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TargetFilters = ( @@ -10328,11 +10162,9 @@ const serializeAws_json1_1TargetGroupInfo = ( input: TargetGroupInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1TargetGroupInfoList = ( @@ -10348,26 +10180,26 @@ const serializeAws_json1_1TargetGroupPairInfo = ( input: TargetGroupPairInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.prodTrafficRoute !== undefined) { - bodyParams["prodTrafficRoute"] = serializeAws_json1_1TrafficRoute( - input.prodTrafficRoute, - context - ); - } - if (input.targetGroups !== undefined) { - bodyParams["targetGroups"] = serializeAws_json1_1TargetGroupInfoList( - input.targetGroups, - context - ); - } - if (input.testTrafficRoute !== undefined) { - bodyParams["testTrafficRoute"] = serializeAws_json1_1TrafficRoute( - input.testTrafficRoute, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1TargetGroupPairInfoList = ( @@ -10390,127 +10222,118 @@ const serializeAws_json1_1TargetInstances = ( input: TargetInstances, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.autoScalingGroups !== undefined) { - bodyParams[ - "autoScalingGroups" - ] = serializeAws_json1_1AutoScalingGroupNameList( - input.autoScalingGroups, - context - ); - } - if (input.ec2TagSet !== undefined) { - bodyParams["ec2TagSet"] = serializeAws_json1_1EC2TagSet( - input.ec2TagSet, - context - ); - } - if (input.tagFilters !== undefined) { - bodyParams["tagFilters"] = serializeAws_json1_1EC2TagFilterList( - input.tagFilters, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1TimeBasedCanary = ( input: TimeBasedCanary, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.canaryInterval !== undefined) { - bodyParams["canaryInterval"] = input.canaryInterval; - } - if (input.canaryPercentage !== undefined) { - bodyParams["canaryPercentage"] = input.canaryPercentage; - } - return bodyParams; + return { + ...(input.canaryInterval !== undefined && { + canaryInterval: input.canaryInterval + }), + ...(input.canaryPercentage !== undefined && { + canaryPercentage: input.canaryPercentage + }) + }; }; const serializeAws_json1_1TimeBasedLinear = ( input: TimeBasedLinear, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.linearInterval !== undefined) { - bodyParams["linearInterval"] = input.linearInterval; - } - if (input.linearPercentage !== undefined) { - bodyParams["linearPercentage"] = input.linearPercentage; - } - return bodyParams; + return { + ...(input.linearInterval !== undefined && { + linearInterval: input.linearInterval + }), + ...(input.linearPercentage !== undefined && { + linearPercentage: input.linearPercentage + }) + }; }; const serializeAws_json1_1TimeRange = ( input: TimeRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.end !== undefined) { - bodyParams["end"] = Math.round(input.end.getTime() / 1000); - } - if (input.start !== undefined) { - bodyParams["start"] = Math.round(input.start.getTime() / 1000); - } - return bodyParams; + return { + ...(input.end !== undefined && { + end: Math.round(input.end.getTime() / 1000) + }), + ...(input.start !== undefined && { + start: Math.round(input.start.getTime() / 1000) + }) + }; }; const serializeAws_json1_1TrafficRoute = ( input: TrafficRoute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.listenerArns !== undefined) { - bodyParams["listenerArns"] = serializeAws_json1_1ListenerArnList( - input.listenerArns, - context - ); - } - return bodyParams; + return { + ...(input.listenerArns !== undefined && { + listenerArns: serializeAws_json1_1ListenerArnList( + input.listenerArns, + context + ) + }) + }; }; const serializeAws_json1_1TrafficRoutingConfig = ( input: TrafficRoutingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.timeBasedCanary !== undefined) { - bodyParams["timeBasedCanary"] = serializeAws_json1_1TimeBasedCanary( - input.timeBasedCanary, - context - ); - } - if (input.timeBasedLinear !== undefined) { - bodyParams["timeBasedLinear"] = serializeAws_json1_1TimeBasedLinear( - input.timeBasedLinear, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1TriggerConfig = ( input: TriggerConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.triggerEvents !== undefined) { - bodyParams["triggerEvents"] = serializeAws_json1_1TriggerEventTypeList( - input.triggerEvents, - context - ); - } - if (input.triggerName !== undefined) { - bodyParams["triggerName"] = input.triggerName; - } - if (input.triggerTargetArn !== undefined) { - bodyParams["triggerTargetArn"] = input.triggerTargetArn; - } - return bodyParams; + return { + ...(input.triggerEvents !== undefined && { + triggerEvents: serializeAws_json1_1TriggerEventTypeList( + input.triggerEvents, + context + ) + }), + ...(input.triggerName !== undefined && { triggerName: input.triggerName }), + ...(input.triggerTargetArn !== undefined && { + triggerTargetArn: input.triggerTargetArn + }) + }; }; const serializeAws_json1_1TriggerConfigList = ( @@ -10531,134 +10354,118 @@ const serializeAws_json1_1UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateApplicationInput = ( input: UpdateApplicationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.newApplicationName !== undefined) { - bodyParams["newApplicationName"] = input.newApplicationName; - } - return bodyParams; + return { + ...(input.applicationName !== undefined && { + applicationName: input.applicationName + }), + ...(input.newApplicationName !== undefined && { + newApplicationName: input.newApplicationName + }) + }; }; const serializeAws_json1_1UpdateDeploymentGroupInput = ( input: UpdateDeploymentGroupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.alarmConfiguration !== undefined) { - bodyParams["alarmConfiguration"] = serializeAws_json1_1AlarmConfiguration( - input.alarmConfiguration, - context - ); - } - if (input.applicationName !== undefined) { - bodyParams["applicationName"] = input.applicationName; - } - if (input.autoRollbackConfiguration !== undefined) { - bodyParams[ - "autoRollbackConfiguration" - ] = serializeAws_json1_1AutoRollbackConfiguration( - input.autoRollbackConfiguration, - context - ); - } - if (input.autoScalingGroups !== undefined) { - bodyParams[ - "autoScalingGroups" - ] = serializeAws_json1_1AutoScalingGroupNameList( - input.autoScalingGroups, - context - ); - } - if (input.blueGreenDeploymentConfiguration !== undefined) { - bodyParams[ - "blueGreenDeploymentConfiguration" - ] = serializeAws_json1_1BlueGreenDeploymentConfiguration( - input.blueGreenDeploymentConfiguration, - context - ); - } - if (input.currentDeploymentGroupName !== undefined) { - bodyParams["currentDeploymentGroupName"] = input.currentDeploymentGroupName; - } - if (input.deploymentConfigName !== undefined) { - bodyParams["deploymentConfigName"] = input.deploymentConfigName; - } - if (input.deploymentStyle !== undefined) { - bodyParams["deploymentStyle"] = serializeAws_json1_1DeploymentStyle( - input.deploymentStyle, - context - ); - } - if (input.ec2TagFilters !== undefined) { - bodyParams["ec2TagFilters"] = serializeAws_json1_1EC2TagFilterList( - input.ec2TagFilters, - context - ); - } - if (input.ec2TagSet !== undefined) { - bodyParams["ec2TagSet"] = serializeAws_json1_1EC2TagSet( - input.ec2TagSet, - context - ); - } - if (input.ecsServices !== undefined) { - bodyParams["ecsServices"] = serializeAws_json1_1ECSServiceList( - input.ecsServices, - context - ); - } - if (input.loadBalancerInfo !== undefined) { - bodyParams["loadBalancerInfo"] = serializeAws_json1_1LoadBalancerInfo( - input.loadBalancerInfo, - context - ); - } - if (input.newDeploymentGroupName !== undefined) { - bodyParams["newDeploymentGroupName"] = input.newDeploymentGroupName; - } - if (input.onPremisesInstanceTagFilters !== undefined) { - bodyParams[ - "onPremisesInstanceTagFilters" - ] = serializeAws_json1_1TagFilterList( - input.onPremisesInstanceTagFilters, - context - ); - } - if (input.onPremisesTagSet !== undefined) { - bodyParams["onPremisesTagSet"] = serializeAws_json1_1OnPremisesTagSet( - input.onPremisesTagSet, - context - ); - } - if (input.serviceRoleArn !== undefined) { - bodyParams["serviceRoleArn"] = input.serviceRoleArn; - } - if (input.triggerConfigurations !== undefined) { - bodyParams["triggerConfigurations"] = serializeAws_json1_1TriggerConfigList( - input.triggerConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const deserializeAws_json1_1Alarm = ( diff --git a/clients/client-codeguru-reviewer/protocols/Aws_restJson1_1.ts b/clients/client-codeguru-reviewer/protocols/Aws_restJson1_1.ts index b7347ed1af5f..9dc6e893f912 100644 --- a/clients/client-codeguru-reviewer/protocols/Aws_restJson1_1.ts +++ b/clients/client-codeguru-reviewer/protocols/Aws_restJson1_1.ts @@ -734,25 +734,23 @@ const serializeAws_restJson1_1CodeCommitRepository = ( input: CodeCommitRepository, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_restJson1_1Repository = ( input: Repository, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeCommit !== undefined) { - bodyParams["CodeCommit"] = serializeAws_restJson1_1CodeCommitRepository( - input.CodeCommit, - context - ); - } - return bodyParams; + return { + ...(input.CodeCommit !== undefined && { + CodeCommit: serializeAws_restJson1_1CodeCommitRepository( + input.CodeCommit, + context + ) + }) + }; }; const deserializeAws_restJson1_1RepositoryAssociation = ( diff --git a/clients/client-codeguruprofiler/protocols/Aws_restJson1_1.ts b/clients/client-codeguruprofiler/protocols/Aws_restJson1_1.ts index 76956c58abe1..7a120a028822 100644 --- a/clients/client-codeguruprofiler/protocols/Aws_restJson1_1.ts +++ b/clients/client-codeguruprofiler/protocols/Aws_restJson1_1.ts @@ -1432,11 +1432,11 @@ const serializeAws_restJson1_1AgentOrchestrationConfig = ( input: AgentOrchestrationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.profilingEnabled !== undefined) { - bodyParams["profilingEnabled"] = input.profilingEnabled; - } - return bodyParams; + return { + ...(input.profilingEnabled !== undefined && { + profilingEnabled: input.profilingEnabled + }) + }; }; const deserializeAws_restJson1_1AggregatedProfileTime = ( diff --git a/clients/client-codepipeline/protocols/Aws_json1_1.ts b/clients/client-codepipeline/protocols/Aws_json1_1.ts index cfce78b4c798..990bb5c151dc 100644 --- a/clients/client-codepipeline/protocols/Aws_json1_1.ts +++ b/clients/client-codepipeline/protocols/Aws_json1_1.ts @@ -4797,60 +4797,36 @@ const serializeAws_json1_1AcknowledgeJobInput = ( input: AcknowledgeJobInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - if (input.nonce !== undefined) { - bodyParams["nonce"] = input.nonce; - } - return bodyParams; + return { + ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.nonce !== undefined && { nonce: input.nonce }) + }; }; const serializeAws_json1_1AcknowledgeThirdPartyJobInput = ( input: AcknowledgeThirdPartyJobInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - if (input.nonce !== undefined) { - bodyParams["nonce"] = input.nonce; - } - return bodyParams; + return { + ...(input.clientToken !== undefined && { clientToken: input.clientToken }), + ...(input.jobId !== undefined && { jobId: input.jobId }), + ...(input.nonce !== undefined && { nonce: input.nonce }) + }; }; const serializeAws_json1_1ActionConfigurationProperty = ( input: ActionConfigurationProperty, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.queryable !== undefined) { - bodyParams["queryable"] = input.queryable; - } - if (input.required !== undefined) { - bodyParams["required"] = input.required; - } - if (input.secret !== undefined) { - bodyParams["secret"] = input.secret; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ActionConfigurationPropertyList = ( @@ -4866,143 +4842,123 @@ const serializeAws_json1_1ActionDeclaration = ( input: ActionDeclaration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionTypeId !== undefined) { - bodyParams["actionTypeId"] = serializeAws_json1_1ActionTypeId( - input.actionTypeId, - context - ); - } - if (input.configuration !== undefined) { - bodyParams["configuration"] = serializeAws_json1_1ActionConfigurationMap( - input.configuration, - context - ); - } - if (input.inputArtifacts !== undefined) { - bodyParams["inputArtifacts"] = serializeAws_json1_1InputArtifactList( - input.inputArtifacts, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.namespace !== undefined) { - bodyParams["namespace"] = input.namespace; - } - if (input.outputArtifacts !== undefined) { - bodyParams["outputArtifacts"] = serializeAws_json1_1OutputArtifactList( - input.outputArtifacts, - context - ); - } - if (input.region !== undefined) { - bodyParams["region"] = input.region; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.runOrder !== undefined) { - bodyParams["runOrder"] = input.runOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ActionExecutionFilter = ( input: ActionExecutionFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineExecutionId !== undefined) { - bodyParams["pipelineExecutionId"] = input.pipelineExecutionId; - } - return bodyParams; + return { + ...(input.pipelineExecutionId !== undefined && { + pipelineExecutionId: input.pipelineExecutionId + }) + }; }; const serializeAws_json1_1ActionRevision = ( input: ActionRevision, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.created !== undefined) { - bodyParams["created"] = Math.round(input.created.getTime() / 1000); - } - if (input.revisionChangeId !== undefined) { - bodyParams["revisionChangeId"] = input.revisionChangeId; - } - if (input.revisionId !== undefined) { - bodyParams["revisionId"] = input.revisionId; - } - return bodyParams; + return { + ...(input.created !== undefined && { + created: Math.round(input.created.getTime() / 1000) + }), + ...(input.revisionChangeId !== undefined && { + revisionChangeId: input.revisionChangeId + }), + ...(input.revisionId !== undefined && { revisionId: input.revisionId }) + }; }; const serializeAws_json1_1ActionTypeSettings = ( input: ActionTypeSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.entityUrlTemplate !== undefined) { - bodyParams["entityUrlTemplate"] = input.entityUrlTemplate; - } - if (input.executionUrlTemplate !== undefined) { - bodyParams["executionUrlTemplate"] = input.executionUrlTemplate; - } - if (input.revisionUrlTemplate !== undefined) { - bodyParams["revisionUrlTemplate"] = input.revisionUrlTemplate; - } - if (input.thirdPartyConfigurationUrl !== undefined) { - bodyParams["thirdPartyConfigurationUrl"] = input.thirdPartyConfigurationUrl; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ApprovalResult = ( input: ApprovalResult, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - if (input.summary !== undefined) { - bodyParams["summary"] = input.summary; - } - return bodyParams; + return { + ...(input.status !== undefined && { status: input.status }), + ...(input.summary !== undefined && { summary: input.summary }) + }; }; const serializeAws_json1_1ArtifactDetails = ( input: ArtifactDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maximumCount !== undefined) { - bodyParams["maximumCount"] = input.maximumCount; - } - if (input.minimumCount !== undefined) { - bodyParams["minimumCount"] = input.minimumCount; - } - return bodyParams; + return { + ...(input.maximumCount !== undefined && { + maximumCount: input.maximumCount + }), + ...(input.minimumCount !== undefined && { + minimumCount: input.minimumCount + }) + }; }; const serializeAws_json1_1ArtifactStore = ( input: ArtifactStore, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.encryptionKey !== undefined) { - bodyParams["encryptionKey"] = serializeAws_json1_1EncryptionKey( - input.encryptionKey, - context - ); - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.encryptionKey !== undefined && { + encryptionKey: serializeAws_json1_1EncryptionKey( + input.encryptionKey, + context + ) + }), + ...(input.location !== undefined && { location: input.location }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ArtifactStoreMap = ( @@ -5019,239 +4975,189 @@ const serializeAws_json1_1BlockerDeclaration = ( input: BlockerDeclaration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1CreateCustomActionTypeInput = ( input: CreateCustomActionTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.category !== undefined) { - bodyParams["category"] = input.category; - } - if (input.configurationProperties !== undefined) { - bodyParams[ - "configurationProperties" - ] = serializeAws_json1_1ActionConfigurationPropertyList( - input.configurationProperties, - context - ); - } - if (input.inputArtifactDetails !== undefined) { - bodyParams["inputArtifactDetails"] = serializeAws_json1_1ArtifactDetails( - input.inputArtifactDetails, - context - ); - } - if (input.outputArtifactDetails !== undefined) { - bodyParams["outputArtifactDetails"] = serializeAws_json1_1ArtifactDetails( - input.outputArtifactDetails, - context - ); - } - if (input.provider !== undefined) { - bodyParams["provider"] = input.provider; - } - if (input.settings !== undefined) { - bodyParams["settings"] = serializeAws_json1_1ActionTypeSettings( - input.settings, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreatePipelineInput = ( input: CreatePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipeline !== undefined) { - bodyParams["pipeline"] = serializeAws_json1_1PipelineDeclaration( - input.pipeline, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.pipeline !== undefined && { + pipeline: serializeAws_json1_1PipelineDeclaration(input.pipeline, context) + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1DeleteCustomActionTypeInput = ( input: DeleteCustomActionTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.category !== undefined) { - bodyParams["category"] = input.category; - } - if (input.provider !== undefined) { - bodyParams["provider"] = input.provider; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.category !== undefined && { category: input.category }), + ...(input.provider !== undefined && { provider: input.provider }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_json1_1DeletePipelineInput = ( input: DeletePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1DeleteWebhookInput = ( input: DeleteWebhookInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1DeregisterWebhookWithThirdPartyInput = ( input: DeregisterWebhookWithThirdPartyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.webhookName !== undefined) { - bodyParams["webhookName"] = input.webhookName; - } - return bodyParams; + return { + ...(input.webhookName !== undefined && { webhookName: input.webhookName }) + }; }; const serializeAws_json1_1DisableStageTransitionInput = ( input: DisableStageTransitionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.stageName !== undefined) { - bodyParams["stageName"] = input.stageName; - } - if (input.transitionType !== undefined) { - bodyParams["transitionType"] = input.transitionType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EnableStageTransitionInput = ( input: EnableStageTransitionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - if (input.stageName !== undefined) { - bodyParams["stageName"] = input.stageName; - } - if (input.transitionType !== undefined) { - bodyParams["transitionType"] = input.transitionType; - } - return bodyParams; + return { + ...(input.pipelineName !== undefined && { + pipelineName: input.pipelineName + }), + ...(input.stageName !== undefined && { stageName: input.stageName }), + ...(input.transitionType !== undefined && { + transitionType: input.transitionType + }) + }; }; const serializeAws_json1_1GetJobDetailsInput = ( input: GetJobDetailsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - return bodyParams; + return { + ...(input.jobId !== undefined && { jobId: input.jobId }) + }; }; const serializeAws_json1_1GetPipelineExecutionInput = ( input: GetPipelineExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineExecutionId !== undefined) { - bodyParams["pipelineExecutionId"] = input.pipelineExecutionId; - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - return bodyParams; + return { + ...(input.pipelineExecutionId !== undefined && { + pipelineExecutionId: input.pipelineExecutionId + }), + ...(input.pipelineName !== undefined && { + pipelineName: input.pipelineName + }) + }; }; const serializeAws_json1_1GetPipelineInput = ( input: GetPipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_json1_1GetPipelineStateInput = ( input: GetPipelineStateInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1GetThirdPartyJobDetailsInput = ( input: GetThirdPartyJobDetailsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - return bodyParams; + return { + ...(input.clientToken !== undefined && { clientToken: input.clientToken }), + ...(input.jobId !== undefined && { jobId: input.jobId }) + }; }; const serializeAws_json1_1InputArtifact = ( input: InputArtifact, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1InputArtifactList = ( @@ -5265,107 +5171,80 @@ const serializeAws_json1_1ListActionExecutionsInput = ( input: ListActionExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1ActionExecutionFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListActionTypesInput = ( input: ListActionTypesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionOwnerFilter !== undefined) { - bodyParams["actionOwnerFilter"] = input.actionOwnerFilter; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.actionOwnerFilter !== undefined && { + actionOwnerFilter: input.actionOwnerFilter + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListPipelineExecutionsInput = ( input: ListPipelineExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.pipelineName !== undefined && { + pipelineName: input.pipelineName + }) + }; }; const serializeAws_json1_1ListPipelinesInput = ( input: ListPipelinesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1ListWebhooksInput = ( input: ListWebhooksInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1OutputArtifact = ( input: OutputArtifact, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1OutputArtifactList = ( @@ -5379,35 +5258,29 @@ const serializeAws_json1_1PipelineDeclaration = ( input: PipelineDeclaration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.artifactStore !== undefined) { - bodyParams["artifactStore"] = serializeAws_json1_1ArtifactStore( - input.artifactStore, - context - ); - } - if (input.artifactStores !== undefined) { - bodyParams["artifactStores"] = serializeAws_json1_1ArtifactStoreMap( - input.artifactStores, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.stages !== undefined) { - bodyParams["stages"] = serializeAws_json1_1PipelineStageDeclarationList( - input.stages, - context - ); - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1PipelineStageDeclarationList = ( @@ -5423,235 +5296,198 @@ const serializeAws_json1_1PollForJobsInput = ( input: PollForJobsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionTypeId !== undefined) { - bodyParams["actionTypeId"] = serializeAws_json1_1ActionTypeId( - input.actionTypeId, - context - ); - } - if (input.maxBatchSize !== undefined) { - bodyParams["maxBatchSize"] = input.maxBatchSize; - } - if (input.queryParam !== undefined) { - bodyParams["queryParam"] = serializeAws_json1_1QueryParamMap( - input.queryParam, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PollForThirdPartyJobsInput = ( input: PollForThirdPartyJobsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionTypeId !== undefined) { - bodyParams["actionTypeId"] = serializeAws_json1_1ActionTypeId( - input.actionTypeId, - context - ); - } - if (input.maxBatchSize !== undefined) { - bodyParams["maxBatchSize"] = input.maxBatchSize; - } - return bodyParams; + return { + ...(input.actionTypeId !== undefined && { + actionTypeId: serializeAws_json1_1ActionTypeId( + input.actionTypeId, + context + ) + }), + ...(input.maxBatchSize !== undefined && { + maxBatchSize: input.maxBatchSize + }) + }; }; const serializeAws_json1_1PutActionRevisionInput = ( input: PutActionRevisionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionName !== undefined) { - bodyParams["actionName"] = input.actionName; - } - if (input.actionRevision !== undefined) { - bodyParams["actionRevision"] = serializeAws_json1_1ActionRevision( - input.actionRevision, - context - ); - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - if (input.stageName !== undefined) { - bodyParams["stageName"] = input.stageName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1PutApprovalResultInput = ( input: PutApprovalResultInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionName !== undefined) { - bodyParams["actionName"] = input.actionName; - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - if (input.result !== undefined) { - bodyParams["result"] = serializeAws_json1_1ApprovalResult( - input.result, - context - ); - } - if (input.stageName !== undefined) { - bodyParams["stageName"] = input.stageName; - } - if (input.token !== undefined) { - bodyParams["token"] = input.token; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1PutJobFailureResultInput = ( input: PutJobFailureResultInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.failureDetails !== undefined) { - bodyParams["failureDetails"] = serializeAws_json1_1FailureDetails( - input.failureDetails, - context - ); - } - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - return bodyParams; + return { + ...(input.failureDetails !== undefined && { + failureDetails: serializeAws_json1_1FailureDetails( + input.failureDetails, + context + ) + }), + ...(input.jobId !== undefined && { jobId: input.jobId }) + }; }; const serializeAws_json1_1PutJobSuccessResultInput = ( input: PutJobSuccessResultInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.continuationToken !== undefined) { - bodyParams["continuationToken"] = input.continuationToken; - } - if (input.currentRevision !== undefined) { - bodyParams["currentRevision"] = serializeAws_json1_1CurrentRevision( - input.currentRevision, - context - ); - } - if (input.executionDetails !== undefined) { - bodyParams["executionDetails"] = serializeAws_json1_1ExecutionDetails( - input.executionDetails, - context - ); - } - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - if (input.outputVariables !== undefined) { - bodyParams["outputVariables"] = serializeAws_json1_1OutputVariablesMap( - input.outputVariables, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutThirdPartyJobFailureResultInput = ( input: PutThirdPartyJobFailureResultInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.failureDetails !== undefined) { - bodyParams["failureDetails"] = serializeAws_json1_1FailureDetails( - input.failureDetails, - context - ); - } - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - return bodyParams; + return { + ...(input.clientToken !== undefined && { clientToken: input.clientToken }), + ...(input.failureDetails !== undefined && { + failureDetails: serializeAws_json1_1FailureDetails( + input.failureDetails, + context + ) + }), + ...(input.jobId !== undefined && { jobId: input.jobId }) + }; }; const serializeAws_json1_1PutThirdPartyJobSuccessResultInput = ( input: PutThirdPartyJobSuccessResultInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.continuationToken !== undefined) { - bodyParams["continuationToken"] = input.continuationToken; - } - if (input.currentRevision !== undefined) { - bodyParams["currentRevision"] = serializeAws_json1_1CurrentRevision( - input.currentRevision, - context - ); - } - if (input.executionDetails !== undefined) { - bodyParams["executionDetails"] = serializeAws_json1_1ExecutionDetails( - input.executionDetails, - context - ); - } - if (input.jobId !== undefined) { - bodyParams["jobId"] = input.jobId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1PutWebhookInput = ( input: PutWebhookInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.webhook !== undefined) { - bodyParams["webhook"] = serializeAws_json1_1WebhookDefinition( - input.webhook, - context - ); - } - return bodyParams; + return { + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }), + ...(input.webhook !== undefined && { + webhook: serializeAws_json1_1WebhookDefinition(input.webhook, context) + }) + }; }; const serializeAws_json1_1RegisterWebhookWithThirdPartyInput = ( input: RegisterWebhookWithThirdPartyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.webhookName !== undefined) { - bodyParams["webhookName"] = input.webhookName; - } - return bodyParams; + return { + ...(input.webhookName !== undefined && { webhookName: input.webhookName }) + }; }; const serializeAws_json1_1RetryStageExecutionInput = ( input: RetryStageExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineExecutionId !== undefined) { - bodyParams["pipelineExecutionId"] = input.pipelineExecutionId; - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - if (input.retryMode !== undefined) { - bodyParams["retryMode"] = input.retryMode; - } - if (input.stageName !== undefined) { - bodyParams["stageName"] = input.stageName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StageActionDeclarationList = ( @@ -5676,71 +5512,54 @@ const serializeAws_json1_1StageDeclaration = ( input: StageDeclaration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actions !== undefined) { - bodyParams["actions"] = serializeAws_json1_1StageActionDeclarationList( - input.actions, - context - ); - } - if (input.blockers !== undefined) { - bodyParams["blockers"] = serializeAws_json1_1StageBlockerDeclarationList( - input.blockers, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartPipelineExecutionInput = ( input: StartPipelineExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken === undefined) { - input.clientRequestToken = generateIdempotencyToken(); - } - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + clientRequestToken: input.clientRequestToken ?? generateIdempotencyToken(), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1StopPipelineExecutionInput = ( input: StopPipelineExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.abandon !== undefined) { - bodyParams["abandon"] = input.abandon; - } - if (input.pipelineExecutionId !== undefined) { - bodyParams["pipelineExecutionId"] = input.pipelineExecutionId; - } - if (input.pipelineName !== undefined) { - bodyParams["pipelineName"] = input.pipelineName; - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -5761,107 +5580,84 @@ const serializeAws_json1_1TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UpdatePipelineInput = ( input: UpdatePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipeline !== undefined) { - bodyParams["pipeline"] = serializeAws_json1_1PipelineDeclaration( - input.pipeline, - context - ); - } - return bodyParams; + return { + ...(input.pipeline !== undefined && { + pipeline: serializeAws_json1_1PipelineDeclaration(input.pipeline, context) + }) + }; }; const serializeAws_json1_1WebhookAuthConfiguration = ( input: WebhookAuthConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowedIPRange !== undefined) { - bodyParams["AllowedIPRange"] = input.AllowedIPRange; - } - if (input.SecretToken !== undefined) { - bodyParams["SecretToken"] = input.SecretToken; - } - return bodyParams; + return { + ...(input.AllowedIPRange !== undefined && { + AllowedIPRange: input.AllowedIPRange + }), + ...(input.SecretToken !== undefined && { SecretToken: input.SecretToken }) + }; }; const serializeAws_json1_1WebhookDefinition = ( input: WebhookDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.authentication !== undefined) { - bodyParams["authentication"] = input.authentication; - } - if (input.authenticationConfiguration !== undefined) { - bodyParams[ - "authenticationConfiguration" - ] = serializeAws_json1_1WebhookAuthConfiguration( - input.authenticationConfiguration, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1WebhookFilters( - input.filters, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.targetAction !== undefined) { - bodyParams["targetAction"] = input.targetAction; - } - if (input.targetPipeline !== undefined) { - bodyParams["targetPipeline"] = input.targetPipeline; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1WebhookFilterRule = ( input: WebhookFilterRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.jsonPath !== undefined) { - bodyParams["jsonPath"] = input.jsonPath; - } - if (input.matchEquals !== undefined) { - bodyParams["matchEquals"] = input.matchEquals; - } - return bodyParams; + return { + ...(input.jsonPath !== undefined && { jsonPath: input.jsonPath }), + ...(input.matchEquals !== undefined && { matchEquals: input.matchEquals }) + }; }; const serializeAws_json1_1WebhookFilters = ( @@ -5887,88 +5683,68 @@ const serializeAws_json1_1ActionTypeId = ( input: ActionTypeId, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.category !== undefined) { - bodyParams["category"] = input.category; - } - if (input.owner !== undefined) { - bodyParams["owner"] = input.owner; - } - if (input.provider !== undefined) { - bodyParams["provider"] = input.provider; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CurrentRevision = ( input: CurrentRevision, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.changeIdentifier !== undefined) { - bodyParams["changeIdentifier"] = input.changeIdentifier; - } - if (input.created !== undefined) { - bodyParams["created"] = Math.round(input.created.getTime() / 1000); - } - if (input.revision !== undefined) { - bodyParams["revision"] = input.revision; - } - if (input.revisionSummary !== undefined) { - bodyParams["revisionSummary"] = input.revisionSummary; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EncryptionKey = ( input: EncryptionKey, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ExecutionDetails = ( input: ExecutionDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.externalExecutionId !== undefined) { - bodyParams["externalExecutionId"] = input.externalExecutionId; - } - if (input.percentComplete !== undefined) { - bodyParams["percentComplete"] = input.percentComplete; - } - if (input.summary !== undefined) { - bodyParams["summary"] = input.summary; - } - return bodyParams; + return { + ...(input.externalExecutionId !== undefined && { + externalExecutionId: input.externalExecutionId + }), + ...(input.percentComplete !== undefined && { + percentComplete: input.percentComplete + }), + ...(input.summary !== undefined && { summary: input.summary }) + }; }; const serializeAws_json1_1FailureDetails = ( input: FailureDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.externalExecutionId !== undefined) { - bodyParams["externalExecutionId"] = input.externalExecutionId; - } - if (input.message !== undefined) { - bodyParams["message"] = input.message; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.externalExecutionId !== undefined && { + externalExecutionId: input.externalExecutionId + }), + ...(input.message !== undefined && { message: input.message }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1OutputVariablesMap = ( diff --git a/clients/client-codestar-connections/protocols/Aws_json1_0.ts b/clients/client-codestar-connections/protocols/Aws_json1_0.ts index d048fed9c607..fd4c6ba19932 100644 --- a/clients/client-codestar-connections/protocols/Aws_json1_0.ts +++ b/clients/client-codestar-connections/protocols/Aws_json1_0.ts @@ -367,53 +367,49 @@ const serializeAws_json1_0CreateConnectionInput = ( input: CreateConnectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionName !== undefined) { - bodyParams["ConnectionName"] = input.ConnectionName; - } - if (input.ProviderType !== undefined) { - bodyParams["ProviderType"] = input.ProviderType; - } - return bodyParams; + return { + ...(input.ConnectionName !== undefined && { + ConnectionName: input.ConnectionName + }), + ...(input.ProviderType !== undefined && { + ProviderType: input.ProviderType + }) + }; }; const serializeAws_json1_0DeleteConnectionInput = ( input: DeleteConnectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionArn !== undefined) { - bodyParams["ConnectionArn"] = input.ConnectionArn; - } - return bodyParams; + return { + ...(input.ConnectionArn !== undefined && { + ConnectionArn: input.ConnectionArn + }) + }; }; const serializeAws_json1_0GetConnectionInput = ( input: GetConnectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionArn !== undefined) { - bodyParams["ConnectionArn"] = input.ConnectionArn; - } - return bodyParams; + return { + ...(input.ConnectionArn !== undefined && { + ConnectionArn: input.ConnectionArn + }) + }; }; const serializeAws_json1_0ListConnectionsInput = ( input: ListConnectionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ProviderTypeFilter !== undefined) { - bodyParams["ProviderTypeFilter"] = input.ProviderTypeFilter; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ProviderTypeFilter !== undefined && { + ProviderTypeFilter: input.ProviderTypeFilter + }) + }; }; const deserializeAws_json1_0Connection = ( diff --git a/clients/client-codestar-notifications/protocols/Aws_restJson1_1.ts b/clients/client-codestar-notifications/protocols/Aws_restJson1_1.ts index a5378a33203c..dcae9e2abaef 100644 --- a/clients/client-codestar-notifications/protocols/Aws_restJson1_1.ts +++ b/clients/client-codestar-notifications/protocols/Aws_restJson1_1.ts @@ -1717,14 +1717,10 @@ const serializeAws_restJson1_1ListEventTypesFilter = ( input: ListEventTypesFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1ListEventTypesFilters = ( @@ -1740,14 +1736,10 @@ const serializeAws_restJson1_1ListNotificationRulesFilter = ( input: ListNotificationRulesFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1ListNotificationRulesFilters = ( @@ -1763,14 +1755,10 @@ const serializeAws_restJson1_1ListTargetsFilter = ( input: ListTargetsFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1ListTargetsFilters = ( @@ -1803,14 +1791,12 @@ const serializeAws_restJson1_1Target = ( input: Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetAddress !== undefined) { - bodyParams["TargetAddress"] = input.TargetAddress; - } - if (input.TargetType !== undefined) { - bodyParams["TargetType"] = input.TargetType; - } - return bodyParams; + return { + ...(input.TargetAddress !== undefined && { + TargetAddress: input.TargetAddress + }), + ...(input.TargetType !== undefined && { TargetType: input.TargetType }) + }; }; const serializeAws_restJson1_1Targets = ( diff --git a/clients/client-codestar/protocols/Aws_json1_1.ts b/clients/client-codestar/protocols/Aws_json1_1.ts index d9d02792f232..4b97d87a7e55 100644 --- a/clients/client-codestar/protocols/Aws_json1_1.ts +++ b/clients/client-codestar/protocols/Aws_json1_1.ts @@ -2240,326 +2240,242 @@ const serializeAws_json1_1AssociateTeamMemberRequest = ( input: AssociateTeamMemberRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.projectId !== undefined) { - bodyParams["projectId"] = input.projectId; - } - if (input.projectRole !== undefined) { - bodyParams["projectRole"] = input.projectRole; - } - if (input.remoteAccessAllowed !== undefined) { - bodyParams["remoteAccessAllowed"] = input.remoteAccessAllowed; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Code = ( input: Code, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destination !== undefined) { - bodyParams["destination"] = serializeAws_json1_1CodeDestination( - input.destination, - context - ); - } - if (input.source !== undefined) { - bodyParams["source"] = serializeAws_json1_1CodeSource( - input.source, - context - ); - } - return bodyParams; + return { + ...(input.destination !== undefined && { + destination: serializeAws_json1_1CodeDestination( + input.destination, + context + ) + }), + ...(input.source !== undefined && { + source: serializeAws_json1_1CodeSource(input.source, context) + }) + }; }; const serializeAws_json1_1CodeCommitCodeDestination = ( input: CodeCommitCodeDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1CodeDestination = ( input: CodeDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.codeCommit !== undefined) { - bodyParams["codeCommit"] = serializeAws_json1_1CodeCommitCodeDestination( - input.codeCommit, - context - ); - } - if (input.gitHub !== undefined) { - bodyParams["gitHub"] = serializeAws_json1_1GitHubCodeDestination( - input.gitHub, - context - ); - } - return bodyParams; + return { + ...(input.codeCommit !== undefined && { + codeCommit: serializeAws_json1_1CodeCommitCodeDestination( + input.codeCommit, + context + ) + }), + ...(input.gitHub !== undefined && { + gitHub: serializeAws_json1_1GitHubCodeDestination(input.gitHub, context) + }) + }; }; const serializeAws_json1_1CodeSource = ( input: CodeSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3 !== undefined) { - bodyParams["s3"] = serializeAws_json1_1S3Location(input.s3, context); - } - return bodyParams; + return { + ...(input.s3 !== undefined && { + s3: serializeAws_json1_1S3Location(input.s3, context) + }) + }; }; const serializeAws_json1_1CreateProjectRequest = ( input: CreateProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.sourceCode !== undefined) { - bodyParams["sourceCode"] = serializeAws_json1_1SourceCode( - input.sourceCode, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - if (input.toolchain !== undefined) { - bodyParams["toolchain"] = serializeAws_json1_1Toolchain( - input.toolchain, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateUserProfileRequest = ( input: CreateUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.displayName !== undefined) { - bodyParams["displayName"] = input.displayName; - } - if (input.emailAddress !== undefined) { - bodyParams["emailAddress"] = input.emailAddress; - } - if (input.sshPublicKey !== undefined) { - bodyParams["sshPublicKey"] = input.sshPublicKey; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteProjectRequest = ( input: DeleteProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientRequestToken !== undefined) { - bodyParams["clientRequestToken"] = input.clientRequestToken; - } - if (input.deleteStack !== undefined) { - bodyParams["deleteStack"] = input.deleteStack; - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.clientRequestToken !== undefined && { + clientRequestToken: input.clientRequestToken + }), + ...(input.deleteStack !== undefined && { deleteStack: input.deleteStack }), + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DeleteUserProfileRequest = ( input: DeleteUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + return { + ...(input.userArn !== undefined && { userArn: input.userArn }) + }; }; const serializeAws_json1_1DescribeProjectRequest = ( input: DescribeProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DescribeUserProfileRequest = ( input: DescribeUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + return { + ...(input.userArn !== undefined && { userArn: input.userArn }) + }; }; const serializeAws_json1_1DisassociateTeamMemberRequest = ( input: DisassociateTeamMemberRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectId !== undefined) { - bodyParams["projectId"] = input.projectId; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + return { + ...(input.projectId !== undefined && { projectId: input.projectId }), + ...(input.userArn !== undefined && { userArn: input.userArn }) + }; }; const serializeAws_json1_1GitHubCodeDestination = ( input: GitHubCodeDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.issuesEnabled !== undefined) { - bodyParams["issuesEnabled"] = input.issuesEnabled; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.owner !== undefined) { - bodyParams["owner"] = input.owner; - } - if (input.privateRepository !== undefined) { - bodyParams["privateRepository"] = input.privateRepository; - } - if (input.token !== undefined) { - bodyParams["token"] = input.token; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListProjectsRequest = ( input: ListProjectsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListResourcesRequest = ( input: ListResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.projectId !== undefined) { - bodyParams["projectId"] = input.projectId; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.projectId !== undefined && { projectId: input.projectId }) + }; }; const serializeAws_json1_1ListTagsForProjectRequest = ( input: ListTagsForProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListTeamMembersRequest = ( input: ListTeamMembersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.projectId !== undefined) { - bodyParams["projectId"] = input.projectId; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.projectId !== undefined && { projectId: input.projectId }) + }; }; const serializeAws_json1_1ListUserProfilesRequest = ( input: ListUserProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1S3Location = ( input: S3Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketKey !== undefined) { - bodyParams["bucketKey"] = input.bucketKey; - } - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - return bodyParams; + return { + ...(input.bucketKey !== undefined && { bucketKey: input.bucketKey }), + ...(input.bucketName !== undefined && { bucketName: input.bucketName }) + }; }; const serializeAws_json1_1SourceCode = ( @@ -2580,14 +2496,12 @@ const serializeAws_json1_1TagProjectRequest = ( input: TagProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1Tags(input.tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -2614,105 +2528,82 @@ const serializeAws_json1_1Toolchain = ( input: Toolchain, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.source !== undefined) { - bodyParams["source"] = serializeAws_json1_1ToolchainSource( - input.source, - context - ); - } - if (input.stackParameters !== undefined) { - bodyParams["stackParameters"] = serializeAws_json1_1TemplateParameterMap( - input.stackParameters, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ToolchainSource = ( input: ToolchainSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3 !== undefined) { - bodyParams["s3"] = serializeAws_json1_1S3Location(input.s3, context); - } - return bodyParams; + return { + ...(input.s3 !== undefined && { + s3: serializeAws_json1_1S3Location(input.s3, context) + }) + }; }; const serializeAws_json1_1UntagProjectRequest = ( input: UntagProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagKeys(input.tags, context); - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagKeys(input.tags, context) + }) + }; }; const serializeAws_json1_1UpdateProjectRequest = ( input: UpdateProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.id !== undefined && { id: input.id }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1UpdateTeamMemberRequest = ( input: UpdateTeamMemberRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectId !== undefined) { - bodyParams["projectId"] = input.projectId; - } - if (input.projectRole !== undefined) { - bodyParams["projectRole"] = input.projectRole; - } - if (input.remoteAccessAllowed !== undefined) { - bodyParams["remoteAccessAllowed"] = input.remoteAccessAllowed; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateUserProfileRequest = ( input: UpdateUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.displayName !== undefined) { - bodyParams["displayName"] = input.displayName; - } - if (input.emailAddress !== undefined) { - bodyParams["emailAddress"] = input.emailAddress; - } - if (input.sshPublicKey !== undefined) { - bodyParams["sshPublicKey"] = input.sshPublicKey; - } - if (input.userArn !== undefined) { - bodyParams["userArn"] = input.userArn; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AssociateTeamMemberResult = ( 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 74aaed041c46..8a1cab9dce04 100644 --- a/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity-provider/protocols/Aws_json1_1.ts @@ -16437,691 +16437,534 @@ const serializeAws_json1_1AccountRecoverySettingType = ( input: AccountRecoverySettingType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecoveryMechanisms !== undefined) { - bodyParams[ - "RecoveryMechanisms" - ] = serializeAws_json1_1RecoveryMechanismsType( - input.RecoveryMechanisms, - context - ); - } - return bodyParams; + return { + ...(input.RecoveryMechanisms !== undefined && { + RecoveryMechanisms: serializeAws_json1_1RecoveryMechanismsType( + input.RecoveryMechanisms, + context + ) + }) + }; }; const serializeAws_json1_1AccountTakeoverActionType = ( input: AccountTakeoverActionType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventAction !== undefined) { - bodyParams["EventAction"] = input.EventAction; - } - if (input.Notify !== undefined) { - bodyParams["Notify"] = input.Notify; - } - return bodyParams; + return { + ...(input.EventAction !== undefined && { EventAction: input.EventAction }), + ...(input.Notify !== undefined && { Notify: input.Notify }) + }; }; const serializeAws_json1_1AccountTakeoverActionsType = ( input: AccountTakeoverActionsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HighAction !== undefined) { - bodyParams["HighAction"] = serializeAws_json1_1AccountTakeoverActionType( - input.HighAction, - context - ); - } - if (input.LowAction !== undefined) { - bodyParams["LowAction"] = serializeAws_json1_1AccountTakeoverActionType( - input.LowAction, - context - ); - } - if (input.MediumAction !== undefined) { - bodyParams["MediumAction"] = serializeAws_json1_1AccountTakeoverActionType( - input.MediumAction, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AccountTakeoverRiskConfigurationType = ( input: AccountTakeoverRiskConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_json1_1AccountTakeoverActionsType( - input.Actions, - context - ); - } - if (input.NotifyConfiguration !== undefined) { - bodyParams[ - "NotifyConfiguration" - ] = serializeAws_json1_1NotifyConfigurationType( - input.NotifyConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.Actions !== undefined && { + Actions: serializeAws_json1_1AccountTakeoverActionsType( + input.Actions, + context + ) + }), + ...(input.NotifyConfiguration !== undefined && { + NotifyConfiguration: serializeAws_json1_1NotifyConfigurationType( + input.NotifyConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1AddCustomAttributesRequest = ( input: AddCustomAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomAttributes !== undefined) { - bodyParams[ - "CustomAttributes" - ] = serializeAws_json1_1CustomAttributesListType( - input.CustomAttributes, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.CustomAttributes !== undefined && { + CustomAttributes: serializeAws_json1_1CustomAttributesListType( + input.CustomAttributes, + context + ) + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1AdminAddUserToGroupRequest = ( input: AdminAddUserToGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminConfirmSignUpRequest = ( input: AdminConfirmSignUpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.ClientMetadata !== undefined && { + ClientMetadata: serializeAws_json1_1ClientMetadataType( + input.ClientMetadata, + context + ) + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminCreateUserConfigType = ( input: AdminCreateUserConfigType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowAdminCreateUserOnly !== undefined) { - bodyParams["AllowAdminCreateUserOnly"] = input.AllowAdminCreateUserOnly; - } - if (input.InviteMessageTemplate !== undefined) { - bodyParams[ - "InviteMessageTemplate" - ] = serializeAws_json1_1MessageTemplateType( - input.InviteMessageTemplate, - context - ); - } - if (input.UnusedAccountValidityDays !== undefined) { - bodyParams["UnusedAccountValidityDays"] = input.UnusedAccountValidityDays; - } - return bodyParams; + return { + ...(input.AllowAdminCreateUserOnly !== undefined && { + AllowAdminCreateUserOnly: input.AllowAdminCreateUserOnly + }), + ...(input.InviteMessageTemplate !== undefined && { + InviteMessageTemplate: serializeAws_json1_1MessageTemplateType( + input.InviteMessageTemplate, + context + ) + }), + ...(input.UnusedAccountValidityDays !== undefined && { + UnusedAccountValidityDays: input.UnusedAccountValidityDays + }) + }; }; const serializeAws_json1_1AdminCreateUserRequest = ( input: AdminCreateUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.DesiredDeliveryMediums !== undefined) { - bodyParams[ - "DesiredDeliveryMediums" - ] = serializeAws_json1_1DeliveryMediumListType( - input.DesiredDeliveryMediums, - context - ); - } - if (input.ForceAliasCreation !== undefined) { - bodyParams["ForceAliasCreation"] = input.ForceAliasCreation; - } - if (input.MessageAction !== undefined) { - bodyParams["MessageAction"] = input.MessageAction; - } - if (input.TemporaryPassword !== undefined) { - bodyParams["TemporaryPassword"] = input.TemporaryPassword; - } - if (input.UserAttributes !== undefined) { - bodyParams["UserAttributes"] = serializeAws_json1_1AttributeListType( - input.UserAttributes, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - if (input.ValidationData !== undefined) { - bodyParams["ValidationData"] = serializeAws_json1_1AttributeListType( - input.ValidationData, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AdminDeleteUserAttributesRequest = ( input: AdminDeleteUserAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserAttributeNames !== undefined) { - bodyParams[ - "UserAttributeNames" - ] = serializeAws_json1_1AttributeNameListType( - input.UserAttributeNames, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.UserAttributeNames !== undefined && { + UserAttributeNames: serializeAws_json1_1AttributeNameListType( + input.UserAttributeNames, + context + ) + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminDeleteUserRequest = ( input: AdminDeleteUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminDisableProviderForUserRequest = ( input: AdminDisableProviderForUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.User !== undefined) { - bodyParams["User"] = serializeAws_json1_1ProviderUserIdentifierType( - input.User, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.User !== undefined && { + User: serializeAws_json1_1ProviderUserIdentifierType(input.User, context) + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1AdminDisableUserRequest = ( input: AdminDisableUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminEnableUserRequest = ( input: AdminEnableUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminForgetDeviceRequest = ( input: AdminForgetDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminGetDeviceRequest = ( input: AdminGetDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminGetUserRequest = ( input: AdminGetUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminInitiateAuthRequest = ( input: AdminInitiateAuthRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.AuthFlow !== undefined) { - bodyParams["AuthFlow"] = input.AuthFlow; - } - if (input.AuthParameters !== undefined) { - bodyParams["AuthParameters"] = serializeAws_json1_1AuthParametersType( - input.AuthParameters, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.ContextData !== undefined) { - bodyParams["ContextData"] = serializeAws_json1_1ContextDataType( - input.ContextData, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminLinkProviderForUserRequest = ( input: AdminLinkProviderForUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationUser !== undefined) { - bodyParams[ - "DestinationUser" - ] = serializeAws_json1_1ProviderUserIdentifierType( - input.DestinationUser, - context - ); - } - if (input.SourceUser !== undefined) { - bodyParams["SourceUser"] = serializeAws_json1_1ProviderUserIdentifierType( - input.SourceUser, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminListDevicesRequest = ( input: AdminListDevicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminListGroupsForUserRequest = ( input: AdminListGroupsForUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminListUserAuthEventsRequest = ( input: AdminListUserAuthEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminRemoveUserFromGroupRequest = ( input: AdminRemoveUserFromGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminResetUserPasswordRequest = ( input: AdminResetUserPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.ClientMetadata !== undefined && { + ClientMetadata: serializeAws_json1_1ClientMetadataType( + input.ClientMetadata, + context + ) + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminRespondToAuthChallengeRequest = ( input: AdminRespondToAuthChallengeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ChallengeName !== undefined) { - bodyParams["ChallengeName"] = input.ChallengeName; - } - if (input.ChallengeResponses !== undefined) { - bodyParams[ - "ChallengeResponses" - ] = serializeAws_json1_1ChallengeResponsesType( - input.ChallengeResponses, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.ContextData !== undefined) { - bodyParams["ContextData"] = serializeAws_json1_1ContextDataType( - input.ContextData, - context - ); - } - if (input.Session !== undefined) { - bodyParams["Session"] = input.Session; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminSetUserMFAPreferenceRequest = ( input: AdminSetUserMFAPreferenceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SMSMfaSettings !== undefined) { - bodyParams["SMSMfaSettings"] = serializeAws_json1_1SMSMfaSettingsType( - input.SMSMfaSettings, - context - ); - } - if (input.SoftwareTokenMfaSettings !== undefined) { - bodyParams[ - "SoftwareTokenMfaSettings" - ] = serializeAws_json1_1SoftwareTokenMfaSettingsType( - input.SoftwareTokenMfaSettings, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminSetUserPasswordRequest = ( input: AdminSetUserPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Permanent !== undefined) { - bodyParams["Permanent"] = input.Permanent; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminSetUserSettingsRequest = ( input: AdminSetUserSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MFAOptions !== undefined) { - bodyParams["MFAOptions"] = serializeAws_json1_1MFAOptionListType( - input.MFAOptions, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.MFAOptions !== undefined && { + MFAOptions: serializeAws_json1_1MFAOptionListType( + input.MFAOptions, + context + ) + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AdminUpdateAuthEventFeedbackRequest = ( input: AdminUpdateAuthEventFeedbackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventId !== undefined) { - bodyParams["EventId"] = input.EventId; - } - if (input.FeedbackValue !== undefined) { - bodyParams["FeedbackValue"] = input.FeedbackValue; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminUpdateDeviceStatusRequest = ( input: AdminUpdateDeviceStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - if (input.DeviceRememberedStatus !== undefined) { - bodyParams["DeviceRememberedStatus"] = input.DeviceRememberedStatus; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminUpdateUserAttributesRequest = ( input: AdminUpdateUserAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.UserAttributes !== undefined) { - bodyParams["UserAttributes"] = serializeAws_json1_1AttributeListType( - input.UserAttributes, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AdminUserGlobalSignOutRequest = ( input: AdminUserGlobalSignOutRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1AliasAttributesListType = ( @@ -17135,45 +16978,37 @@ const serializeAws_json1_1AnalyticsConfigurationType = ( input: AnalyticsConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationId !== undefined) { - bodyParams["ApplicationId"] = input.ApplicationId; - } - if (input.ExternalId !== undefined) { - bodyParams["ExternalId"] = input.ExternalId; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.UserDataShared !== undefined) { - bodyParams["UserDataShared"] = input.UserDataShared; - } - return bodyParams; + return { + ...(input.ApplicationId !== undefined && { + ApplicationId: input.ApplicationId + }), + ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.UserDataShared !== undefined && { + UserDataShared: input.UserDataShared + }) + }; }; const serializeAws_json1_1AnalyticsMetadataType = ( input: AnalyticsMetadataType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsEndpointId !== undefined) { - bodyParams["AnalyticsEndpointId"] = input.AnalyticsEndpointId; - } - return bodyParams; + return { + ...(input.AnalyticsEndpointId !== undefined && { + AnalyticsEndpointId: input.AnalyticsEndpointId + }) + }; }; const serializeAws_json1_1AssociateSoftwareTokenRequest = ( input: AssociateSoftwareTokenRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.Session !== undefined) { - bodyParams["Session"] = input.Session; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.Session !== undefined && { Session: input.Session }) + }; }; const serializeAws_json1_1AttributeListType = ( @@ -17204,14 +17039,10 @@ const serializeAws_json1_1AttributeType = ( input: AttributeType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1AuthParametersType = ( @@ -17252,17 +17083,15 @@ const serializeAws_json1_1ChangePasswordRequest = ( input: ChangePasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.PreviousPassword !== undefined) { - bodyParams["PreviousPassword"] = input.PreviousPassword; - } - if (input.ProposedPassword !== undefined) { - bodyParams["ProposedPassword"] = input.ProposedPassword; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.PreviousPassword !== undefined && { + PreviousPassword: input.PreviousPassword + }), + ...(input.ProposedPassword !== undefined && { + ProposedPassword: input.ProposedPassword + }) + }; }; const serializeAws_json1_1ClientMetadataType = ( @@ -17286,502 +17115,408 @@ const serializeAws_json1_1CompromisedCredentialsActionsType = ( input: CompromisedCredentialsActionsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventAction !== undefined) { - bodyParams["EventAction"] = input.EventAction; - } - return bodyParams; + return { + ...(input.EventAction !== undefined && { EventAction: input.EventAction }) + }; }; const serializeAws_json1_1CompromisedCredentialsRiskConfigurationType = ( input: CompromisedCredentialsRiskConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams[ - "Actions" - ] = serializeAws_json1_1CompromisedCredentialsActionsType( - input.Actions, - context - ); - } - if (input.EventFilter !== undefined) { - bodyParams["EventFilter"] = serializeAws_json1_1EventFiltersType( - input.EventFilter, - context - ); - } - return bodyParams; + return { + ...(input.Actions !== undefined && { + Actions: serializeAws_json1_1CompromisedCredentialsActionsType( + input.Actions, + context + ) + }), + ...(input.EventFilter !== undefined && { + EventFilter: serializeAws_json1_1EventFiltersType( + input.EventFilter, + context + ) + }) + }; }; const serializeAws_json1_1ConfirmDeviceRequest = ( input: ConfirmDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - if (input.DeviceName !== undefined) { - bodyParams["DeviceName"] = input.DeviceName; - } - if (input.DeviceSecretVerifierConfig !== undefined) { - bodyParams[ - "DeviceSecretVerifierConfig" - ] = serializeAws_json1_1DeviceSecretVerifierConfigType( - input.DeviceSecretVerifierConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ConfirmForgotPasswordRequest = ( input: ConfirmForgotPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.ConfirmationCode !== undefined) { - bodyParams["ConfirmationCode"] = input.ConfirmationCode; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.SecretHash !== undefined) { - bodyParams["SecretHash"] = input.SecretHash; - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ConfirmSignUpRequest = ( input: ConfirmSignUpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.ConfirmationCode !== undefined) { - bodyParams["ConfirmationCode"] = input.ConfirmationCode; - } - if (input.ForceAliasCreation !== undefined) { - bodyParams["ForceAliasCreation"] = input.ForceAliasCreation; - } - if (input.SecretHash !== undefined) { - bodyParams["SecretHash"] = input.SecretHash; - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ContextDataType = ( input: ContextDataType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncodedData !== undefined) { - bodyParams["EncodedData"] = input.EncodedData; - } - if (input.HttpHeaders !== undefined) { - bodyParams["HttpHeaders"] = serializeAws_json1_1HttpHeaderList( - input.HttpHeaders, - context - ); - } - if (input.IpAddress !== undefined) { - bodyParams["IpAddress"] = input.IpAddress; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.ServerPath !== undefined) { - bodyParams["ServerPath"] = input.ServerPath; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateGroupRequest = ( input: CreateGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.Precedence !== undefined) { - bodyParams["Precedence"] = input.Precedence; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateIdentityProviderRequest = ( input: CreateIdentityProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeMapping !== undefined) { - bodyParams["AttributeMapping"] = serializeAws_json1_1AttributeMappingType( - input.AttributeMapping, - context - ); - } - if (input.IdpIdentifiers !== undefined) { - bodyParams["IdpIdentifiers"] = serializeAws_json1_1IdpIdentifiersListType( - input.IdpIdentifiers, - context - ); - } - if (input.ProviderDetails !== undefined) { - bodyParams["ProviderDetails"] = serializeAws_json1_1ProviderDetailsType( - input.ProviderDetails, - context - ); - } - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.ProviderType !== undefined) { - bodyParams["ProviderType"] = input.ProviderType; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateResourceServerRequest = ( input: CreateResourceServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scopes !== undefined) { - bodyParams["Scopes"] = serializeAws_json1_1ResourceServerScopeListType( - input.Scopes, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateUserImportJobRequest = ( input: CreateUserImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogsRoleArn !== undefined) { - bodyParams["CloudWatchLogsRoleArn"] = input.CloudWatchLogsRoleArn; - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.CloudWatchLogsRoleArn !== undefined && { + CloudWatchLogsRoleArn: input.CloudWatchLogsRoleArn + }), + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1CreateUserPoolClientRequest = ( input: CreateUserPoolClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowedOAuthFlows !== undefined) { - bodyParams["AllowedOAuthFlows"] = serializeAws_json1_1OAuthFlowsType( - input.AllowedOAuthFlows, - context - ); - } - if (input.AllowedOAuthFlowsUserPoolClient !== undefined) { - bodyParams["AllowedOAuthFlowsUserPoolClient"] = - input.AllowedOAuthFlowsUserPoolClient; - } - if (input.AllowedOAuthScopes !== undefined) { - bodyParams["AllowedOAuthScopes"] = serializeAws_json1_1ScopeListType( - input.AllowedOAuthScopes, - context - ); - } - if (input.AnalyticsConfiguration !== undefined) { - bodyParams[ - "AnalyticsConfiguration" - ] = serializeAws_json1_1AnalyticsConfigurationType( - input.AnalyticsConfiguration, - context - ); - } - if (input.CallbackURLs !== undefined) { - bodyParams["CallbackURLs"] = serializeAws_json1_1CallbackURLsListType( - input.CallbackURLs, - context - ); - } - if (input.ClientName !== undefined) { - bodyParams["ClientName"] = input.ClientName; - } - if (input.DefaultRedirectURI !== undefined) { - bodyParams["DefaultRedirectURI"] = input.DefaultRedirectURI; - } - if (input.ExplicitAuthFlows !== undefined) { - bodyParams[ - "ExplicitAuthFlows" - ] = serializeAws_json1_1ExplicitAuthFlowsListType( - input.ExplicitAuthFlows, - context - ); - } - if (input.GenerateSecret !== undefined) { - bodyParams["GenerateSecret"] = input.GenerateSecret; - } - if (input.LogoutURLs !== undefined) { - bodyParams["LogoutURLs"] = serializeAws_json1_1LogoutURLsListType( - input.LogoutURLs, - context - ); - } - if (input.PreventUserExistenceErrors !== undefined) { - bodyParams["PreventUserExistenceErrors"] = input.PreventUserExistenceErrors; - } - if (input.ReadAttributes !== undefined) { - bodyParams["ReadAttributes"] = serializeAws_json1_1ClientPermissionListType( - input.ReadAttributes, - context - ); - } - if (input.RefreshTokenValidity !== undefined) { - bodyParams["RefreshTokenValidity"] = input.RefreshTokenValidity; - } - if (input.SupportedIdentityProviders !== undefined) { - bodyParams[ - "SupportedIdentityProviders" - ] = serializeAws_json1_1SupportedIdentityProvidersListType( - input.SupportedIdentityProviders, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.WriteAttributes !== undefined) { - bodyParams[ - "WriteAttributes" - ] = serializeAws_json1_1ClientPermissionListType( - input.WriteAttributes, - context - ); - } - return bodyParams; + return { + ...(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.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.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.WriteAttributes !== undefined && { + WriteAttributes: serializeAws_json1_1ClientPermissionListType( + input.WriteAttributes, + context + ) + }) + }; }; const serializeAws_json1_1CreateUserPoolDomainRequest = ( input: CreateUserPoolDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomDomainConfig !== undefined) { - bodyParams[ - "CustomDomainConfig" - ] = serializeAws_json1_1CustomDomainConfigType( - input.CustomDomainConfig, - context - ); - } - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.CustomDomainConfig !== undefined && { + CustomDomainConfig: serializeAws_json1_1CustomDomainConfigType( + input.CustomDomainConfig, + context + ) + }), + ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1CreateUserPoolRequest = ( input: CreateUserPoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountRecoverySetting !== undefined) { - bodyParams[ - "AccountRecoverySetting" - ] = serializeAws_json1_1AccountRecoverySettingType( - input.AccountRecoverySetting, - context - ); - } - if (input.AdminCreateUserConfig !== undefined) { - bodyParams[ - "AdminCreateUserConfig" - ] = serializeAws_json1_1AdminCreateUserConfigType( - input.AdminCreateUserConfig, - context - ); - } - if (input.AliasAttributes !== undefined) { - bodyParams["AliasAttributes"] = serializeAws_json1_1AliasAttributesListType( - input.AliasAttributes, - context - ); - } - if (input.AutoVerifiedAttributes !== undefined) { - bodyParams[ - "AutoVerifiedAttributes" - ] = serializeAws_json1_1VerifiedAttributesListType( - input.AutoVerifiedAttributes, - context - ); - } - if (input.DeviceConfiguration !== undefined) { - bodyParams[ - "DeviceConfiguration" - ] = serializeAws_json1_1DeviceConfigurationType( - input.DeviceConfiguration, - context - ); - } - if (input.EmailConfiguration !== undefined) { - bodyParams[ - "EmailConfiguration" - ] = serializeAws_json1_1EmailConfigurationType( - input.EmailConfiguration, - context - ); - } - if (input.EmailVerificationMessage !== undefined) { - bodyParams["EmailVerificationMessage"] = input.EmailVerificationMessage; - } - if (input.EmailVerificationSubject !== undefined) { - bodyParams["EmailVerificationSubject"] = input.EmailVerificationSubject; - } - if (input.LambdaConfig !== undefined) { - bodyParams["LambdaConfig"] = serializeAws_json1_1LambdaConfigType( - input.LambdaConfig, - context - ); - } - if (input.MfaConfiguration !== undefined) { - bodyParams["MfaConfiguration"] = input.MfaConfiguration; - } - if (input.Policies !== undefined) { - bodyParams["Policies"] = serializeAws_json1_1UserPoolPolicyType( - input.Policies, - context - ); - } - if (input.PoolName !== undefined) { - bodyParams["PoolName"] = input.PoolName; - } - if (input.Schema !== undefined) { - bodyParams["Schema"] = serializeAws_json1_1SchemaAttributesListType( - input.Schema, - context - ); - } - if (input.SmsAuthenticationMessage !== undefined) { - bodyParams["SmsAuthenticationMessage"] = input.SmsAuthenticationMessage; - } - if (input.SmsConfiguration !== undefined) { - bodyParams["SmsConfiguration"] = serializeAws_json1_1SmsConfigurationType( - input.SmsConfiguration, - context - ); - } - if (input.SmsVerificationMessage !== undefined) { - bodyParams["SmsVerificationMessage"] = input.SmsVerificationMessage; - } - if (input.UserPoolAddOns !== undefined) { - bodyParams["UserPoolAddOns"] = serializeAws_json1_1UserPoolAddOnsType( - input.UserPoolAddOns, - context - ); - } - if (input.UserPoolTags !== undefined) { - bodyParams["UserPoolTags"] = serializeAws_json1_1UserPoolTagsType( - input.UserPoolTags, - context - ); - } - if (input.UsernameAttributes !== undefined) { - bodyParams[ - "UsernameAttributes" - ] = serializeAws_json1_1UsernameAttributesListType( - input.UsernameAttributes, - context - ); - } - if (input.VerificationMessageTemplate !== undefined) { - bodyParams[ - "VerificationMessageTemplate" - ] = serializeAws_json1_1VerificationMessageTemplateType( - input.VerificationMessageTemplate, - context - ); - } - return bodyParams; + 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.VerificationMessageTemplate !== undefined && { + VerificationMessageTemplate: serializeAws_json1_1VerificationMessageTemplateType( + input.VerificationMessageTemplate, + context + ) + }) + }; }; const serializeAws_json1_1CustomAttributesListType = ( @@ -17797,122 +17532,96 @@ const serializeAws_json1_1CustomDomainConfigType = ( input: CustomDomainConfigType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1DeleteGroupRequest = ( input: DeleteGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeleteIdentityProviderRequest = ( input: DeleteIdentityProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.ProviderName !== undefined && { + ProviderName: input.ProviderName + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeleteResourceServerRequest = ( input: DeleteResourceServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.Identifier !== undefined && { Identifier: input.Identifier }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeleteUserAttributesRequest = ( input: DeleteUserAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.UserAttributeNames !== undefined) { - bodyParams[ - "UserAttributeNames" - ] = serializeAws_json1_1AttributeNameListType( - input.UserAttributeNames, - context - ); - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.UserAttributeNames !== undefined && { + UserAttributeNames: serializeAws_json1_1AttributeNameListType( + input.UserAttributeNames, + context + ) + }) + }; }; const serializeAws_json1_1DeleteUserPoolClientRequest = ( input: DeleteUserPoolClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeleteUserPoolDomainRequest = ( input: DeleteUserPoolDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeleteUserPoolRequest = ( input: DeleteUserPoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeleteUserRequest = ( input: DeleteUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }) + }; }; const serializeAws_json1_1DeliveryMediumListType = ( @@ -17926,145 +17635,115 @@ const serializeAws_json1_1DescribeIdentityProviderRequest = ( input: DescribeIdentityProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.ProviderName !== undefined && { + ProviderName: input.ProviderName + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DescribeResourceServerRequest = ( input: DescribeResourceServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.Identifier !== undefined && { Identifier: input.Identifier }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DescribeRiskConfigurationRequest = ( input: DescribeRiskConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DescribeUserImportJobRequest = ( input: DescribeUserImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DescribeUserPoolClientRequest = ( input: DescribeUserPoolClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DescribeUserPoolDomainRequest = ( input: DescribeUserPoolDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - return bodyParams; + return { + ...(input.Domain !== undefined && { Domain: input.Domain }) + }; }; const serializeAws_json1_1DescribeUserPoolRequest = ( input: DescribeUserPoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1DeviceConfigurationType = ( input: DeviceConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChallengeRequiredOnNewDevice !== undefined) { - bodyParams["ChallengeRequiredOnNewDevice"] = - input.ChallengeRequiredOnNewDevice; - } - if (input.DeviceOnlyRememberedOnUserPrompt !== undefined) { - bodyParams["DeviceOnlyRememberedOnUserPrompt"] = - input.DeviceOnlyRememberedOnUserPrompt; - } - return bodyParams; + return { + ...(input.ChallengeRequiredOnNewDevice !== undefined && { + ChallengeRequiredOnNewDevice: input.ChallengeRequiredOnNewDevice + }), + ...(input.DeviceOnlyRememberedOnUserPrompt !== undefined && { + DeviceOnlyRememberedOnUserPrompt: input.DeviceOnlyRememberedOnUserPrompt + }) + }; }; const serializeAws_json1_1DeviceSecretVerifierConfigType = ( input: DeviceSecretVerifierConfigType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PasswordVerifier !== undefined) { - bodyParams["PasswordVerifier"] = input.PasswordVerifier; - } - if (input.Salt !== undefined) { - bodyParams["Salt"] = input.Salt; - } - return bodyParams; + return { + ...(input.PasswordVerifier !== undefined && { + PasswordVerifier: input.PasswordVerifier + }), + ...(input.Salt !== undefined && { Salt: input.Salt }) + }; }; const serializeAws_json1_1EmailConfigurationType = ( input: EmailConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationSet !== undefined) { - bodyParams["ConfigurationSet"] = input.ConfigurationSet; - } - if (input.EmailSendingAccount !== undefined) { - bodyParams["EmailSendingAccount"] = input.EmailSendingAccount; - } - if (input.From !== undefined) { - bodyParams["From"] = input.From; - } - if (input.ReplyToEmailAddress !== undefined) { - bodyParams["ReplyToEmailAddress"] = input.ReplyToEmailAddress; - } - if (input.SourceArn !== undefined) { - bodyParams["SourceArn"] = input.SourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EventFiltersType = ( @@ -18085,194 +17764,154 @@ const serializeAws_json1_1ForgetDeviceRequest = ( input: ForgetDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }) + }; }; const serializeAws_json1_1ForgotPasswordRequest = ( input: ForgotPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.SecretHash !== undefined) { - bodyParams["SecretHash"] = input.SecretHash; - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetCSVHeaderRequest = ( input: GetCSVHeaderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1GetDeviceRequest = ( input: GetDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }) + }; }; const serializeAws_json1_1GetGroupRequest = ( input: GetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.GroupName !== undefined && { GroupName: input.GroupName }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1GetIdentityProviderByIdentifierRequest = ( input: GetIdentityProviderByIdentifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdpIdentifier !== undefined) { - bodyParams["IdpIdentifier"] = input.IdpIdentifier; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.IdpIdentifier !== undefined && { + IdpIdentifier: input.IdpIdentifier + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1GetSigningCertificateRequest = ( input: GetSigningCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1GetUICustomizationRequest = ( input: GetUICustomizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1GetUserAttributeVerificationCodeRequest = ( input: GetUserAttributeVerificationCodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.ClientMetadata !== undefined && { + ClientMetadata: serializeAws_json1_1ClientMetadataType( + input.ClientMetadata, + context + ) + }) + }; }; const serializeAws_json1_1GetUserPoolMfaConfigRequest = ( input: GetUserPoolMfaConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1GetUserRequest = ( input: GetUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }) + }; }; const serializeAws_json1_1GlobalSignOutRequest = ( input: GlobalSignOutRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }) + }; }; const serializeAws_json1_1HttpHeader = ( input: HttpHeader, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.headerName !== undefined) { - bodyParams["headerName"] = input.headerName; - } - if (input.headerValue !== undefined) { - bodyParams["headerValue"] = input.headerValue; - } - return bodyParams; + return { + ...(input.headerName !== undefined && { headerName: input.headerName }), + ...(input.headerValue !== undefined && { headerValue: input.headerValue }) + }; }; const serializeAws_json1_1HttpHeaderList = ( @@ -18293,252 +17932,191 @@ const serializeAws_json1_1InitiateAuthRequest = ( input: InitiateAuthRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.AuthFlow !== undefined) { - bodyParams["AuthFlow"] = input.AuthFlow; - } - if (input.AuthParameters !== undefined) { - bodyParams["AuthParameters"] = serializeAws_json1_1AuthParametersType( - input.AuthParameters, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1LambdaConfigType = ( input: LambdaConfigType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreateAuthChallenge !== undefined) { - bodyParams["CreateAuthChallenge"] = input.CreateAuthChallenge; - } - if (input.CustomMessage !== undefined) { - bodyParams["CustomMessage"] = input.CustomMessage; - } - if (input.DefineAuthChallenge !== undefined) { - bodyParams["DefineAuthChallenge"] = input.DefineAuthChallenge; - } - if (input.PostAuthentication !== undefined) { - bodyParams["PostAuthentication"] = input.PostAuthentication; - } - if (input.PostConfirmation !== undefined) { - bodyParams["PostConfirmation"] = input.PostConfirmation; - } - if (input.PreAuthentication !== undefined) { - bodyParams["PreAuthentication"] = input.PreAuthentication; - } - if (input.PreSignUp !== undefined) { - bodyParams["PreSignUp"] = input.PreSignUp; - } - if (input.PreTokenGeneration !== undefined) { - bodyParams["PreTokenGeneration"] = input.PreTokenGeneration; - } - if (input.UserMigration !== undefined) { - bodyParams["UserMigration"] = input.UserMigration; - } - if (input.VerifyAuthChallengeResponse !== undefined) { - bodyParams["VerifyAuthChallengeResponse"] = - input.VerifyAuthChallengeResponse; - } - return bodyParams; + return { + ...(input.CreateAuthChallenge !== undefined && { + CreateAuthChallenge: input.CreateAuthChallenge + }), + ...(input.CustomMessage !== undefined && { + CustomMessage: input.CustomMessage + }), + ...(input.DefineAuthChallenge !== undefined && { + DefineAuthChallenge: input.DefineAuthChallenge + }), + ...(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 + }) + }; }; const serializeAws_json1_1ListDevicesRequest = ( input: ListDevicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.PaginationToken !== undefined && { + PaginationToken: input.PaginationToken + }) + }; }; const serializeAws_json1_1ListGroupsRequest = ( input: ListGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1ListIdentityProvidersRequest = ( input: ListIdentityProvidersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1ListResourceServersRequest = ( input: ListResourceServersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListUserImportJobsRequest = ( input: ListUserImportJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && { + PaginationToken: input.PaginationToken + }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1ListUserPoolClientsRequest = ( input: ListUserPoolClientsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1ListUserPoolsRequest = ( input: ListUserPoolsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListUsersInGroupRequest = ( input: ListUsersInGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListUsersRequest = ( input: ListUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributesToGet !== undefined) { - bodyParams[ - "AttributesToGet" - ] = serializeAws_json1_1SearchedAttributeNamesListType( - input.AttributesToGet, - context - ); - } - if (input.Filter !== undefined) { - bodyParams["Filter"] = input.Filter; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1LogoutURLsListType = ( @@ -18559,97 +18137,73 @@ const serializeAws_json1_1MFAOptionType = ( input: MFAOptionType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.DeliveryMedium !== undefined) { - bodyParams["DeliveryMedium"] = input.DeliveryMedium; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.DeliveryMedium !== undefined && { + DeliveryMedium: input.DeliveryMedium + }) + }; }; const serializeAws_json1_1MessageTemplateType = ( input: MessageTemplateType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EmailMessage !== undefined) { - bodyParams["EmailMessage"] = input.EmailMessage; - } - if (input.EmailSubject !== undefined) { - bodyParams["EmailSubject"] = input.EmailSubject; - } - if (input.SMSMessage !== undefined) { - bodyParams["SMSMessage"] = input.SMSMessage; - } - return bodyParams; + return { + ...(input.EmailMessage !== undefined && { + EmailMessage: input.EmailMessage + }), + ...(input.EmailSubject !== undefined && { + EmailSubject: input.EmailSubject + }), + ...(input.SMSMessage !== undefined && { SMSMessage: input.SMSMessage }) + }; }; const serializeAws_json1_1NotifyConfigurationType = ( input: NotifyConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockEmail !== undefined) { - bodyParams["BlockEmail"] = serializeAws_json1_1NotifyEmailType( - input.BlockEmail, - context - ); - } - if (input.From !== undefined) { - bodyParams["From"] = input.From; - } - if (input.MfaEmail !== undefined) { - bodyParams["MfaEmail"] = serializeAws_json1_1NotifyEmailType( - input.MfaEmail, - context - ); - } - if (input.NoActionEmail !== undefined) { - bodyParams["NoActionEmail"] = serializeAws_json1_1NotifyEmailType( - input.NoActionEmail, - context - ); - } - if (input.ReplyTo !== undefined) { - bodyParams["ReplyTo"] = input.ReplyTo; - } - if (input.SourceArn !== undefined) { - bodyParams["SourceArn"] = input.SourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NotifyEmailType = ( input: NotifyEmailType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HtmlBody !== undefined) { - bodyParams["HtmlBody"] = input.HtmlBody; - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = input.Subject; - } - if (input.TextBody !== undefined) { - bodyParams["TextBody"] = input.TextBody; - } - return bodyParams; + return { + ...(input.HtmlBody !== undefined && { HtmlBody: input.HtmlBody }), + ...(input.Subject !== undefined && { Subject: input.Subject }), + ...(input.TextBody !== undefined && { TextBody: input.TextBody }) + }; }; const serializeAws_json1_1NumberAttributeConstraintsType = ( input: NumberAttributeConstraintsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - return bodyParams; + return { + ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && { MinValue: input.MinValue }) + }; }; const serializeAws_json1_1OAuthFlowsType = ( @@ -18663,27 +18217,26 @@ const serializeAws_json1_1PasswordPolicyType = ( input: PasswordPolicyType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MinimumLength !== undefined) { - bodyParams["MinimumLength"] = input.MinimumLength; - } - if (input.RequireLowercase !== undefined) { - bodyParams["RequireLowercase"] = input.RequireLowercase; - } - if (input.RequireNumbers !== undefined) { - bodyParams["RequireNumbers"] = input.RequireNumbers; - } - if (input.RequireSymbols !== undefined) { - bodyParams["RequireSymbols"] = input.RequireSymbols; - } - if (input.RequireUppercase !== undefined) { - bodyParams["RequireUppercase"] = input.RequireUppercase; - } - if (input.TemporaryPasswordValidityDays !== undefined) { - bodyParams["TemporaryPasswordValidityDays"] = - input.TemporaryPasswordValidityDays; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ProviderDetailsType = ( @@ -18700,17 +18253,17 @@ const serializeAws_json1_1ProviderUserIdentifierType = ( input: ProviderUserIdentifierType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProviderAttributeName !== undefined) { - bodyParams["ProviderAttributeName"] = input.ProviderAttributeName; - } - if (input.ProviderAttributeValue !== undefined) { - bodyParams["ProviderAttributeValue"] = input.ProviderAttributeValue; - } - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - return bodyParams; + return { + ...(input.ProviderAttributeName !== undefined && { + ProviderAttributeName: input.ProviderAttributeName + }), + ...(input.ProviderAttributeValue !== undefined && { + ProviderAttributeValue: input.ProviderAttributeValue + }), + ...(input.ProviderName !== undefined && { + ProviderName: input.ProviderName + }) + }; }; const serializeAws_json1_1RecoveryMechanismsType = ( @@ -18726,49 +18279,39 @@ const serializeAws_json1_1RecoveryOptionType = ( input: RecoveryOptionType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Priority !== undefined && { Priority: input.Priority }) + }; }; const serializeAws_json1_1ResendConfirmationCodeRequest = ( input: ResendConfirmationCodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.SecretHash !== undefined) { - bodyParams["SecretHash"] = input.SecretHash; - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ResourceServerScopeListType = ( @@ -18784,134 +18327,110 @@ const serializeAws_json1_1ResourceServerScopeType = ( input: ResourceServerScopeType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScopeDescription !== undefined) { - bodyParams["ScopeDescription"] = input.ScopeDescription; - } - if (input.ScopeName !== undefined) { - bodyParams["ScopeName"] = input.ScopeName; - } - return bodyParams; + return { + ...(input.ScopeDescription !== undefined && { + ScopeDescription: input.ScopeDescription + }), + ...(input.ScopeName !== undefined && { ScopeName: input.ScopeName }) + }; }; const serializeAws_json1_1RespondToAuthChallengeRequest = ( input: RespondToAuthChallengeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ChallengeName !== undefined) { - bodyParams["ChallengeName"] = input.ChallengeName; - } - if (input.ChallengeResponses !== undefined) { - bodyParams[ - "ChallengeResponses" - ] = serializeAws_json1_1ChallengeResponsesType( - input.ChallengeResponses, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.Session !== undefined) { - bodyParams["Session"] = input.Session; - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RiskExceptionConfigurationType = ( input: RiskExceptionConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockedIPRangeList !== undefined) { - bodyParams[ - "BlockedIPRangeList" - ] = serializeAws_json1_1BlockedIPRangeListType( - input.BlockedIPRangeList, - context - ); - } - if (input.SkippedIPRangeList !== undefined) { - bodyParams[ - "SkippedIPRangeList" - ] = serializeAws_json1_1SkippedIPRangeListType( - input.SkippedIPRangeList, - context - ); - } - return bodyParams; + return { + ...(input.BlockedIPRangeList !== undefined && { + BlockedIPRangeList: serializeAws_json1_1BlockedIPRangeListType( + input.BlockedIPRangeList, + context + ) + }), + ...(input.SkippedIPRangeList !== undefined && { + SkippedIPRangeList: serializeAws_json1_1SkippedIPRangeListType( + input.SkippedIPRangeList, + context + ) + }) + }; }; const serializeAws_json1_1SMSMfaSettingsType = ( input: SMSMfaSettingsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.PreferredMfa !== undefined) { - bodyParams["PreferredMfa"] = input.PreferredMfa; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.PreferredMfa !== undefined && { + PreferredMfa: input.PreferredMfa + }) + }; }; const serializeAws_json1_1SchemaAttributeType = ( input: SchemaAttributeType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeDataType !== undefined) { - bodyParams["AttributeDataType"] = input.AttributeDataType; - } - if (input.DeveloperOnlyAttribute !== undefined) { - bodyParams["DeveloperOnlyAttribute"] = input.DeveloperOnlyAttribute; - } - if (input.Mutable !== undefined) { - bodyParams["Mutable"] = input.Mutable; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NumberAttributeConstraints !== undefined) { - bodyParams[ - "NumberAttributeConstraints" - ] = serializeAws_json1_1NumberAttributeConstraintsType( - input.NumberAttributeConstraints, - context - ); - } - if (input.Required !== undefined) { - bodyParams["Required"] = input.Required; - } - if (input.StringAttributeConstraints !== undefined) { - bodyParams[ - "StringAttributeConstraints" - ] = serializeAws_json1_1StringAttributeConstraintsType( - input.StringAttributeConstraints, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SchemaAttributesListType = ( @@ -18941,178 +18460,144 @@ const serializeAws_json1_1SetRiskConfigurationRequest = ( input: SetRiskConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountTakeoverRiskConfiguration !== undefined) { - bodyParams[ - "AccountTakeoverRiskConfiguration" - ] = serializeAws_json1_1AccountTakeoverRiskConfigurationType( - input.AccountTakeoverRiskConfiguration, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.CompromisedCredentialsRiskConfiguration !== undefined) { - bodyParams[ - "CompromisedCredentialsRiskConfiguration" - ] = serializeAws_json1_1CompromisedCredentialsRiskConfigurationType( - input.CompromisedCredentialsRiskConfiguration, - context - ); - } - if (input.RiskExceptionConfiguration !== undefined) { - bodyParams[ - "RiskExceptionConfiguration" - ] = serializeAws_json1_1RiskExceptionConfigurationType( - input.RiskExceptionConfiguration, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SetUICustomizationRequest = ( input: SetUICustomizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CSS !== undefined) { - bodyParams["CSS"] = input.CSS; - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ImageFile !== undefined) { - bodyParams["ImageFile"] = context.base64Encoder(input.ImageFile); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SetUserMFAPreferenceRequest = ( input: SetUserMFAPreferenceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.SMSMfaSettings !== undefined) { - bodyParams["SMSMfaSettings"] = serializeAws_json1_1SMSMfaSettingsType( - input.SMSMfaSettings, - context - ); - } - if (input.SoftwareTokenMfaSettings !== undefined) { - bodyParams[ - "SoftwareTokenMfaSettings" - ] = serializeAws_json1_1SoftwareTokenMfaSettingsType( - input.SoftwareTokenMfaSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SetUserPoolMfaConfigRequest = ( input: SetUserPoolMfaConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MfaConfiguration !== undefined) { - bodyParams["MfaConfiguration"] = input.MfaConfiguration; - } - if (input.SmsMfaConfiguration !== undefined) { - bodyParams["SmsMfaConfiguration"] = serializeAws_json1_1SmsMfaConfigType( - input.SmsMfaConfiguration, - context - ); - } - if (input.SoftwareTokenMfaConfiguration !== undefined) { - bodyParams[ - "SoftwareTokenMfaConfiguration" - ] = serializeAws_json1_1SoftwareTokenMfaConfigType( - input.SoftwareTokenMfaConfiguration, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SetUserSettingsRequest = ( input: SetUserSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.MFAOptions !== undefined) { - bodyParams["MFAOptions"] = serializeAws_json1_1MFAOptionListType( - input.MFAOptions, - context - ); - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.MFAOptions !== undefined && { + MFAOptions: serializeAws_json1_1MFAOptionListType( + input.MFAOptions, + context + ) + }) + }; }; const serializeAws_json1_1SignUpRequest = ( input: SignUpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnalyticsMetadata !== undefined) { - bodyParams["AnalyticsMetadata"] = serializeAws_json1_1AnalyticsMetadataType( - input.AnalyticsMetadata, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.SecretHash !== undefined) { - bodyParams["SecretHash"] = input.SecretHash; - } - if (input.UserAttributes !== undefined) { - bodyParams["UserAttributes"] = serializeAws_json1_1AttributeListType( - input.UserAttributes, - context - ); - } - if (input.UserContextData !== undefined) { - bodyParams["UserContextData"] = serializeAws_json1_1UserContextDataType( - input.UserContextData, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - if (input.ValidationData !== undefined) { - bodyParams["ValidationData"] = serializeAws_json1_1AttributeListType( - input.ValidationData, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SkippedIPRangeListType = ( @@ -19126,98 +18611,80 @@ const serializeAws_json1_1SmsConfigurationType = ( input: SmsConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExternalId !== undefined) { - bodyParams["ExternalId"] = input.ExternalId; - } - if (input.SnsCallerArn !== undefined) { - bodyParams["SnsCallerArn"] = input.SnsCallerArn; - } - return bodyParams; + return { + ...(input.ExternalId !== undefined && { ExternalId: input.ExternalId }), + ...(input.SnsCallerArn !== undefined && { + SnsCallerArn: input.SnsCallerArn + }) + }; }; const serializeAws_json1_1SmsMfaConfigType = ( input: SmsMfaConfigType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SmsAuthenticationMessage !== undefined) { - bodyParams["SmsAuthenticationMessage"] = input.SmsAuthenticationMessage; - } - if (input.SmsConfiguration !== undefined) { - bodyParams["SmsConfiguration"] = serializeAws_json1_1SmsConfigurationType( - input.SmsConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.SmsAuthenticationMessage !== undefined && { + SmsAuthenticationMessage: input.SmsAuthenticationMessage + }), + ...(input.SmsConfiguration !== undefined && { + SmsConfiguration: serializeAws_json1_1SmsConfigurationType( + input.SmsConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1SoftwareTokenMfaConfigType = ( input: SoftwareTokenMfaConfigType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_json1_1SoftwareTokenMfaSettingsType = ( input: SoftwareTokenMfaSettingsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.PreferredMfa !== undefined) { - bodyParams["PreferredMfa"] = input.PreferredMfa; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.PreferredMfa !== undefined && { + PreferredMfa: input.PreferredMfa + }) + }; }; const serializeAws_json1_1StartUserImportJobRequest = ( input: StartUserImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1StopUserImportJobRequest = ( input: StopUserImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1StringAttributeConstraintsType = ( input: StringAttributeConstraintsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxLength !== undefined) { - bodyParams["MaxLength"] = input.MaxLength; - } - if (input.MinLength !== undefined) { - bodyParams["MinLength"] = input.MinLength; - } - return bodyParams; + return { + ...(input.MaxLength !== undefined && { MaxLength: input.MaxLength }), + ...(input.MinLength !== undefined && { MinLength: input.MinLength }) + }; }; const serializeAws_json1_1SupportedIdentityProvidersListType = ( @@ -19231,429 +18698,349 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1UserPoolTagsType( - input.Tags, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1UserPoolTagsType(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1UserPoolTagsListType( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1UserPoolTagsListType(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateAuthEventFeedbackRequest = ( input: UpdateAuthEventFeedbackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventId !== undefined) { - bodyParams["EventId"] = input.EventId; - } - if (input.FeedbackToken !== undefined) { - bodyParams["FeedbackToken"] = input.FeedbackToken; - } - if (input.FeedbackValue !== undefined) { - bodyParams["FeedbackValue"] = input.FeedbackValue; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateDeviceStatusRequest = ( input: UpdateDeviceStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.DeviceKey !== undefined) { - bodyParams["DeviceKey"] = input.DeviceKey; - } - if (input.DeviceRememberedStatus !== undefined) { - bodyParams["DeviceRememberedStatus"] = input.DeviceRememberedStatus; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.DeviceKey !== undefined && { DeviceKey: input.DeviceKey }), + ...(input.DeviceRememberedStatus !== undefined && { + DeviceRememberedStatus: input.DeviceRememberedStatus + }) + }; }; const serializeAws_json1_1UpdateGroupRequest = ( input: UpdateGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.Precedence !== undefined) { - bodyParams["Precedence"] = input.Precedence; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateIdentityProviderRequest = ( input: UpdateIdentityProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeMapping !== undefined) { - bodyParams["AttributeMapping"] = serializeAws_json1_1AttributeMappingType( - input.AttributeMapping, - context - ); - } - if (input.IdpIdentifiers !== undefined) { - bodyParams["IdpIdentifiers"] = serializeAws_json1_1IdpIdentifiersListType( - input.IdpIdentifiers, - context - ); - } - if (input.ProviderDetails !== undefined) { - bodyParams["ProviderDetails"] = serializeAws_json1_1ProviderDetailsType( - input.ProviderDetails, - context - ); - } - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateResourceServerRequest = ( input: UpdateResourceServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scopes !== undefined) { - bodyParams["Scopes"] = serializeAws_json1_1ResourceServerScopeListType( - input.Scopes, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateUserAttributesRequest = ( input: UpdateUserAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.ClientMetadata !== undefined) { - bodyParams["ClientMetadata"] = serializeAws_json1_1ClientMetadataType( - input.ClientMetadata, - context - ); - } - if (input.UserAttributes !== undefined) { - bodyParams["UserAttributes"] = serializeAws_json1_1AttributeListType( - input.UserAttributes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateUserPoolClientRequest = ( input: UpdateUserPoolClientRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowedOAuthFlows !== undefined) { - bodyParams["AllowedOAuthFlows"] = serializeAws_json1_1OAuthFlowsType( - input.AllowedOAuthFlows, - context - ); - } - if (input.AllowedOAuthFlowsUserPoolClient !== undefined) { - bodyParams["AllowedOAuthFlowsUserPoolClient"] = - input.AllowedOAuthFlowsUserPoolClient; - } - if (input.AllowedOAuthScopes !== undefined) { - bodyParams["AllowedOAuthScopes"] = serializeAws_json1_1ScopeListType( - input.AllowedOAuthScopes, - context - ); - } - if (input.AnalyticsConfiguration !== undefined) { - bodyParams[ - "AnalyticsConfiguration" - ] = serializeAws_json1_1AnalyticsConfigurationType( - input.AnalyticsConfiguration, - context - ); - } - if (input.CallbackURLs !== undefined) { - bodyParams["CallbackURLs"] = serializeAws_json1_1CallbackURLsListType( - input.CallbackURLs, - context - ); - } - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientName !== undefined) { - bodyParams["ClientName"] = input.ClientName; - } - if (input.DefaultRedirectURI !== undefined) { - bodyParams["DefaultRedirectURI"] = input.DefaultRedirectURI; - } - if (input.ExplicitAuthFlows !== undefined) { - bodyParams[ - "ExplicitAuthFlows" - ] = serializeAws_json1_1ExplicitAuthFlowsListType( - input.ExplicitAuthFlows, - context - ); - } - if (input.LogoutURLs !== undefined) { - bodyParams["LogoutURLs"] = serializeAws_json1_1LogoutURLsListType( - input.LogoutURLs, - context - ); - } - if (input.PreventUserExistenceErrors !== undefined) { - bodyParams["PreventUserExistenceErrors"] = input.PreventUserExistenceErrors; - } - if (input.ReadAttributes !== undefined) { - bodyParams["ReadAttributes"] = serializeAws_json1_1ClientPermissionListType( - input.ReadAttributes, - context - ); - } - if (input.RefreshTokenValidity !== undefined) { - bodyParams["RefreshTokenValidity"] = input.RefreshTokenValidity; - } - if (input.SupportedIdentityProviders !== undefined) { - bodyParams[ - "SupportedIdentityProviders" - ] = serializeAws_json1_1SupportedIdentityProvidersListType( - input.SupportedIdentityProviders, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.WriteAttributes !== undefined) { - bodyParams[ - "WriteAttributes" - ] = serializeAws_json1_1ClientPermissionListType( - input.WriteAttributes, - context - ); - } - return bodyParams; + return { + ...(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.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.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }), + ...(input.WriteAttributes !== undefined && { + WriteAttributes: serializeAws_json1_1ClientPermissionListType( + input.WriteAttributes, + context + ) + }) + }; }; const serializeAws_json1_1UpdateUserPoolDomainRequest = ( input: UpdateUserPoolDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomDomainConfig !== undefined) { - bodyParams[ - "CustomDomainConfig" - ] = serializeAws_json1_1CustomDomainConfigType( - input.CustomDomainConfig, - context - ); - } - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + return { + ...(input.CustomDomainConfig !== undefined && { + CustomDomainConfig: serializeAws_json1_1CustomDomainConfigType( + input.CustomDomainConfig, + context + ) + }), + ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.UserPoolId !== undefined && { UserPoolId: input.UserPoolId }) + }; }; const serializeAws_json1_1UpdateUserPoolRequest = ( input: UpdateUserPoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountRecoverySetting !== undefined) { - bodyParams[ - "AccountRecoverySetting" - ] = serializeAws_json1_1AccountRecoverySettingType( - input.AccountRecoverySetting, - context - ); - } - if (input.AdminCreateUserConfig !== undefined) { - bodyParams[ - "AdminCreateUserConfig" - ] = serializeAws_json1_1AdminCreateUserConfigType( - input.AdminCreateUserConfig, - context - ); - } - if (input.AutoVerifiedAttributes !== undefined) { - bodyParams[ - "AutoVerifiedAttributes" - ] = serializeAws_json1_1VerifiedAttributesListType( - input.AutoVerifiedAttributes, - context - ); - } - if (input.DeviceConfiguration !== undefined) { - bodyParams[ - "DeviceConfiguration" - ] = serializeAws_json1_1DeviceConfigurationType( - input.DeviceConfiguration, - context - ); - } - if (input.EmailConfiguration !== undefined) { - bodyParams[ - "EmailConfiguration" - ] = serializeAws_json1_1EmailConfigurationType( - input.EmailConfiguration, - context - ); - } - if (input.EmailVerificationMessage !== undefined) { - bodyParams["EmailVerificationMessage"] = input.EmailVerificationMessage; - } - if (input.EmailVerificationSubject !== undefined) { - bodyParams["EmailVerificationSubject"] = input.EmailVerificationSubject; - } - if (input.LambdaConfig !== undefined) { - bodyParams["LambdaConfig"] = serializeAws_json1_1LambdaConfigType( - input.LambdaConfig, - context - ); - } - if (input.MfaConfiguration !== undefined) { - bodyParams["MfaConfiguration"] = input.MfaConfiguration; - } - if (input.Policies !== undefined) { - bodyParams["Policies"] = serializeAws_json1_1UserPoolPolicyType( - input.Policies, - context - ); - } - if (input.SmsAuthenticationMessage !== undefined) { - bodyParams["SmsAuthenticationMessage"] = input.SmsAuthenticationMessage; - } - if (input.SmsConfiguration !== undefined) { - bodyParams["SmsConfiguration"] = serializeAws_json1_1SmsConfigurationType( - input.SmsConfiguration, - context - ); - } - if (input.SmsVerificationMessage !== undefined) { - bodyParams["SmsVerificationMessage"] = input.SmsVerificationMessage; - } - if (input.UserPoolAddOns !== undefined) { - bodyParams["UserPoolAddOns"] = serializeAws_json1_1UserPoolAddOnsType( - input.UserPoolAddOns, - context - ); - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - if (input.UserPoolTags !== undefined) { - bodyParams["UserPoolTags"] = serializeAws_json1_1UserPoolTagsType( - input.UserPoolTags, - context - ); - } - if (input.VerificationMessageTemplate !== undefined) { - bodyParams[ - "VerificationMessageTemplate" - ] = serializeAws_json1_1VerificationMessageTemplateType( - input.VerificationMessageTemplate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UserContextDataType = ( input: UserContextDataType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncodedData !== undefined) { - bodyParams["EncodedData"] = input.EncodedData; - } - return bodyParams; + return { + ...(input.EncodedData !== undefined && { EncodedData: input.EncodedData }) + }; }; const serializeAws_json1_1UserPoolAddOnsType = ( input: UserPoolAddOnsType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdvancedSecurityMode !== undefined) { - bodyParams["AdvancedSecurityMode"] = input.AdvancedSecurityMode; - } - return bodyParams; + return { + ...(input.AdvancedSecurityMode !== undefined && { + AdvancedSecurityMode: input.AdvancedSecurityMode + }) + }; }; const serializeAws_json1_1UserPoolPolicyType = ( input: UserPoolPolicyType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PasswordPolicy !== undefined) { - bodyParams["PasswordPolicy"] = serializeAws_json1_1PasswordPolicyType( - input.PasswordPolicy, - context - ); - } - return bodyParams; + return { + ...(input.PasswordPolicy !== undefined && { + PasswordPolicy: serializeAws_json1_1PasswordPolicyType( + input.PasswordPolicy, + context + ) + }) + }; }; const serializeAws_json1_1UserPoolTagsListType = ( @@ -19684,26 +19071,24 @@ const serializeAws_json1_1VerificationMessageTemplateType = ( input: VerificationMessageTemplateType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultEmailOption !== undefined) { - bodyParams["DefaultEmailOption"] = input.DefaultEmailOption; - } - if (input.EmailMessage !== undefined) { - bodyParams["EmailMessage"] = input.EmailMessage; - } - if (input.EmailMessageByLink !== undefined) { - bodyParams["EmailMessageByLink"] = input.EmailMessageByLink; - } - if (input.EmailSubject !== undefined) { - bodyParams["EmailSubject"] = input.EmailSubject; - } - if (input.EmailSubjectByLink !== undefined) { - bodyParams["EmailSubjectByLink"] = input.EmailSubjectByLink; - } - if (input.SmsMessage !== undefined) { - bodyParams["SmsMessage"] = input.SmsMessage; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1VerifiedAttributesListType = ( @@ -19717,37 +19102,27 @@ const serializeAws_json1_1VerifySoftwareTokenRequest = ( input: VerifySoftwareTokenRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.FriendlyDeviceName !== undefined) { - bodyParams["FriendlyDeviceName"] = input.FriendlyDeviceName; - } - if (input.Session !== undefined) { - bodyParams["Session"] = input.Session; - } - if (input.UserCode !== undefined) { - bodyParams["UserCode"] = input.UserCode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1VerifyUserAttributeRequest = ( input: VerifyUserAttributeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessToken !== undefined) { - bodyParams["AccessToken"] = input.AccessToken; - } - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.Code !== undefined) { - bodyParams["Code"] = input.Code; - } - return bodyParams; + return { + ...(input.AccessToken !== undefined && { AccessToken: input.AccessToken }), + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.Code !== undefined && { Code: input.Code }) + }; }; const deserializeAws_json1_1AccountRecoverySettingType = ( diff --git a/clients/client-cognito-identity/protocols/Aws_json1_1.ts b/clients/client-cognito-identity/protocols/Aws_json1_1.ts index 6f314b438a5e..d7defad924b7 100644 --- a/clients/client-cognito-identity/protocols/Aws_json1_1.ts +++ b/clients/client-cognito-identity/protocols/Aws_json1_1.ts @@ -3096,17 +3096,15 @@ const serializeAws_json1_1CognitoIdentityProvider = ( input: CognitoIdentityProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.ServerSideTokenCheck !== undefined) { - bodyParams["ServerSideTokenCheck"] = input.ServerSideTokenCheck; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.ProviderName !== undefined && { + ProviderName: input.ProviderName + }), + ...(input.ServerSideTokenCheck !== undefined && { + ServerSideTokenCheck: input.ServerSideTokenCheck + }) + }; }; const serializeAws_json1_1CognitoIdentityProviderList = ( @@ -3122,183 +3120,166 @@ const serializeAws_json1_1CreateIdentityPoolInput = ( input: CreateIdentityPoolInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowClassicFlow !== undefined) { - bodyParams["AllowClassicFlow"] = input.AllowClassicFlow; - } - if (input.AllowUnauthenticatedIdentities !== undefined) { - bodyParams["AllowUnauthenticatedIdentities"] = - input.AllowUnauthenticatedIdentities; - } - if (input.CognitoIdentityProviders !== undefined) { - bodyParams[ - "CognitoIdentityProviders" - ] = serializeAws_json1_1CognitoIdentityProviderList( - input.CognitoIdentityProviders, - context - ); - } - if (input.DeveloperProviderName !== undefined) { - bodyParams["DeveloperProviderName"] = input.DeveloperProviderName; - } - if (input.IdentityPoolName !== undefined) { - bodyParams["IdentityPoolName"] = input.IdentityPoolName; - } - if (input.IdentityPoolTags !== undefined) { - bodyParams["IdentityPoolTags"] = serializeAws_json1_1IdentityPoolTagsType( - input.IdentityPoolTags, - context - ); - } - if (input.OpenIdConnectProviderARNs !== undefined) { - bodyParams[ - "OpenIdConnectProviderARNs" - ] = serializeAws_json1_1OIDCProviderList( - input.OpenIdConnectProviderARNs, - context - ); - } - if (input.SamlProviderARNs !== undefined) { - bodyParams["SamlProviderARNs"] = serializeAws_json1_1SAMLProviderList( - input.SamlProviderARNs, - context - ); - } - if (input.SupportedLoginProviders !== undefined) { - bodyParams[ - "SupportedLoginProviders" - ] = serializeAws_json1_1IdentityProviders( - input.SupportedLoginProviders, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DeleteIdentitiesInput = ( input: DeleteIdentitiesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityIdsToDelete !== undefined) { - bodyParams["IdentityIdsToDelete"] = serializeAws_json1_1IdentityIdList( - input.IdentityIdsToDelete, - context - ); - } - return bodyParams; + return { + ...(input.IdentityIdsToDelete !== undefined && { + IdentityIdsToDelete: serializeAws_json1_1IdentityIdList( + input.IdentityIdsToDelete, + context + ) + }) + }; }; const serializeAws_json1_1DeleteIdentityPoolInput = ( input: DeleteIdentityPoolInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - return bodyParams; + return { + ...(input.IdentityPoolId !== undefined && { + IdentityPoolId: input.IdentityPoolId + }) + }; }; const serializeAws_json1_1DescribeIdentityInput = ( input: DescribeIdentityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - return bodyParams; + return { + ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }) + }; }; const serializeAws_json1_1DescribeIdentityPoolInput = ( input: DescribeIdentityPoolInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - return bodyParams; + return { + ...(input.IdentityPoolId !== undefined && { + IdentityPoolId: input.IdentityPoolId + }) + }; }; const serializeAws_json1_1GetCredentialsForIdentityInput = ( input: GetCredentialsForIdentityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomRoleArn !== undefined) { - bodyParams["CustomRoleArn"] = input.CustomRoleArn; - } - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - if (input.Logins !== undefined) { - bodyParams["Logins"] = serializeAws_json1_1LoginsMap(input.Logins, context); - } - return bodyParams; + return { + ...(input.CustomRoleArn !== undefined && { + CustomRoleArn: input.CustomRoleArn + }), + ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), + ...(input.Logins !== undefined && { + Logins: serializeAws_json1_1LoginsMap(input.Logins, context) + }) + }; }; const serializeAws_json1_1GetIdInput = ( input: GetIdInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.Logins !== undefined) { - bodyParams["Logins"] = serializeAws_json1_1LoginsMap(input.Logins, context); - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.IdentityPoolId !== undefined && { + IdentityPoolId: input.IdentityPoolId + }), + ...(input.Logins !== undefined && { + Logins: serializeAws_json1_1LoginsMap(input.Logins, context) + }) + }; }; const serializeAws_json1_1GetIdentityPoolRolesInput = ( input: GetIdentityPoolRolesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - return bodyParams; + return { + ...(input.IdentityPoolId !== undefined && { + IdentityPoolId: input.IdentityPoolId + }) + }; }; const serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = ( input: GetOpenIdTokenForDeveloperIdentityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.Logins !== undefined) { - bodyParams["Logins"] = serializeAws_json1_1LoginsMap(input.Logins, context); - } - if (input.TokenDuration !== undefined) { - bodyParams["TokenDuration"] = input.TokenDuration; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetOpenIdTokenInput = ( input: GetOpenIdTokenInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - if (input.Logins !== undefined) { - bodyParams["Logins"] = serializeAws_json1_1LoginsMap(input.Logins, context); - } - return bodyParams; + return { + ...(input.IdentityId !== undefined && { IdentityId: input.IdentityId }), + ...(input.Logins !== undefined && { + Logins: serializeAws_json1_1LoginsMap(input.Logins, context) + }) + }; }; const serializeAws_json1_1IdentityIdList = ( @@ -3312,60 +3293,53 @@ const serializeAws_json1_1IdentityPool = ( input: IdentityPool, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowClassicFlow !== undefined) { - bodyParams["AllowClassicFlow"] = input.AllowClassicFlow; - } - if (input.AllowUnauthenticatedIdentities !== undefined) { - bodyParams["AllowUnauthenticatedIdentities"] = - input.AllowUnauthenticatedIdentities; - } - if (input.CognitoIdentityProviders !== undefined) { - bodyParams[ - "CognitoIdentityProviders" - ] = serializeAws_json1_1CognitoIdentityProviderList( - input.CognitoIdentityProviders, - context - ); - } - if (input.DeveloperProviderName !== undefined) { - bodyParams["DeveloperProviderName"] = input.DeveloperProviderName; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.IdentityPoolName !== undefined) { - bodyParams["IdentityPoolName"] = input.IdentityPoolName; - } - if (input.IdentityPoolTags !== undefined) { - bodyParams["IdentityPoolTags"] = serializeAws_json1_1IdentityPoolTagsType( - input.IdentityPoolTags, - context - ); - } - if (input.OpenIdConnectProviderARNs !== undefined) { - bodyParams[ - "OpenIdConnectProviderARNs" - ] = serializeAws_json1_1OIDCProviderList( - input.OpenIdConnectProviderARNs, - context - ); - } - if (input.SamlProviderARNs !== undefined) { - bodyParams["SamlProviderARNs"] = serializeAws_json1_1SAMLProviderList( - input.SamlProviderARNs, - context - ); - } - if (input.SupportedLoginProviders !== undefined) { - bodyParams[ - "SupportedLoginProviders" - ] = serializeAws_json1_1IdentityProviders( - input.SupportedLoginProviders, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1IdentityPoolTagsListType = ( @@ -3399,45 +3373,35 @@ const serializeAws_json1_1ListIdentitiesInput = ( input: ListIdentitiesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HideDisabled !== undefined) { - bodyParams["HideDisabled"] = input.HideDisabled; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListIdentityPoolsInput = ( input: ListIdentityPoolsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1LoginsList = ( @@ -3461,43 +3425,29 @@ const serializeAws_json1_1LookupDeveloperIdentityInput = ( input: LookupDeveloperIdentityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeveloperUserIdentifier !== undefined) { - bodyParams["DeveloperUserIdentifier"] = input.DeveloperUserIdentifier; - } - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1MappingRule = ( input: MappingRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Claim !== undefined) { - bodyParams["Claim"] = input.Claim; - } - if (input.MatchType !== undefined) { - bodyParams["MatchType"] = input.MatchType; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1MappingRulesList = ( @@ -3511,20 +3461,20 @@ const serializeAws_json1_1MergeDeveloperIdentitiesInput = ( input: MergeDeveloperIdentitiesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationUserIdentifier !== undefined) { - bodyParams["DestinationUserIdentifier"] = input.DestinationUserIdentifier; - } - if (input.DeveloperProviderName !== undefined) { - bodyParams["DeveloperProviderName"] = input.DeveloperProviderName; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.SourceUserIdentifier !== undefined) { - bodyParams["SourceUserIdentifier"] = input.SourceUserIdentifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1OIDCProviderList = ( @@ -3538,22 +3488,18 @@ const serializeAws_json1_1RoleMapping = ( input: RoleMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AmbiguousRoleResolution !== undefined) { - bodyParams["AmbiguousRoleResolution"] = input.AmbiguousRoleResolution; - } - if (input.RulesConfiguration !== undefined) { - bodyParams[ - "RulesConfiguration" - ] = serializeAws_json1_1RulesConfigurationType( - input.RulesConfiguration, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.AmbiguousRoleResolution !== undefined && { + AmbiguousRoleResolution: input.AmbiguousRoleResolution + }), + ...(input.RulesConfiguration !== undefined && { + RulesConfiguration: serializeAws_json1_1RulesConfigurationType( + input.RulesConfiguration, + context + ) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1RoleMappingMap = ( @@ -3580,14 +3526,11 @@ const serializeAws_json1_1RulesConfigurationType = ( input: RulesConfigurationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1MappingRulesList( - input.Rules, - context - ); - } - return bodyParams; + return { + ...(input.Rules !== undefined && { + Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) + }) + }; }; const serializeAws_json1_1SAMLProviderList = ( @@ -3601,94 +3544,83 @@ const serializeAws_json1_1SetIdentityPoolRolesInput = ( input: SetIdentityPoolRolesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.RoleMappings !== undefined) { - bodyParams["RoleMappings"] = serializeAws_json1_1RoleMappingMap( - input.RoleMappings, - context - ); - } - if (input.Roles !== undefined) { - bodyParams["Roles"] = serializeAws_json1_1RolesMap(input.Roles, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1IdentityPoolTagsType( - input.Tags, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) + }) + }; }; const serializeAws_json1_1UnlinkDeveloperIdentityInput = ( input: UnlinkDeveloperIdentityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeveloperProviderName !== undefined) { - bodyParams["DeveloperProviderName"] = input.DeveloperProviderName; - } - if (input.DeveloperUserIdentifier !== undefined) { - bodyParams["DeveloperUserIdentifier"] = input.DeveloperUserIdentifier; - } - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UnlinkIdentityInput = ( input: UnlinkIdentityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IdentityId !== undefined) { - bodyParams["IdentityId"] = input.IdentityId; - } - if (input.Logins !== undefined) { - bodyParams["Logins"] = serializeAws_json1_1LoginsMap(input.Logins, context); - } - if (input.LoginsToRemove !== undefined) { - bodyParams["LoginsToRemove"] = serializeAws_json1_1LoginsList( - input.LoginsToRemove, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1IdentityPoolTagsListType( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1IdentityPoolTagsListType( + input.TagKeys, + context + ) + }) + }; }; const deserializeAws_json1_1CognitoIdentityProvider = ( diff --git a/clients/client-cognito-sync/protocols/Aws_restJson1_1.ts b/clients/client-cognito-sync/protocols/Aws_restJson1_1.ts index c724ac9553b5..a4ee13b85eeb 100644 --- a/clients/client-cognito-sync/protocols/Aws_restJson1_1.ts +++ b/clients/client-cognito-sync/protocols/Aws_restJson1_1.ts @@ -3218,20 +3218,16 @@ const serializeAws_restJson1_1CognitoStreams = ( input: CognitoStreams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisabledReason !== undefined) { - bodyParams["DisabledReason"] = input.DisabledReason; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - if (input.StreamingStatus !== undefined) { - bodyParams["StreamingStatus"] = input.StreamingStatus; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1Events = ( @@ -3248,42 +3244,32 @@ const serializeAws_restJson1_1PushSync = ( input: PushSync, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationArns !== undefined) { - bodyParams["ApplicationArns"] = serializeAws_restJson1_1ApplicationArnList( - input.ApplicationArns, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.ApplicationArns !== undefined && { + ApplicationArns: serializeAws_restJson1_1ApplicationArnList( + input.ApplicationArns, + context + ) + }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_restJson1_1RecordPatch = ( input: RecordPatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceLastModifiedDate !== undefined) { - bodyParams["DeviceLastModifiedDate"] = Math.round( - input.DeviceLastModifiedDate.getTime() / 1000 - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Op !== undefined) { - bodyParams["Op"] = input.Op; - } - if (input.SyncCount !== undefined) { - bodyParams["SyncCount"] = input.SyncCount; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1RecordPatchList = ( diff --git a/clients/client-comprehend/protocols/Aws_json1_1.ts b/clients/client-comprehend/protocols/Aws_json1_1.ts index bff78c790b93..dc9c08bdcadd 100644 --- a/clients/client-comprehend/protocols/Aws_json1_1.ts +++ b/clients/client-comprehend/protocols/Aws_json1_1.ts @@ -6652,649 +6652,517 @@ const serializeAws_json1_1BatchDetectDominantLanguageRequest = ( input: BatchDetectDominantLanguageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TextList !== undefined) { - bodyParams["TextList"] = serializeAws_json1_1StringList( - input.TextList, - context - ); - } - return bodyParams; + return { + ...(input.TextList !== undefined && { + TextList: serializeAws_json1_1StringList(input.TextList, context) + }) + }; }; const serializeAws_json1_1BatchDetectEntitiesRequest = ( input: BatchDetectEntitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.TextList !== undefined) { - bodyParams["TextList"] = serializeAws_json1_1StringList( - input.TextList, - context - ); - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.TextList !== undefined && { + TextList: serializeAws_json1_1StringList(input.TextList, context) + }) + }; }; const serializeAws_json1_1BatchDetectKeyPhrasesRequest = ( input: BatchDetectKeyPhrasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.TextList !== undefined) { - bodyParams["TextList"] = serializeAws_json1_1StringList( - input.TextList, - context - ); - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.TextList !== undefined && { + TextList: serializeAws_json1_1StringList(input.TextList, context) + }) + }; }; const serializeAws_json1_1BatchDetectSentimentRequest = ( input: BatchDetectSentimentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.TextList !== undefined) { - bodyParams["TextList"] = serializeAws_json1_1StringList( - input.TextList, - context - ); - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.TextList !== undefined && { + TextList: serializeAws_json1_1StringList(input.TextList, context) + }) + }; }; const serializeAws_json1_1BatchDetectSyntaxRequest = ( input: BatchDetectSyntaxRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.TextList !== undefined) { - bodyParams["TextList"] = serializeAws_json1_1StringList( - input.TextList, - context - ); - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.TextList !== undefined && { + TextList: serializeAws_json1_1StringList(input.TextList, context) + }) + }; }; const serializeAws_json1_1ClassifyDocumentRequest = ( input: ClassifyDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1CreateDocumentClassifierRequest = ( input: CreateDocumentClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.DocumentClassifierName !== undefined) { - bodyParams["DocumentClassifierName"] = input.DocumentClassifierName; - } - if (input.InputDataConfig !== undefined) { - bodyParams[ - "InputDataConfig" - ] = serializeAws_json1_1DocumentClassifierInputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - if (input.OutputDataConfig !== undefined) { - bodyParams[ - "OutputDataConfig" - ] = serializeAws_json1_1DocumentClassifierOutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateEndpointRequest = ( input: CreateEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DesiredInferenceUnits !== undefined) { - bodyParams["DesiredInferenceUnits"] = input.DesiredInferenceUnits; - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.ModelArn !== undefined) { - bodyParams["ModelArn"] = input.ModelArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateEntityRecognizerRequest = ( input: CreateEntityRecognizerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams[ - "InputDataConfig" - ] = serializeAws_json1_1EntityRecognizerInputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.RecognizerName !== undefined) { - bodyParams["RecognizerName"] = input.RecognizerName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteDocumentClassifierRequest = ( input: DeleteDocumentClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentClassifierArn !== undefined) { - bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; - } - return bodyParams; + return { + ...(input.DocumentClassifierArn !== undefined && { + DocumentClassifierArn: input.DocumentClassifierArn + }) + }; }; const serializeAws_json1_1DeleteEndpointRequest = ( input: DeleteEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }) + }; }; const serializeAws_json1_1DeleteEntityRecognizerRequest = ( input: DeleteEntityRecognizerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityRecognizerArn !== undefined) { - bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; - } - return bodyParams; + return { + ...(input.EntityRecognizerArn !== undefined && { + EntityRecognizerArn: input.EntityRecognizerArn + }) + }; }; const serializeAws_json1_1DescribeDocumentClassificationJobRequest = ( input: DescribeDocumentClassificationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DescribeDocumentClassifierRequest = ( input: DescribeDocumentClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentClassifierArn !== undefined) { - bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; - } - return bodyParams; + return { + ...(input.DocumentClassifierArn !== undefined && { + DocumentClassifierArn: input.DocumentClassifierArn + }) + }; }; const serializeAws_json1_1DescribeDominantLanguageDetectionJobRequest = ( input: DescribeDominantLanguageDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DescribeEndpointRequest = ( input: DescribeEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }) + }; }; const serializeAws_json1_1DescribeEntitiesDetectionJobRequest = ( input: DescribeEntitiesDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DescribeEntityRecognizerRequest = ( input: DescribeEntityRecognizerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityRecognizerArn !== undefined) { - bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; - } - return bodyParams; + return { + ...(input.EntityRecognizerArn !== undefined && { + EntityRecognizerArn: input.EntityRecognizerArn + }) + }; }; const serializeAws_json1_1DescribeKeyPhrasesDetectionJobRequest = ( input: DescribeKeyPhrasesDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DescribeSentimentDetectionJobRequest = ( input: DescribeSentimentDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DescribeTopicsDetectionJobRequest = ( input: DescribeTopicsDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DetectDominantLanguageRequest = ( input: DetectDominantLanguageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DetectEntitiesRequest = ( input: DetectEntitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DetectKeyPhrasesRequest = ( input: DetectKeyPhrasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DetectSentimentRequest = ( input: DetectSentimentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DetectSyntaxRequest = ( input: DetectSyntaxRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DocumentClassificationJobFilter = ( input: DocumentClassificationJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DocumentClassifierFilter = ( input: DocumentClassifierFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DocumentClassifierInputDataConfig = ( input: DocumentClassifierInputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LabelDelimiter !== undefined) { - bodyParams["LabelDelimiter"] = input.LabelDelimiter; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.LabelDelimiter !== undefined && { + LabelDelimiter: input.LabelDelimiter + }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1DocumentClassifierOutputDataConfig = ( input: DocumentClassifierOutputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1DominantLanguageDetectionJobFilter = ( input: DominantLanguageDetectionJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1EndpointFilter = ( input: EndpointFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.ModelArn !== undefined) { - bodyParams["ModelArn"] = input.ModelArn; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EntitiesDetectionJobFilter = ( input: EntitiesDetectionJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1EntityRecognizerAnnotations = ( input: EntityRecognizerAnnotations, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1EntityRecognizerDocuments = ( input: EntityRecognizerDocuments, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1EntityRecognizerEntityList = ( input: EntityRecognizerEntityList, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1EntityRecognizerFilter = ( input: EntityRecognizerFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1EntityRecognizerInputDataConfig = ( input: EntityRecognizerInputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Annotations !== undefined) { - bodyParams["Annotations"] = serializeAws_json1_1EntityRecognizerAnnotations( - input.Annotations, - context - ); - } - if (input.Documents !== undefined) { - bodyParams["Documents"] = serializeAws_json1_1EntityRecognizerDocuments( - input.Documents, - context - ); - } - if (input.EntityList !== undefined) { - bodyParams["EntityList"] = serializeAws_json1_1EntityRecognizerEntityList( - input.EntityList, - context - ); - } - if (input.EntityTypes !== undefined) { - bodyParams["EntityTypes"] = serializeAws_json1_1EntityTypesList( - input.EntityTypes, - context - ); - } - return bodyParams; + return { + ...(input.Annotations !== undefined && { + Annotations: serializeAws_json1_1EntityRecognizerAnnotations( + input.Annotations, + context + ) + }), + ...(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 + ) + }) + }; }; const serializeAws_json1_1EntityTypesList = ( @@ -7310,256 +7178,192 @@ const serializeAws_json1_1EntityTypesListItem = ( input: EntityTypesListItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1InputDataConfig = ( input: InputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputFormat !== undefined) { - bodyParams["InputFormat"] = input.InputFormat; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.InputFormat !== undefined && { InputFormat: input.InputFormat }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1KeyPhrasesDetectionJobFilter = ( input: KeyPhrasesDetectionJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListDocumentClassificationJobsRequest = ( input: ListDocumentClassificationJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1DocumentClassificationJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1DocumentClassificationJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDocumentClassifiersRequest = ( input: ListDocumentClassifiersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1DocumentClassifierFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1DocumentClassifierFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDominantLanguageDetectionJobsRequest = ( input: ListDominantLanguageDetectionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams[ - "Filter" - ] = serializeAws_json1_1DominantLanguageDetectionJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1DominantLanguageDetectionJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEndpointsRequest = ( input: ListEndpointsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1EndpointFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1EndpointFilter(input.Filter, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEntitiesDetectionJobsRequest = ( input: ListEntitiesDetectionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1EntitiesDetectionJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1EntitiesDetectionJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEntityRecognizersRequest = ( input: ListEntityRecognizersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1EntityRecognizerFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1EntityRecognizerFilter(input.Filter, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListKeyPhrasesDetectionJobsRequest = ( input: ListKeyPhrasesDetectionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1KeyPhrasesDetectionJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1KeyPhrasesDetectionJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListSentimentDetectionJobsRequest = ( input: ListSentimentDetectionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1SentimentDetectionJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1SentimentDetectionJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListTopicsDetectionJobsRequest = ( input: ListTopicsDetectionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1TopicsDetectionJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1TopicsDetectionJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1OutputDataConfig = ( input: OutputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1SecurityGroupIds = ( @@ -7573,354 +7377,278 @@ const serializeAws_json1_1SentimentDetectionJobFilter = ( input: SentimentDetectionJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartDocumentClassificationJobRequest = ( input: StartDocumentClassificationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.DocumentClassifierArn !== undefined) { - bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartDominantLanguageDetectionJobRequest = ( input: StartDominantLanguageDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartEntitiesDetectionJobRequest = ( input: StartEntitiesDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.EntityRecognizerArn !== undefined) { - bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartKeyPhrasesDetectionJobRequest = ( input: StartKeyPhrasesDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartSentimentDetectionJobRequest = ( input: StartSentimentDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartTopicsDetectionJobRequest = ( input: StartTopicsDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.NumberOfTopics !== undefined) { - bodyParams["NumberOfTopics"] = input.NumberOfTopics; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StopDominantLanguageDetectionJobRequest = ( input: StopDominantLanguageDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1StopEntitiesDetectionJobRequest = ( input: StopEntitiesDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1StopKeyPhrasesDetectionJobRequest = ( input: StopKeyPhrasesDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1StopSentimentDetectionJobRequest = ( input: StopSentimentDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1StopTrainingDocumentClassifierRequest = ( input: StopTrainingDocumentClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentClassifierArn !== undefined) { - bodyParams["DocumentClassifierArn"] = input.DocumentClassifierArn; - } - return bodyParams; + return { + ...(input.DocumentClassifierArn !== undefined && { + DocumentClassifierArn: input.DocumentClassifierArn + }) + }; }; const serializeAws_json1_1StopTrainingEntityRecognizerRequest = ( input: StopTrainingEntityRecognizerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityRecognizerArn !== undefined) { - bodyParams["EntityRecognizerArn"] = input.EntityRecognizerArn; - } - return bodyParams; + return { + ...(input.EntityRecognizerArn !== undefined && { + EntityRecognizerArn: input.EntityRecognizerArn + }) + }; }; const serializeAws_json1_1StringList = ( @@ -7938,14 +7666,10 @@ const serializeAws_json1_1Subnets = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -7966,86 +7690,69 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TopicsDetectionJobFilter = ( input: TopicsDetectionJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateEndpointRequest = ( input: UpdateEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredInferenceUnits !== undefined) { - bodyParams["DesiredInferenceUnits"] = input.DesiredInferenceUnits; - } - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - return bodyParams; + return { + ...(input.DesiredInferenceUnits !== undefined && { + DesiredInferenceUnits: input.DesiredInferenceUnits + }), + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }) + }; }; const serializeAws_json1_1VpcConfig = ( input: VpcConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.Subnets !== undefined) { - bodyParams["Subnets"] = serializeAws_json1_1Subnets(input.Subnets, context); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds( + input.SecurityGroupIds, + context + ) + }), + ...(input.Subnets !== undefined && { + Subnets: serializeAws_json1_1Subnets(input.Subnets, context) + }) + }; }; const deserializeAws_json1_1BatchDetectDominantLanguageItemResult = ( diff --git a/clients/client-comprehendmedical/protocols/Aws_json1_1.ts b/clients/client-comprehendmedical/protocols/Aws_json1_1.ts index 58a142c30743..6172387b2ebe 100644 --- a/clients/client-comprehendmedical/protocols/Aws_json1_1.ts +++ b/clients/client-comprehendmedical/protocols/Aws_json1_1.ts @@ -1791,267 +1791,207 @@ const serializeAws_json1_1ComprehendMedicalAsyncJobFilter = ( input: ComprehendMedicalAsyncJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmitTimeAfter !== undefined) { - bodyParams["SubmitTimeAfter"] = Math.round( - input.SubmitTimeAfter.getTime() / 1000 - ); - } - if (input.SubmitTimeBefore !== undefined) { - bodyParams["SubmitTimeBefore"] = Math.round( - input.SubmitTimeBefore.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeEntitiesDetectionV2JobRequest = ( input: DescribeEntitiesDetectionV2JobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DescribePHIDetectionJobRequest = ( input: DescribePHIDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1DetectEntitiesRequest = ( input: DetectEntitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DetectEntitiesV2Request = ( input: DetectEntitiesV2Request, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1DetectPHIRequest = ( input: DetectPHIRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1InferICD10CMRequest = ( input: InferICD10CMRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1InferRxNormRequest = ( input: InferRxNormRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_json1_1InputDataConfig = ( input: InputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3Key !== undefined) { - bodyParams["S3Key"] = input.S3Key; - } - return bodyParams; + return { + ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && { S3Key: input.S3Key }) + }; }; const serializeAws_json1_1ListEntitiesDetectionV2JobsRequest = ( input: ListEntitiesDetectionV2JobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1ComprehendMedicalAsyncJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPHIDetectionJobsRequest = ( input: ListPHIDetectionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1ComprehendMedicalAsyncJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1ComprehendMedicalAsyncJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1OutputDataConfig = ( input: OutputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3Key !== undefined) { - bodyParams["S3Key"] = input.S3Key; - } - return bodyParams; + return { + ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), + ...(input.S3Key !== undefined && { S3Key: input.S3Key }) + }; }; const serializeAws_json1_1StartEntitiesDetectionV2JobRequest = ( input: StartEntitiesDetectionV2JobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1StartPHIDetectionJobRequest = ( input: StartPHIDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1StopEntitiesDetectionV2JobRequest = ( input: StopEntitiesDetectionV2JobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1StopPHIDetectionJobRequest = ( input: StopPHIDetectionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const deserializeAws_json1_1Attribute = ( diff --git a/clients/client-compute-optimizer/protocols/Aws_json1_0.ts b/clients/client-compute-optimizer/protocols/Aws_json1_0.ts index f99b8be54f9f..d60d81cf017b 100644 --- a/clients/client-compute-optimizer/protocols/Aws_json1_0.ts +++ b/clients/client-compute-optimizer/protocols/Aws_json1_0.ts @@ -1129,17 +1129,12 @@ const serializeAws_json1_0Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_0FilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_json1_0FilterValues(input.values, context) + }) + }; }; const serializeAws_json1_0FilterValues = ( @@ -1160,111 +1155,81 @@ const serializeAws_json1_0GetAutoScalingGroupRecommendationsRequest = ( input: GetAutoScalingGroupRecommendationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.accountIds !== undefined) { - bodyParams["accountIds"] = serializeAws_json1_0AccountIds( - input.accountIds, - context - ); - } - if (input.autoScalingGroupArns !== undefined) { - bodyParams[ - "autoScalingGroupArns" - ] = serializeAws_json1_0AutoScalingGroupArns( - input.autoScalingGroupArns, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_0Filters(input.filters, context); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0GetEC2InstanceRecommendationsRequest = ( input: GetEC2InstanceRecommendationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.accountIds !== undefined) { - bodyParams["accountIds"] = serializeAws_json1_0AccountIds( - input.accountIds, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_0Filters(input.filters, context); - } - if (input.instanceArns !== undefined) { - bodyParams["instanceArns"] = serializeAws_json1_0InstanceArns( - input.instanceArns, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0GetEC2RecommendationProjectedMetricsRequest = ( input: GetEC2RecommendationProjectedMetricsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.instanceArn !== undefined) { - bodyParams["instanceArn"] = input.instanceArn; - } - if (input.period !== undefined) { - bodyParams["period"] = input.period; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - if (input.stat !== undefined) { - bodyParams["stat"] = input.stat; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0GetEnrollmentStatusRequest = ( input: GetEnrollmentStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_0GetRecommendationSummariesRequest = ( input: GetRecommendationSummariesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.accountIds !== undefined) { - bodyParams["accountIds"] = serializeAws_json1_0AccountIds( - input.accountIds, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.accountIds !== undefined && { + accountIds: serializeAws_json1_0AccountIds(input.accountIds, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_0InstanceArns = ( @@ -1278,14 +1243,12 @@ const serializeAws_json1_0UpdateEnrollmentStatusRequest = ( input: UpdateEnrollmentStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.includeMemberAccounts !== undefined) { - bodyParams["includeMemberAccounts"] = input.includeMemberAccounts; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.includeMemberAccounts !== undefined && { + includeMemberAccounts: input.includeMemberAccounts + }), + ...(input.status !== undefined && { status: input.status }) + }; }; const deserializeAws_json1_0AccessDeniedException = ( diff --git a/clients/client-config-service/protocols/Aws_json1_1.ts b/clients/client-config-service/protocols/Aws_json1_1.ts index 6ba2482ad9a7..56674453cee7 100644 --- a/clients/client-config-service/protocols/Aws_json1_1.ts +++ b/clients/client-config-service/protocols/Aws_json1_1.ts @@ -9379,25 +9379,23 @@ const serializeAws_json1_1AccountAggregationSource = ( input: AccountAggregationSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountIds !== undefined) { - bodyParams[ - "AccountIds" - ] = serializeAws_json1_1AccountAggregationSourceAccountList( - input.AccountIds, - context - ); - } - if (input.AllAwsRegions !== undefined) { - bodyParams["AllAwsRegions"] = input.AllAwsRegions; - } - if (input.AwsRegions !== undefined) { - bodyParams["AwsRegions"] = serializeAws_json1_1AggregatorRegionList( - input.AwsRegions, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AccountAggregationSourceAccountList = ( @@ -9420,23 +9418,21 @@ const serializeAws_json1_1AggregateResourceIdentifier = ( input: AggregateResourceIdentifier, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.SourceAccountId !== undefined) { - bodyParams["SourceAccountId"] = input.SourceAccountId; - } - if (input.SourceRegion !== undefined) { - bodyParams["SourceRegion"] = input.SourceRegion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1AggregatedSourceStatusTypeList = ( @@ -9457,34 +9453,31 @@ const serializeAws_json1_1BatchGetAggregateResourceConfigRequest = ( input: BatchGetAggregateResourceConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.ResourceIdentifiers !== undefined) { - bodyParams[ - "ResourceIdentifiers" - ] = serializeAws_json1_1ResourceIdentifiersList( - input.ResourceIdentifiers, - context - ); - } - return bodyParams; + return { + ...(input.ConfigurationAggregatorName !== undefined && { + ConfigurationAggregatorName: input.ConfigurationAggregatorName + }), + ...(input.ResourceIdentifiers !== undefined && { + ResourceIdentifiers: serializeAws_json1_1ResourceIdentifiersList( + input.ResourceIdentifiers, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetResourceConfigRequest = ( input: BatchGetResourceConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceKeys !== undefined) { - bodyParams["resourceKeys"] = serializeAws_json1_1ResourceKeys( - input.resourceKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceKeys !== undefined && { + resourceKeys: serializeAws_json1_1ResourceKeys( + input.resourceKeys, + context + ) + }) + }; }; const serializeAws_json1_1ComplianceResourceTypes = ( @@ -9505,72 +9498,60 @@ const serializeAws_json1_1ConfigRule = ( input: ConfigRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleArn !== undefined) { - bodyParams["ConfigRuleArn"] = input.ConfigRuleArn; - } - if (input.ConfigRuleId !== undefined) { - bodyParams["ConfigRuleId"] = input.ConfigRuleId; - } - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.ConfigRuleState !== undefined) { - bodyParams["ConfigRuleState"] = input.ConfigRuleState; - } - if (input.CreatedBy !== undefined) { - bodyParams["CreatedBy"] = input.CreatedBy; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.InputParameters !== undefined) { - bodyParams["InputParameters"] = input.InputParameters; - } - if (input.MaximumExecutionFrequency !== undefined) { - bodyParams["MaximumExecutionFrequency"] = input.MaximumExecutionFrequency; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = serializeAws_json1_1Scope(input.Scope, context); - } - if (input.Source !== undefined) { - bodyParams["Source"] = serializeAws_json1_1Source(input.Source, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ConfigRuleComplianceFilters = ( input: ConfigRuleComplianceFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - if (input.ComplianceType !== undefined) { - bodyParams["ComplianceType"] = input.ComplianceType; - } - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ConfigRuleComplianceSummaryFilters = ( input: ConfigRuleComplianceSummaryFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }) + }; }; const serializeAws_json1_1ConfigRuleNames = ( @@ -9584,11 +9565,11 @@ const serializeAws_json1_1ConfigSnapshotDeliveryProperties = ( input: ConfigSnapshotDeliveryProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deliveryFrequency !== undefined) { - bodyParams["deliveryFrequency"] = input.deliveryFrequency; - } - return bodyParams; + return { + ...(input.deliveryFrequency !== undefined && { + deliveryFrequency: input.deliveryFrequency + }) + }; }; const serializeAws_json1_1ConfigurationAggregatorNameList = ( @@ -9602,20 +9583,16 @@ const serializeAws_json1_1ConfigurationRecorder = ( input: ConfigurationRecorder, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.recordingGroup !== undefined) { - bodyParams["recordingGroup"] = serializeAws_json1_1RecordingGroup( - input.recordingGroup, - context - ); - } - if (input.roleARN !== undefined) { - bodyParams["roleARN"] = input.roleARN; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.recordingGroup !== undefined && { + recordingGroup: serializeAws_json1_1RecordingGroup( + input.recordingGroup, + context + ) + }), + ...(input.roleARN !== undefined && { roleARN: input.roleARN }) + }; }; const serializeAws_json1_1ConfigurationRecorderNameList = ( @@ -9629,19 +9606,17 @@ const serializeAws_json1_1ConformancePackComplianceFilters = ( input: ConformancePackComplianceFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceType !== undefined) { - bodyParams["ComplianceType"] = input.ComplianceType; - } - if (input.ConfigRuleNames !== undefined) { - bodyParams[ - "ConfigRuleNames" - ] = serializeAws_json1_1ConformancePackConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - return bodyParams; + return { + ...(input.ComplianceType !== undefined && { + ComplianceType: input.ComplianceType + }), + ...(input.ConfigRuleNames !== undefined && { + ConfigRuleNames: serializeAws_json1_1ConformancePackConfigRuleNames( + input.ConfigRuleNames, + context + ) + }) + }; }; const serializeAws_json1_1ConformancePackComplianceResourceIds = ( @@ -9662,44 +9637,40 @@ const serializeAws_json1_1ConformancePackEvaluationFilters = ( input: ConformancePackEvaluationFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceType !== undefined) { - bodyParams["ComplianceType"] = input.ComplianceType; - } - if (input.ConfigRuleNames !== undefined) { - bodyParams[ - "ConfigRuleNames" - ] = serializeAws_json1_1ConformancePackConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - if (input.ResourceIds !== undefined) { - bodyParams[ - "ResourceIds" - ] = serializeAws_json1_1ConformancePackComplianceResourceIds( - input.ResourceIds, - context - ); - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ConformancePackInputParameter = ( input: ConformancePackInputParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterName !== undefined) { - bodyParams["ParameterName"] = input.ParameterName; - } - if (input.ParameterValue !== undefined) { - bodyParams["ParameterValue"] = input.ParameterValue; - } - return bodyParams; + return { + ...(input.ParameterName !== undefined && { + ParameterName: input.ParameterName + }), + ...(input.ParameterValue !== undefined && { + ParameterValue: input.ParameterValue + }) + }; }; const serializeAws_json1_1ConformancePackInputParameters = ( @@ -9729,215 +9700,201 @@ const serializeAws_json1_1DeleteAggregationAuthorizationRequest = ( input: DeleteAggregationAuthorizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthorizedAccountId !== undefined) { - bodyParams["AuthorizedAccountId"] = input.AuthorizedAccountId; - } - if (input.AuthorizedAwsRegion !== undefined) { - bodyParams["AuthorizedAwsRegion"] = input.AuthorizedAwsRegion; - } - return bodyParams; + return { + ...(input.AuthorizedAccountId !== undefined && { + AuthorizedAccountId: input.AuthorizedAccountId + }), + ...(input.AuthorizedAwsRegion !== undefined && { + AuthorizedAwsRegion: input.AuthorizedAwsRegion + }) + }; }; const serializeAws_json1_1DeleteConfigRuleRequest = ( input: DeleteConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - return bodyParams; + return { + ...(input.ConfigRuleName !== undefined && { + ConfigRuleName: input.ConfigRuleName + }) + }; }; const serializeAws_json1_1DeleteConfigurationAggregatorRequest = ( input: DeleteConfigurationAggregatorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - return bodyParams; + return { + ...(input.ConfigurationAggregatorName !== undefined && { + ConfigurationAggregatorName: input.ConfigurationAggregatorName + }) + }; }; const serializeAws_json1_1DeleteConfigurationRecorderRequest = ( input: DeleteConfigurationRecorderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationRecorderName !== undefined) { - bodyParams["ConfigurationRecorderName"] = input.ConfigurationRecorderName; - } - return bodyParams; + return { + ...(input.ConfigurationRecorderName !== undefined && { + ConfigurationRecorderName: input.ConfigurationRecorderName + }) + }; }; const serializeAws_json1_1DeleteConformancePackRequest = ( input: DeleteConformancePackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackName !== undefined) { - bodyParams["ConformancePackName"] = input.ConformancePackName; - } - return bodyParams; + return { + ...(input.ConformancePackName !== undefined && { + ConformancePackName: input.ConformancePackName + }) + }; }; const serializeAws_json1_1DeleteDeliveryChannelRequest = ( input: DeleteDeliveryChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryChannelName !== undefined) { - bodyParams["DeliveryChannelName"] = input.DeliveryChannelName; - } - return bodyParams; + return { + ...(input.DeliveryChannelName !== undefined && { + DeliveryChannelName: input.DeliveryChannelName + }) + }; }; const serializeAws_json1_1DeleteEvaluationResultsRequest = ( input: DeleteEvaluationResultsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - return bodyParams; + return { + ...(input.ConfigRuleName !== undefined && { + ConfigRuleName: input.ConfigRuleName + }) + }; }; const serializeAws_json1_1DeleteOrganizationConfigRuleRequest = ( input: DeleteOrganizationConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationConfigRuleName !== undefined) { - bodyParams["OrganizationConfigRuleName"] = input.OrganizationConfigRuleName; - } - return bodyParams; + return { + ...(input.OrganizationConfigRuleName !== undefined && { + OrganizationConfigRuleName: input.OrganizationConfigRuleName + }) + }; }; const serializeAws_json1_1DeleteOrganizationConformancePackRequest = ( input: DeleteOrganizationConformancePackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationConformancePackName !== undefined) { - bodyParams["OrganizationConformancePackName"] = - input.OrganizationConformancePackName; - } - return bodyParams; + return { + ...(input.OrganizationConformancePackName !== undefined && { + OrganizationConformancePackName: input.OrganizationConformancePackName + }) + }; }; const serializeAws_json1_1DeletePendingAggregationRequestRequest = ( input: DeletePendingAggregationRequestRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RequesterAccountId !== undefined) { - bodyParams["RequesterAccountId"] = input.RequesterAccountId; - } - if (input.RequesterAwsRegion !== undefined) { - bodyParams["RequesterAwsRegion"] = input.RequesterAwsRegion; - } - return bodyParams; + return { + ...(input.RequesterAccountId !== undefined && { + RequesterAccountId: input.RequesterAccountId + }), + ...(input.RequesterAwsRegion !== undefined && { + RequesterAwsRegion: input.RequesterAwsRegion + }) + }; }; const serializeAws_json1_1DeleteRemediationConfigurationRequest = ( input: DeleteRemediationConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.ConfigRuleName !== undefined && { + ConfigRuleName: input.ConfigRuleName + }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1DeleteRemediationExceptionsRequest = ( input: DeleteRemediationExceptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.ResourceKeys !== undefined) { - bodyParams[ - "ResourceKeys" - ] = serializeAws_json1_1RemediationExceptionResourceKeys( - input.ResourceKeys, - context - ); - } - return bodyParams; + return { + ...(input.ConfigRuleName !== undefined && { + ConfigRuleName: input.ConfigRuleName + }), + ...(input.ResourceKeys !== undefined && { + ResourceKeys: serializeAws_json1_1RemediationExceptionResourceKeys( + input.ResourceKeys, + context + ) + }) + }; }; const serializeAws_json1_1DeleteResourceConfigRequest = ( input: DeleteResourceConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1DeleteRetentionConfigurationRequest = ( input: DeleteRetentionConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RetentionConfigurationName !== undefined) { - bodyParams["RetentionConfigurationName"] = input.RetentionConfigurationName; - } - return bodyParams; + return { + ...(input.RetentionConfigurationName !== undefined && { + RetentionConfigurationName: input.RetentionConfigurationName + }) + }; }; const serializeAws_json1_1DeliverConfigSnapshotRequest = ( input: DeliverConfigSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deliveryChannelName !== undefined) { - bodyParams["deliveryChannelName"] = input.deliveryChannelName; - } - return bodyParams; + return { + ...(input.deliveryChannelName !== undefined && { + deliveryChannelName: input.deliveryChannelName + }) + }; }; const serializeAws_json1_1DeliveryChannel = ( input: DeliveryChannel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.configSnapshotDeliveryProperties !== undefined) { - bodyParams[ - "configSnapshotDeliveryProperties" - ] = serializeAws_json1_1ConfigSnapshotDeliveryProperties( - input.configSnapshotDeliveryProperties, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.s3BucketName !== undefined) { - bodyParams["s3BucketName"] = input.s3BucketName; - } - if (input.s3KeyPrefix !== undefined) { - bodyParams["s3KeyPrefix"] = input.s3KeyPrefix; - } - if (input.snsTopicARN !== undefined) { - bodyParams["snsTopicARN"] = input.snsTopicARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeliveryChannelNameList = ( @@ -9951,513 +9908,405 @@ const serializeAws_json1_1DescribeAggregateComplianceByConfigRulesRequest = ( input: DescribeAggregateComplianceByConfigRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ConfigRuleComplianceFilters( - input.Filters, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeAggregationAuthorizationsRequest = ( input: DescribeAggregationAuthorizationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeComplianceByConfigRuleRequest = ( input: DescribeComplianceByConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceTypes !== undefined) { - bodyParams["ComplianceTypes"] = serializeAws_json1_1ComplianceTypes( - input.ComplianceTypes, - context - ); - } - if (input.ConfigRuleNames !== undefined) { - bodyParams["ConfigRuleNames"] = serializeAws_json1_1ConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeComplianceByResourceRequest = ( input: DescribeComplianceByResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceTypes !== undefined) { - bodyParams["ComplianceTypes"] = serializeAws_json1_1ComplianceTypes( - input.ComplianceTypes, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeConfigRuleEvaluationStatusRequest = ( input: DescribeConfigRuleEvaluationStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleNames !== undefined) { - bodyParams["ConfigRuleNames"] = serializeAws_json1_1ConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ConfigRuleNames !== undefined && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames( + input.ConfigRuleNames, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeConfigRulesRequest = ( input: DescribeConfigRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleNames !== undefined) { - bodyParams["ConfigRuleNames"] = serializeAws_json1_1ConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ConfigRuleNames !== undefined && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames( + input.ConfigRuleNames, + context + ) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeConfigurationAggregatorSourcesStatusRequest = ( input: DescribeConfigurationAggregatorSourcesStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UpdateStatus !== undefined) { - bodyParams[ - "UpdateStatus" - ] = serializeAws_json1_1AggregatedSourceStatusTypeList( - input.UpdateStatus, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeConfigurationAggregatorsRequest = ( input: DescribeConfigurationAggregatorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorNames !== undefined) { - bodyParams[ - "ConfigurationAggregatorNames" - ] = serializeAws_json1_1ConfigurationAggregatorNameList( - input.ConfigurationAggregatorNames, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ConfigurationAggregatorNames !== undefined && { + ConfigurationAggregatorNames: serializeAws_json1_1ConfigurationAggregatorNameList( + input.ConfigurationAggregatorNames, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeConfigurationRecorderStatusRequest = ( input: DescribeConfigurationRecorderStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationRecorderNames !== undefined) { - bodyParams[ - "ConfigurationRecorderNames" - ] = serializeAws_json1_1ConfigurationRecorderNameList( - input.ConfigurationRecorderNames, - context - ); - } - return bodyParams; + return { + ...(input.ConfigurationRecorderNames !== undefined && { + ConfigurationRecorderNames: serializeAws_json1_1ConfigurationRecorderNameList( + input.ConfigurationRecorderNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeConfigurationRecordersRequest = ( input: DescribeConfigurationRecordersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationRecorderNames !== undefined) { - bodyParams[ - "ConfigurationRecorderNames" - ] = serializeAws_json1_1ConfigurationRecorderNameList( - input.ConfigurationRecorderNames, - context - ); - } - return bodyParams; + return { + ...(input.ConfigurationRecorderNames !== undefined && { + ConfigurationRecorderNames: serializeAws_json1_1ConfigurationRecorderNameList( + input.ConfigurationRecorderNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeConformancePackComplianceRequest = ( input: DescribeConformancePackComplianceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackName !== undefined) { - bodyParams["ConformancePackName"] = input.ConformancePackName; - } - if (input.Filters !== undefined) { - bodyParams[ - "Filters" - ] = serializeAws_json1_1ConformancePackComplianceFilters( - input.Filters, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeConformancePackStatusRequest = ( input: DescribeConformancePackStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackNames !== undefined) { - bodyParams[ - "ConformancePackNames" - ] = serializeAws_json1_1ConformancePackNamesList( - input.ConformancePackNames, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ConformancePackNames !== undefined && { + ConformancePackNames: serializeAws_json1_1ConformancePackNamesList( + input.ConformancePackNames, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeConformancePacksRequest = ( input: DescribeConformancePacksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackNames !== undefined) { - bodyParams[ - "ConformancePackNames" - ] = serializeAws_json1_1ConformancePackNamesList( - input.ConformancePackNames, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ConformancePackNames !== undefined && { + ConformancePackNames: serializeAws_json1_1ConformancePackNamesList( + input.ConformancePackNames, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeDeliveryChannelStatusRequest = ( input: DescribeDeliveryChannelStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryChannelNames !== undefined) { - bodyParams[ - "DeliveryChannelNames" - ] = serializeAws_json1_1DeliveryChannelNameList( - input.DeliveryChannelNames, - context - ); - } - return bodyParams; + return { + ...(input.DeliveryChannelNames !== undefined && { + DeliveryChannelNames: serializeAws_json1_1DeliveryChannelNameList( + input.DeliveryChannelNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeDeliveryChannelsRequest = ( input: DescribeDeliveryChannelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryChannelNames !== undefined) { - bodyParams[ - "DeliveryChannelNames" - ] = serializeAws_json1_1DeliveryChannelNameList( - input.DeliveryChannelNames, - context - ); - } - return bodyParams; + return { + ...(input.DeliveryChannelNames !== undefined && { + DeliveryChannelNames: serializeAws_json1_1DeliveryChannelNameList( + input.DeliveryChannelNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeOrganizationConfigRuleStatusesRequest = ( input: DescribeOrganizationConfigRuleStatusesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationConfigRuleNames !== undefined) { - bodyParams[ - "OrganizationConfigRuleNames" - ] = serializeAws_json1_1OrganizationConfigRuleNames( - input.OrganizationConfigRuleNames, - context - ); - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationConfigRuleNames !== undefined && { + OrganizationConfigRuleNames: serializeAws_json1_1OrganizationConfigRuleNames( + input.OrganizationConfigRuleNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeOrganizationConfigRulesRequest = ( input: DescribeOrganizationConfigRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationConfigRuleNames !== undefined) { - bodyParams[ - "OrganizationConfigRuleNames" - ] = serializeAws_json1_1OrganizationConfigRuleNames( - input.OrganizationConfigRuleNames, - context - ); - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationConfigRuleNames !== undefined && { + OrganizationConfigRuleNames: serializeAws_json1_1OrganizationConfigRuleNames( + input.OrganizationConfigRuleNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeOrganizationConformancePackStatusesRequest = ( input: DescribeOrganizationConformancePackStatusesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationConformancePackNames !== undefined) { - bodyParams[ - "OrganizationConformancePackNames" - ] = serializeAws_json1_1OrganizationConformancePackNames( - input.OrganizationConformancePackNames, - context - ); - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationConformancePackNames !== undefined && { + OrganizationConformancePackNames: serializeAws_json1_1OrganizationConformancePackNames( + input.OrganizationConformancePackNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeOrganizationConformancePacksRequest = ( input: DescribeOrganizationConformancePacksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationConformancePackNames !== undefined) { - bodyParams[ - "OrganizationConformancePackNames" - ] = serializeAws_json1_1OrganizationConformancePackNames( - input.OrganizationConformancePackNames, - context - ); - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationConformancePackNames !== undefined && { + OrganizationConformancePackNames: serializeAws_json1_1OrganizationConformancePackNames( + input.OrganizationConformancePackNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribePendingAggregationRequestsRequest = ( input: DescribePendingAggregationRequestsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeRemediationConfigurationsRequest = ( input: DescribeRemediationConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleNames !== undefined) { - bodyParams["ConfigRuleNames"] = serializeAws_json1_1ConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - return bodyParams; + return { + ...(input.ConfigRuleNames !== undefined && { + ConfigRuleNames: serializeAws_json1_1ConfigRuleNames( + input.ConfigRuleNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeRemediationExceptionsRequest = ( input: DescribeRemediationExceptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceKeys !== undefined) { - bodyParams[ - "ResourceKeys" - ] = serializeAws_json1_1RemediationExceptionResourceKeys( - input.ResourceKeys, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeRemediationExecutionStatusRequest = ( input: DescribeRemediationExecutionStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceKeys !== undefined) { - bodyParams["ResourceKeys"] = serializeAws_json1_1ResourceKeys( - input.ResourceKeys, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeRetentionConfigurationsRequest = ( input: DescribeRetentionConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.RetentionConfigurationNames !== undefined) { - bodyParams[ - "RetentionConfigurationNames" - ] = serializeAws_json1_1RetentionConfigurationNameList( - input.RetentionConfigurationNames, - context - ); - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.RetentionConfigurationNames !== undefined && { + RetentionConfigurationNames: serializeAws_json1_1RetentionConfigurationNameList( + input.RetentionConfigurationNames, + context + ) + }) + }; }; const serializeAws_json1_1Evaluation = ( input: Evaluation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Annotation !== undefined) { - bodyParams["Annotation"] = input.Annotation; - } - if (input.ComplianceResourceId !== undefined) { - bodyParams["ComplianceResourceId"] = input.ComplianceResourceId; - } - if (input.ComplianceResourceType !== undefined) { - bodyParams["ComplianceResourceType"] = input.ComplianceResourceType; - } - if (input.ComplianceType !== undefined) { - bodyParams["ComplianceType"] = input.ComplianceType; - } - if (input.OrderingTimestamp !== undefined) { - bodyParams["OrderingTimestamp"] = Math.round( - input.OrderingTimestamp.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1Evaluations = ( @@ -10478,418 +10327,320 @@ const serializeAws_json1_1ExecutionControls = ( input: ExecutionControls, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SsmControls !== undefined) { - bodyParams["SsmControls"] = serializeAws_json1_1SsmControls( - input.SsmControls, - context - ); - } - return bodyParams; + return { + ...(input.SsmControls !== undefined && { + SsmControls: serializeAws_json1_1SsmControls(input.SsmControls, context) + }) + }; }; const serializeAws_json1_1GetAggregateComplianceDetailsByConfigRuleRequest = ( input: GetAggregateComplianceDetailsByConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - if (input.ComplianceType !== undefined) { - bodyParams["ComplianceType"] = input.ComplianceType; - } - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetAggregateConfigRuleComplianceSummaryRequest = ( input: GetAggregateConfigRuleComplianceSummaryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.Filters !== undefined) { - bodyParams[ - "Filters" - ] = serializeAws_json1_1ConfigRuleComplianceSummaryFilters( - input.Filters, - context - ); - } - if (input.GroupByKey !== undefined) { - bodyParams["GroupByKey"] = input.GroupByKey; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetAggregateDiscoveredResourceCountsRequest = ( input: GetAggregateDiscoveredResourceCountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ResourceCountFilters( - input.Filters, - context - ); - } - if (input.GroupByKey !== undefined) { - bodyParams["GroupByKey"] = input.GroupByKey; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetAggregateResourceConfigRequest = ( input: GetAggregateResourceConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.ResourceIdentifier !== undefined) { - bodyParams[ - "ResourceIdentifier" - ] = serializeAws_json1_1AggregateResourceIdentifier( - input.ResourceIdentifier, - context - ); - } - return bodyParams; + return { + ...(input.ConfigurationAggregatorName !== undefined && { + ConfigurationAggregatorName: input.ConfigurationAggregatorName + }), + ...(input.ResourceIdentifier !== undefined && { + ResourceIdentifier: serializeAws_json1_1AggregateResourceIdentifier( + input.ResourceIdentifier, + context + ) + }) + }; }; const serializeAws_json1_1GetComplianceDetailsByConfigRuleRequest = ( input: GetComplianceDetailsByConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceTypes !== undefined) { - bodyParams["ComplianceTypes"] = serializeAws_json1_1ComplianceTypes( - input.ComplianceTypes, - context - ); - } - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetComplianceDetailsByResourceRequest = ( input: GetComplianceDetailsByResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceTypes !== undefined) { - bodyParams["ComplianceTypes"] = serializeAws_json1_1ComplianceTypes( - input.ComplianceTypes, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetComplianceSummaryByResourceTypeRequest = ( input: GetComplianceSummaryByResourceTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceTypes !== undefined) { - bodyParams["ResourceTypes"] = serializeAws_json1_1ResourceTypes( - input.ResourceTypes, - context - ); - } - return bodyParams; + return { + ...(input.ResourceTypes !== undefined && { + ResourceTypes: serializeAws_json1_1ResourceTypes( + input.ResourceTypes, + context + ) + }) + }; }; const serializeAws_json1_1GetConformancePackComplianceDetailsRequest = ( input: GetConformancePackComplianceDetailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackName !== undefined) { - bodyParams["ConformancePackName"] = input.ConformancePackName; - } - if (input.Filters !== undefined) { - bodyParams[ - "Filters" - ] = serializeAws_json1_1ConformancePackEvaluationFilters( - input.Filters, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetConformancePackComplianceSummaryRequest = ( input: GetConformancePackComplianceSummaryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackNames !== undefined) { - bodyParams[ - "ConformancePackNames" - ] = serializeAws_json1_1ConformancePackNamesToSummarizeList( - input.ConformancePackNames, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ConformancePackNames !== undefined && { + ConformancePackNames: serializeAws_json1_1ConformancePackNamesToSummarizeList( + input.ConformancePackNames, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetDiscoveredResourceCountsRequest = ( input: GetDiscoveredResourceCountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceTypes !== undefined) { - bodyParams["resourceTypes"] = serializeAws_json1_1ResourceTypes( - input.resourceTypes, - context - ); - } - return bodyParams; + return { + ...(input.limit !== undefined && { limit: input.limit }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.resourceTypes !== undefined && { + resourceTypes: serializeAws_json1_1ResourceTypes( + input.resourceTypes, + context + ) + }) + }; }; const serializeAws_json1_1GetOrganizationConfigRuleDetailedStatusRequest = ( input: GetOrganizationConfigRuleDetailedStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1StatusDetailFilters( - input.Filters, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationConfigRuleName !== undefined) { - bodyParams["OrganizationConfigRuleName"] = input.OrganizationConfigRuleName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetOrganizationConformancePackDetailedStatusRequest = ( input: GetOrganizationConformancePackDetailedStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams[ - "Filters" - ] = serializeAws_json1_1OrganizationResourceDetailedStatusFilters( - input.Filters, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationConformancePackName !== undefined) { - bodyParams["OrganizationConformancePackName"] = - input.OrganizationConformancePackName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetResourceConfigHistoryRequest = ( input: GetResourceConfigHistoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.chronologicalOrder !== undefined) { - bodyParams["chronologicalOrder"] = input.chronologicalOrder; - } - if (input.earlierTime !== undefined) { - bodyParams["earlierTime"] = Math.round(input.earlierTime.getTime() / 1000); - } - if (input.laterTime !== undefined) { - bodyParams["laterTime"] = Math.round(input.laterTime.getTime() / 1000); - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceId !== undefined) { - bodyParams["resourceId"] = input.resourceId; - } - if (input.resourceType !== undefined) { - bodyParams["resourceType"] = input.resourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListAggregateDiscoveredResourcesRequest = ( input: ListAggregateDiscoveredResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ResourceFilters( - input.Filters, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListDiscoveredResourcesRequest = ( input: ListDiscoveredResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.includeDeletedResources !== undefined) { - bodyParams["includeDeletedResources"] = input.includeDeletedResources; - } - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceIds !== undefined) { - bodyParams["resourceIds"] = serializeAws_json1_1ResourceIdList( - input.resourceIds, - context - ); - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - if (input.resourceType !== undefined) { - bodyParams["resourceType"] = input.resourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1OrganizationAggregationSource = ( input: OrganizationAggregationSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllAwsRegions !== undefined) { - bodyParams["AllAwsRegions"] = input.AllAwsRegions; - } - if (input.AwsRegions !== undefined) { - bodyParams["AwsRegions"] = serializeAws_json1_1AggregatorRegionList( - input.AwsRegions, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.AllAwsRegions !== undefined && { + AllAwsRegions: input.AllAwsRegions + }), + ...(input.AwsRegions !== undefined && { + AwsRegions: serializeAws_json1_1AggregatorRegionList( + input.AwsRegions, + context + ) + }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_json1_1OrganizationConfigRuleNames = ( @@ -10917,409 +10668,359 @@ const serializeAws_json1_1OrganizationCustomRuleMetadata = ( input: OrganizationCustomRuleMetadata, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.InputParameters !== undefined) { - bodyParams["InputParameters"] = input.InputParameters; - } - if (input.LambdaFunctionArn !== undefined) { - bodyParams["LambdaFunctionArn"] = input.LambdaFunctionArn; - } - if (input.MaximumExecutionFrequency !== undefined) { - bodyParams["MaximumExecutionFrequency"] = input.MaximumExecutionFrequency; - } - if (input.OrganizationConfigRuleTriggerTypes !== undefined) { - bodyParams[ - "OrganizationConfigRuleTriggerTypes" - ] = serializeAws_json1_1OrganizationConfigRuleTriggerTypes( - input.OrganizationConfigRuleTriggerTypes, - context - ); - } - if (input.ResourceIdScope !== undefined) { - bodyParams["ResourceIdScope"] = input.ResourceIdScope; - } - if (input.ResourceTypesScope !== undefined) { - bodyParams["ResourceTypesScope"] = serializeAws_json1_1ResourceTypesScope( - input.ResourceTypesScope, - context - ); - } - if (input.TagKeyScope !== undefined) { - bodyParams["TagKeyScope"] = input.TagKeyScope; - } - if (input.TagValueScope !== undefined) { - bodyParams["TagValueScope"] = input.TagValueScope; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1OrganizationManagedRuleMetadata = ( input: OrganizationManagedRuleMetadata, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.InputParameters !== undefined) { - bodyParams["InputParameters"] = input.InputParameters; - } - if (input.MaximumExecutionFrequency !== undefined) { - bodyParams["MaximumExecutionFrequency"] = input.MaximumExecutionFrequency; - } - if (input.ResourceIdScope !== undefined) { - bodyParams["ResourceIdScope"] = input.ResourceIdScope; - } - if (input.ResourceTypesScope !== undefined) { - bodyParams["ResourceTypesScope"] = serializeAws_json1_1ResourceTypesScope( - input.ResourceTypesScope, - context - ); - } - if (input.RuleIdentifier !== undefined) { - bodyParams["RuleIdentifier"] = input.RuleIdentifier; - } - if (input.TagKeyScope !== undefined) { - bodyParams["TagKeyScope"] = input.TagKeyScope; - } - if (input.TagValueScope !== undefined) { - bodyParams["TagValueScope"] = input.TagValueScope; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1OrganizationResourceDetailedStatusFilters = ( input: OrganizationResourceDetailedStatusFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.Status !== undefined && { Status: input.Status }) + }; }; const serializeAws_json1_1PutAggregationAuthorizationRequest = ( input: PutAggregationAuthorizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthorizedAccountId !== undefined) { - bodyParams["AuthorizedAccountId"] = input.AuthorizedAccountId; - } - if (input.AuthorizedAwsRegion !== undefined) { - bodyParams["AuthorizedAwsRegion"] = input.AuthorizedAwsRegion; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsList(input.Tags, context); - } - return bodyParams; + return { + ...(input.AuthorizedAccountId !== undefined && { + AuthorizedAccountId: input.AuthorizedAccountId + }), + ...(input.AuthorizedAwsRegion !== undefined && { + AuthorizedAwsRegion: input.AuthorizedAwsRegion + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagsList(input.Tags, context) + }) + }; }; const serializeAws_json1_1PutConfigRuleRequest = ( input: PutConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRule !== undefined) { - bodyParams["ConfigRule"] = serializeAws_json1_1ConfigRule( - input.ConfigRule, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ConfigRule !== undefined && { + ConfigRule: serializeAws_json1_1ConfigRule(input.ConfigRule, context) + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagsList(input.Tags, context) + }) + }; }; const serializeAws_json1_1PutConfigurationAggregatorRequest = ( input: PutConfigurationAggregatorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountAggregationSources !== undefined) { - bodyParams[ - "AccountAggregationSources" - ] = serializeAws_json1_1AccountAggregationSourceList( - input.AccountAggregationSources, - context - ); - } - if (input.ConfigurationAggregatorName !== undefined) { - bodyParams["ConfigurationAggregatorName"] = - input.ConfigurationAggregatorName; - } - if (input.OrganizationAggregationSource !== undefined) { - bodyParams[ - "OrganizationAggregationSource" - ] = serializeAws_json1_1OrganizationAggregationSource( - input.OrganizationAggregationSource, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutConfigurationRecorderRequest = ( input: PutConfigurationRecorderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationRecorder !== undefined) { - bodyParams[ - "ConfigurationRecorder" - ] = serializeAws_json1_1ConfigurationRecorder( - input.ConfigurationRecorder, - context - ); - } - return bodyParams; + return { + ...(input.ConfigurationRecorder !== undefined && { + ConfigurationRecorder: serializeAws_json1_1ConfigurationRecorder( + input.ConfigurationRecorder, + context + ) + }) + }; }; const serializeAws_json1_1PutConformancePackRequest = ( input: PutConformancePackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackInputParameters !== undefined) { - bodyParams[ - "ConformancePackInputParameters" - ] = serializeAws_json1_1ConformancePackInputParameters( - input.ConformancePackInputParameters, - context - ); - } - if (input.ConformancePackName !== undefined) { - bodyParams["ConformancePackName"] = input.ConformancePackName; - } - if (input.DeliveryS3Bucket !== undefined) { - bodyParams["DeliveryS3Bucket"] = input.DeliveryS3Bucket; - } - if (input.DeliveryS3KeyPrefix !== undefined) { - bodyParams["DeliveryS3KeyPrefix"] = input.DeliveryS3KeyPrefix; - } - if (input.TemplateBody !== undefined) { - bodyParams["TemplateBody"] = input.TemplateBody; - } - if (input.TemplateS3Uri !== undefined) { - bodyParams["TemplateS3Uri"] = input.TemplateS3Uri; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1PutDeliveryChannelRequest = ( input: PutDeliveryChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryChannel !== undefined) { - bodyParams["DeliveryChannel"] = serializeAws_json1_1DeliveryChannel( - input.DeliveryChannel, - context - ); - } - return bodyParams; + return { + ...(input.DeliveryChannel !== undefined && { + DeliveryChannel: serializeAws_json1_1DeliveryChannel( + input.DeliveryChannel, + context + ) + }) + }; }; const serializeAws_json1_1PutEvaluationsRequest = ( input: PutEvaluationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Evaluations !== undefined) { - bodyParams["Evaluations"] = serializeAws_json1_1Evaluations( - input.Evaluations, - context - ); - } - if (input.ResultToken !== undefined) { - bodyParams["ResultToken"] = input.ResultToken; - } - if (input.TestMode !== undefined) { - bodyParams["TestMode"] = input.TestMode; - } - return bodyParams; + return { + ...(input.Evaluations !== undefined && { + Evaluations: serializeAws_json1_1Evaluations(input.Evaluations, context) + }), + ...(input.ResultToken !== undefined && { ResultToken: input.ResultToken }), + ...(input.TestMode !== undefined && { TestMode: input.TestMode }) + }; }; const serializeAws_json1_1PutOrganizationConfigRuleRequest = ( input: PutOrganizationConfigRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludedAccounts !== undefined) { - bodyParams["ExcludedAccounts"] = serializeAws_json1_1ExcludedAccounts( - input.ExcludedAccounts, - context - ); - } - if (input.OrganizationConfigRuleName !== undefined) { - bodyParams["OrganizationConfigRuleName"] = input.OrganizationConfigRuleName; - } - if (input.OrganizationCustomRuleMetadata !== undefined) { - bodyParams[ - "OrganizationCustomRuleMetadata" - ] = serializeAws_json1_1OrganizationCustomRuleMetadata( - input.OrganizationCustomRuleMetadata, - context - ); - } - if (input.OrganizationManagedRuleMetadata !== undefined) { - bodyParams[ - "OrganizationManagedRuleMetadata" - ] = serializeAws_json1_1OrganizationManagedRuleMetadata( - input.OrganizationManagedRuleMetadata, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutOrganizationConformancePackRequest = ( input: PutOrganizationConformancePackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConformancePackInputParameters !== undefined) { - bodyParams[ - "ConformancePackInputParameters" - ] = serializeAws_json1_1ConformancePackInputParameters( - input.ConformancePackInputParameters, - context - ); - } - if (input.DeliveryS3Bucket !== undefined) { - bodyParams["DeliveryS3Bucket"] = input.DeliveryS3Bucket; - } - if (input.DeliveryS3KeyPrefix !== undefined) { - bodyParams["DeliveryS3KeyPrefix"] = input.DeliveryS3KeyPrefix; - } - if (input.ExcludedAccounts !== undefined) { - bodyParams["ExcludedAccounts"] = serializeAws_json1_1ExcludedAccounts( - input.ExcludedAccounts, - context - ); - } - if (input.OrganizationConformancePackName !== undefined) { - bodyParams["OrganizationConformancePackName"] = - input.OrganizationConformancePackName; - } - if (input.TemplateBody !== undefined) { - bodyParams["TemplateBody"] = input.TemplateBody; - } - if (input.TemplateS3Uri !== undefined) { - bodyParams["TemplateS3Uri"] = input.TemplateS3Uri; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1PutRemediationConfigurationsRequest = ( input: PutRemediationConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RemediationConfigurations !== undefined) { - bodyParams[ - "RemediationConfigurations" - ] = serializeAws_json1_1RemediationConfigurations( - input.RemediationConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.RemediationConfigurations !== undefined && { + RemediationConfigurations: serializeAws_json1_1RemediationConfigurations( + input.RemediationConfigurations, + context + ) + }) + }; }; const serializeAws_json1_1PutRemediationExceptionsRequest = ( input: PutRemediationExceptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.ExpirationTime !== undefined) { - bodyParams["ExpirationTime"] = Math.round( - input.ExpirationTime.getTime() / 1000 - ); - } - if (input.Message !== undefined) { - bodyParams["Message"] = input.Message; - } - if (input.ResourceKeys !== undefined) { - bodyParams[ - "ResourceKeys" - ] = serializeAws_json1_1RemediationExceptionResourceKeys( - input.ResourceKeys, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutResourceConfigRequest = ( input: PutResourceConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = input.Configuration; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.SchemaVersionId !== undefined) { - bodyParams["SchemaVersionId"] = input.SchemaVersionId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutRetentionConfigurationRequest = ( input: PutRetentionConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RetentionPeriodInDays !== undefined) { - bodyParams["RetentionPeriodInDays"] = input.RetentionPeriodInDays; - } - return bodyParams; + return { + ...(input.RetentionPeriodInDays !== undefined && { + RetentionPeriodInDays: input.RetentionPeriodInDays + }) + }; }; const serializeAws_json1_1RecordingGroup = ( input: RecordingGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.allSupported !== undefined) { - bodyParams["allSupported"] = input.allSupported; - } - if (input.includeGlobalResourceTypes !== undefined) { - bodyParams["includeGlobalResourceTypes"] = input.includeGlobalResourceTypes; - } - if (input.resourceTypes !== undefined) { - bodyParams["resourceTypes"] = serializeAws_json1_1ResourceTypeList( - input.resourceTypes, - context - ); - } - return bodyParams; + return { + ...(input.allSupported !== undefined && { + allSupported: input.allSupported + }), + ...(input.includeGlobalResourceTypes !== undefined && { + includeGlobalResourceTypes: input.includeGlobalResourceTypes + }), + ...(input.resourceTypes !== undefined && { + resourceTypes: serializeAws_json1_1ResourceTypeList( + input.resourceTypes, + context + ) + }) + }; }; const serializeAws_json1_1ReevaluateConfigRuleNames = ( @@ -11333,50 +11034,42 @@ const serializeAws_json1_1RemediationConfiguration = ( input: RemediationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.Automatic !== undefined) { - bodyParams["Automatic"] = input.Automatic; - } - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.CreatedByService !== undefined) { - bodyParams["CreatedByService"] = input.CreatedByService; - } - if (input.ExecutionControls !== undefined) { - bodyParams["ExecutionControls"] = serializeAws_json1_1ExecutionControls( - input.ExecutionControls, - context - ); - } - if (input.MaximumAutomaticAttempts !== undefined) { - bodyParams["MaximumAutomaticAttempts"] = input.MaximumAutomaticAttempts; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1RemediationParameters( - input.Parameters, - context - ); - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.RetryAttemptSeconds !== undefined) { - bodyParams["RetryAttemptSeconds"] = input.RetryAttemptSeconds; - } - if (input.TargetId !== undefined) { - bodyParams["TargetId"] = input.TargetId; - } - if (input.TargetType !== undefined) { - bodyParams["TargetType"] = input.TargetType; - } - if (input.TargetVersion !== undefined) { - bodyParams["TargetVersion"] = input.TargetVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1RemediationConfigurations = ( @@ -11392,14 +11085,12 @@ const serializeAws_json1_1RemediationExceptionResourceKey = ( input: RemediationExceptionResourceKey, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1RemediationExceptionResourceKeys = ( @@ -11415,20 +11106,17 @@ const serializeAws_json1_1RemediationParameterValue = ( input: RemediationParameterValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceValue !== undefined) { - bodyParams["ResourceValue"] = serializeAws_json1_1ResourceValue( - input.ResourceValue, - context - ); - } - if (input.StaticValue !== undefined) { - bodyParams["StaticValue"] = serializeAws_json1_1StaticValue( - input.StaticValue, - context - ); - } - return bodyParams; + return { + ...(input.ResourceValue !== undefined && { + ResourceValue: serializeAws_json1_1ResourceValue( + input.ResourceValue, + context + ) + }), + ...(input.StaticValue !== undefined && { + StaticValue: serializeAws_json1_1StaticValue(input.StaticValue, context) + }) + }; }; const serializeAws_json1_1RemediationParameters = ( @@ -11448,37 +11136,27 @@ const serializeAws_json1_1ResourceCountFilters = ( input: ResourceCountFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.Region !== undefined && { Region: input.Region }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1ResourceFilters = ( input: ResourceFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ResourceIdList = ( @@ -11501,14 +11179,12 @@ const serializeAws_json1_1ResourceKey = ( input: ResourceKey, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceId !== undefined) { - bodyParams["resourceId"] = input.resourceId; - } - if (input.resourceType !== undefined) { - bodyParams["resourceType"] = input.resourceType; - } - return bodyParams; + return { + ...(input.resourceId !== undefined && { resourceId: input.resourceId }), + ...(input.resourceType !== undefined && { + resourceType: input.resourceType + }) + }; }; const serializeAws_json1_1ResourceKeys = ( @@ -11543,11 +11219,9 @@ const serializeAws_json1_1ResourceValue = ( input: ResourceValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1RetentionConfigurationNameList = ( @@ -11561,79 +11235,61 @@ const serializeAws_json1_1Scope = ( input: Scope, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceResourceId !== undefined) { - bodyParams["ComplianceResourceId"] = input.ComplianceResourceId; - } - if (input.ComplianceResourceTypes !== undefined) { - bodyParams[ - "ComplianceResourceTypes" - ] = serializeAws_json1_1ComplianceResourceTypes( - input.ComplianceResourceTypes, - context - ); - } - if (input.TagKey !== undefined) { - bodyParams["TagKey"] = input.TagKey; - } - if (input.TagValue !== undefined) { - bodyParams["TagValue"] = input.TagValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SelectResourceConfigRequest = ( input: SelectResourceConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Expression !== undefined) { - bodyParams["Expression"] = input.Expression; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Expression !== undefined && { Expression: input.Expression }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1Source = ( input: Source, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Owner !== undefined) { - bodyParams["Owner"] = input.Owner; - } - if (input.SourceDetails !== undefined) { - bodyParams["SourceDetails"] = serializeAws_json1_1SourceDetails( - input.SourceDetails, - context - ); - } - if (input.SourceIdentifier !== undefined) { - bodyParams["SourceIdentifier"] = input.SourceIdentifier; - } - return bodyParams; + return { + ...(input.Owner !== undefined && { Owner: input.Owner }), + ...(input.SourceDetails !== undefined && { + SourceDetails: serializeAws_json1_1SourceDetails( + input.SourceDetails, + context + ) + }), + ...(input.SourceIdentifier !== undefined && { + SourceIdentifier: input.SourceIdentifier + }) + }; }; const serializeAws_json1_1SourceDetail = ( input: SourceDetail, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventSource !== undefined) { - bodyParams["EventSource"] = input.EventSource; - } - if (input.MaximumExecutionFrequency !== undefined) { - bodyParams["MaximumExecutionFrequency"] = input.MaximumExecutionFrequency; - } - if (input.MessageType !== undefined) { - bodyParams["MessageType"] = input.MessageType; - } - return bodyParams; + return { + ...(input.EventSource !== undefined && { EventSource: input.EventSource }), + ...(input.MaximumExecutionFrequency !== undefined && { + MaximumExecutionFrequency: input.MaximumExecutionFrequency + }), + ...(input.MessageType !== undefined && { MessageType: input.MessageType }) + }; }; const serializeAws_json1_1SourceDetails = ( @@ -11647,59 +11303,56 @@ const serializeAws_json1_1SsmControls = ( input: SsmControls, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConcurrentExecutionRatePercentage !== undefined) { - bodyParams["ConcurrentExecutionRatePercentage"] = - input.ConcurrentExecutionRatePercentage; - } - if (input.ErrorPercentage !== undefined) { - bodyParams["ErrorPercentage"] = input.ErrorPercentage; - } - return bodyParams; + return { + ...(input.ConcurrentExecutionRatePercentage !== undefined && { + ConcurrentExecutionRatePercentage: input.ConcurrentExecutionRatePercentage + }), + ...(input.ErrorPercentage !== undefined && { + ErrorPercentage: input.ErrorPercentage + }) + }; }; const serializeAws_json1_1StartConfigRulesEvaluationRequest = ( input: StartConfigRulesEvaluationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleNames !== undefined) { - bodyParams[ - "ConfigRuleNames" - ] = serializeAws_json1_1ReevaluateConfigRuleNames( - input.ConfigRuleNames, - context - ); - } - return bodyParams; + return { + ...(input.ConfigRuleNames !== undefined && { + ConfigRuleNames: serializeAws_json1_1ReevaluateConfigRuleNames( + input.ConfigRuleNames, + context + ) + }) + }; }; const serializeAws_json1_1StartConfigurationRecorderRequest = ( input: StartConfigurationRecorderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationRecorderName !== undefined) { - bodyParams["ConfigurationRecorderName"] = input.ConfigurationRecorderName; - } - return bodyParams; + return { + ...(input.ConfigurationRecorderName !== undefined && { + ConfigurationRecorderName: input.ConfigurationRecorderName + }) + }; }; const serializeAws_json1_1StartRemediationExecutionRequest = ( input: StartRemediationExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigRuleName !== undefined) { - bodyParams["ConfigRuleName"] = input.ConfigRuleName; - } - if (input.ResourceKeys !== undefined) { - bodyParams["ResourceKeys"] = serializeAws_json1_1ResourceKeys( - input.ResourceKeys, - context - ); - } - return bodyParams; + return { + ...(input.ConfigRuleName !== undefined && { + ConfigRuleName: input.ConfigRuleName + }), + ...(input.ResourceKeys !== undefined && { + ResourceKeys: serializeAws_json1_1ResourceKeys( + input.ResourceKeys, + context + ) + }) + }; }; const serializeAws_json1_1StaticParameterValues = ( @@ -11713,50 +11366,41 @@ const serializeAws_json1_1StaticValue = ( input: StaticValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1StaticParameterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Values !== undefined && { + Values: serializeAws_json1_1StaticParameterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1StatusDetailFilters = ( input: StatusDetailFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.MemberAccountRuleStatus !== undefined) { - bodyParams["MemberAccountRuleStatus"] = input.MemberAccountRuleStatus; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.MemberAccountRuleStatus !== undefined && { + MemberAccountRuleStatus: input.MemberAccountRuleStatus + }) + }; }; const serializeAws_json1_1StopConfigurationRecorderRequest = ( input: StopConfigurationRecorderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationRecorderName !== undefined) { - bodyParams["ConfigurationRecorderName"] = input.ConfigurationRecorderName; - } - return bodyParams; + return { + ...(input.ConfigurationRecorderName !== undefined && { + ConfigurationRecorderName: input.ConfigurationRecorderName + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -11777,14 +11421,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -11808,17 +11450,12 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const deserializeAws_json1_1AccountAggregationSource = ( diff --git a/clients/client-connect/protocols/Aws_restJson1_1.ts b/clients/client-connect/protocols/Aws_restJson1_1.ts index 61e0386afe40..c04e746d865d 100644 --- a/clients/client-connect/protocols/Aws_restJson1_1.ts +++ b/clients/client-connect/protocols/Aws_restJson1_1.ts @@ -4847,25 +4847,19 @@ const serializeAws_restJson1_1ChatMessage = ( input: ChatMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - if (input.ContentType !== undefined) { - bodyParams["ContentType"] = input.ContentType; - } - return bodyParams; + return { + ...(input.Content !== undefined && { Content: input.Content }), + ...(input.ContentType !== undefined && { ContentType: input.ContentType }) + }; }; const serializeAws_restJson1_1ParticipantDetails = ( input: ParticipantDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - return bodyParams; + return { + ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }) + }; }; const serializeAws_restJson1_1Channels = ( @@ -4879,14 +4873,10 @@ const serializeAws_restJson1_1CurrentMetric = ( input: CurrentMetric, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Unit !== undefined && { Unit: input.Unit }) + }; }; const serializeAws_restJson1_1CurrentMetrics = ( @@ -4902,20 +4892,14 @@ const serializeAws_restJson1_1Filters = ( input: Filters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Channels !== undefined) { - bodyParams["Channels"] = serializeAws_restJson1_1Channels( - input.Channels, - context - ); - } - if (input.Queues !== undefined) { - bodyParams["Queues"] = serializeAws_restJson1_1Queues( - input.Queues, - context - ); - } - return bodyParams; + return { + ...(input.Channels !== undefined && { + Channels: serializeAws_restJson1_1Channels(input.Channels, context) + }), + ...(input.Queues !== undefined && { + Queues: serializeAws_restJson1_1Queues(input.Queues, context) + }) + }; }; const serializeAws_restJson1_1Groupings = ( @@ -4929,23 +4913,14 @@ const serializeAws_restJson1_1HistoricalMetric = ( input: HistoricalMetric, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Statistic !== undefined) { - bodyParams["Statistic"] = input.Statistic; - } - if (input.Threshold !== undefined) { - bodyParams["Threshold"] = serializeAws_restJson1_1Threshold( - input.Threshold, - context - ); - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Statistic !== undefined && { Statistic: input.Statistic }), + ...(input.Threshold !== undefined && { + Threshold: serializeAws_restJson1_1Threshold(input.Threshold, context) + }), + ...(input.Unit !== undefined && { Unit: input.Unit }) + }; }; const serializeAws_restJson1_1HistoricalMetrics = ( @@ -4968,14 +4943,12 @@ const serializeAws_restJson1_1Threshold = ( input: Threshold, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Comparison !== undefined) { - bodyParams["Comparison"] = input.Comparison; - } - if (input.ThresholdValue !== undefined) { - bodyParams["ThresholdValue"] = input.ThresholdValue; - } - return bodyParams; + return { + ...(input.Comparison !== undefined && { Comparison: input.Comparison }), + ...(input.ThresholdValue !== undefined && { + ThresholdValue: input.ThresholdValue + }) + }; }; const serializeAws_restJson1_1SecurityProfileIds = ( @@ -4999,37 +4972,27 @@ const serializeAws_restJson1_1UserIdentityInfo = ( input: UserIdentityInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.FirstName !== undefined) { - bodyParams["FirstName"] = input.FirstName; - } - if (input.LastName !== undefined) { - bodyParams["LastName"] = input.LastName; - } - return bodyParams; + return { + ...(input.Email !== undefined && { Email: input.Email }), + ...(input.FirstName !== undefined && { FirstName: input.FirstName }), + ...(input.LastName !== undefined && { LastName: input.LastName }) + }; }; const serializeAws_restJson1_1UserPhoneConfig = ( input: UserPhoneConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AfterContactWorkTimeLimit !== undefined) { - bodyParams["AfterContactWorkTimeLimit"] = input.AfterContactWorkTimeLimit; - } - if (input.AutoAccept !== undefined) { - bodyParams["AutoAccept"] = input.AutoAccept; - } - if (input.DeskPhoneNumber !== undefined) { - bodyParams["DeskPhoneNumber"] = input.DeskPhoneNumber; - } - if (input.PhoneType !== undefined) { - bodyParams["PhoneType"] = input.PhoneType; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_restJson1_1Attributes = ( diff --git a/clients/client-connectparticipant/protocols/Aws_restJson1_1.ts b/clients/client-connectparticipant/protocols/Aws_restJson1_1.ts index 84798ae20b61..1436b6fef6c7 100644 --- a/clients/client-connectparticipant/protocols/Aws_restJson1_1.ts +++ b/clients/client-connectparticipant/protocols/Aws_restJson1_1.ts @@ -802,17 +802,13 @@ const serializeAws_restJson1_1StartPosition = ( input: StartPosition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AbsoluteTime !== undefined) { - bodyParams["AbsoluteTime"] = input.AbsoluteTime; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.MostRecent !== undefined) { - bodyParams["MostRecent"] = input.MostRecent; - } - return bodyParams; + return { + ...(input.AbsoluteTime !== undefined && { + AbsoluteTime: input.AbsoluteTime + }), + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.MostRecent !== undefined && { MostRecent: input.MostRecent }) + }; }; const deserializeAws_restJson1_1Item = ( 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 bcc9449afdbc..df9db9cd6536 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 @@ -503,107 +503,81 @@ const serializeAws_json1_1DeleteReportDefinitionRequest = ( input: DeleteReportDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReportName !== undefined) { - bodyParams["ReportName"] = input.ReportName; - } - return bodyParams; + return { + ...(input.ReportName !== undefined && { ReportName: input.ReportName }) + }; }; const serializeAws_json1_1DescribeReportDefinitionsRequest = ( input: DescribeReportDefinitionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ModifyReportDefinitionRequest = ( input: ModifyReportDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReportDefinition !== undefined) { - bodyParams["ReportDefinition"] = serializeAws_json1_1ReportDefinition( - input.ReportDefinition, - context - ); - } - if (input.ReportName !== undefined) { - bodyParams["ReportName"] = input.ReportName; - } - return bodyParams; + return { + ...(input.ReportDefinition !== undefined && { + ReportDefinition: serializeAws_json1_1ReportDefinition( + input.ReportDefinition, + context + ) + }), + ...(input.ReportName !== undefined && { ReportName: input.ReportName }) + }; }; const serializeAws_json1_1PutReportDefinitionRequest = ( input: PutReportDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReportDefinition !== undefined) { - bodyParams["ReportDefinition"] = serializeAws_json1_1ReportDefinition( - input.ReportDefinition, - context - ); - } - return bodyParams; + return { + ...(input.ReportDefinition !== undefined && { + ReportDefinition: serializeAws_json1_1ReportDefinition( + input.ReportDefinition, + context + ) + }) + }; }; const serializeAws_json1_1ReportDefinition = ( input: ReportDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalArtifacts !== undefined) { - bodyParams[ - "AdditionalArtifacts" - ] = serializeAws_json1_1AdditionalArtifactList( - input.AdditionalArtifacts, - context - ); - } - if (input.AdditionalSchemaElements !== undefined) { - bodyParams[ - "AdditionalSchemaElements" - ] = serializeAws_json1_1SchemaElementList( - input.AdditionalSchemaElements, - context - ); - } - if (input.Compression !== undefined) { - bodyParams["Compression"] = input.Compression; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.RefreshClosedReports !== undefined) { - bodyParams["RefreshClosedReports"] = input.RefreshClosedReports; - } - if (input.ReportName !== undefined) { - bodyParams["ReportName"] = input.ReportName; - } - if (input.ReportVersioning !== undefined) { - bodyParams["ReportVersioning"] = input.ReportVersioning; - } - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3Prefix !== undefined) { - bodyParams["S3Prefix"] = input.S3Prefix; - } - if (input.S3Region !== undefined) { - bodyParams["S3Region"] = input.S3Region; - } - if (input.TimeUnit !== undefined) { - bodyParams["TimeUnit"] = input.TimeUnit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SchemaElementList = ( diff --git a/clients/client-cost-explorer/protocols/Aws_json1_1.ts b/clients/client-cost-explorer/protocols/Aws_json1_1.ts index c15a6abc62cb..ececf232b5a6 100644 --- a/clients/client-cost-explorer/protocols/Aws_json1_1.ts +++ b/clients/client-cost-explorer/protocols/Aws_json1_1.ts @@ -2267,14 +2267,12 @@ const serializeAws_json1_1CostCategoryRule = ( input: CostCategoryRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Rule !== undefined) { - bodyParams["Rule"] = serializeAws_json1_1Expression(input.Rule, context); - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Rule !== undefined && { + Rule: serializeAws_json1_1Expression(input.Rule, context) + }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1CostCategoryRulesList = ( @@ -2290,130 +2288,110 @@ const serializeAws_json1_1CostCategoryValues = ( input: CostCategoryValues, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1Values(input.Values, context); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1Values(input.Values, context) + }) + }; }; const serializeAws_json1_1CreateCostCategoryDefinitionRequest = ( input: CreateCostCategoryDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RuleVersion !== undefined) { - bodyParams["RuleVersion"] = input.RuleVersion; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1CostCategoryRulesList( - input.Rules, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RuleVersion !== undefined && { RuleVersion: input.RuleVersion }), + ...(input.Rules !== undefined && { + Rules: serializeAws_json1_1CostCategoryRulesList(input.Rules, context) + }) + }; }; const serializeAws_json1_1DateInterval = ( input: DateInterval, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.End !== undefined) { - bodyParams["End"] = input.End; - } - if (input.Start !== undefined) { - bodyParams["Start"] = input.Start; - } - return bodyParams; + return { + ...(input.End !== undefined && { End: input.End }), + ...(input.Start !== undefined && { Start: input.Start }) + }; }; const serializeAws_json1_1DeleteCostCategoryDefinitionRequest = ( input: DeleteCostCategoryDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CostCategoryArn !== undefined) { - bodyParams["CostCategoryArn"] = input.CostCategoryArn; - } - return bodyParams; + return { + ...(input.CostCategoryArn !== undefined && { + CostCategoryArn: input.CostCategoryArn + }) + }; }; const serializeAws_json1_1DescribeCostCategoryDefinitionRequest = ( input: DescribeCostCategoryDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CostCategoryArn !== undefined) { - bodyParams["CostCategoryArn"] = input.CostCategoryArn; - } - if (input.EffectiveOn !== undefined) { - bodyParams["EffectiveOn"] = input.EffectiveOn; - } - return bodyParams; + return { + ...(input.CostCategoryArn !== undefined && { + CostCategoryArn: input.CostCategoryArn + }), + ...(input.EffectiveOn !== undefined && { EffectiveOn: input.EffectiveOn }) + }; }; const serializeAws_json1_1DimensionValues = ( input: DimensionValues, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1Values(input.Values, context); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1Values(input.Values, context) + }) + }; }; const serializeAws_json1_1EC2Specification = ( input: EC2Specification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OfferingClass !== undefined) { - bodyParams["OfferingClass"] = input.OfferingClass; - } - return bodyParams; + return { + ...(input.OfferingClass !== undefined && { + OfferingClass: input.OfferingClass + }) + }; }; const serializeAws_json1_1Expression = ( input: Expression, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.And !== undefined) { - bodyParams["And"] = serializeAws_json1_1Expressions(input.And, context); - } - if (input.CostCategories !== undefined) { - bodyParams["CostCategories"] = serializeAws_json1_1CostCategoryValues( - input.CostCategories, - context - ); - } - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_json1_1DimensionValues( - input.Dimensions, - context - ); - } - if (input.Not !== undefined) { - bodyParams["Not"] = serializeAws_json1_1Expression(input.Not, context); - } - if (input.Or !== undefined) { - bodyParams["Or"] = serializeAws_json1_1Expressions(input.Or, context); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagValues(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1Expressions = ( @@ -2427,446 +2405,300 @@ const serializeAws_json1_1GetCostAndUsageRequest = ( input: GetCostAndUsageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1GroupDefinitions( - input.GroupBy, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_json1_1MetricNames( - input.Metrics, - context - ); - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetCostAndUsageWithResourcesRequest = ( input: GetCostAndUsageWithResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1GroupDefinitions( - input.GroupBy, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_json1_1MetricNames( - input.Metrics, - context - ); - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetCostForecastRequest = ( input: GetCostForecastRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.Metric !== undefined) { - bodyParams["Metric"] = input.Metric; - } - if (input.PredictionIntervalLevel !== undefined) { - bodyParams["PredictionIntervalLevel"] = input.PredictionIntervalLevel; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetDimensionValuesRequest = ( input: GetDimensionValuesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Context !== undefined) { - bodyParams["Context"] = input.Context; - } - if (input.Dimension !== undefined) { - bodyParams["Dimension"] = input.Dimension; - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.SearchString !== undefined) { - bodyParams["SearchString"] = input.SearchString; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetReservationCoverageRequest = ( input: GetReservationCoverageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1GroupDefinitions( - input.GroupBy, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_json1_1MetricNames( - input.Metrics, - context - ); - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetReservationPurchaseRecommendationRequest = ( input: GetReservationPurchaseRecommendationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.AccountScope !== undefined) { - bodyParams["AccountScope"] = input.AccountScope; - } - if (input.LookbackPeriodInDays !== undefined) { - bodyParams["LookbackPeriodInDays"] = input.LookbackPeriodInDays; - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PaymentOption !== undefined) { - bodyParams["PaymentOption"] = input.PaymentOption; - } - if (input.Service !== undefined) { - bodyParams["Service"] = input.Service; - } - if (input.ServiceSpecification !== undefined) { - bodyParams[ - "ServiceSpecification" - ] = serializeAws_json1_1ServiceSpecification( - input.ServiceSpecification, - context - ); - } - if (input.TermInYears !== undefined) { - bodyParams["TermInYears"] = input.TermInYears; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetReservationUtilizationRequest = ( input: GetReservationUtilizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1GroupDefinitions( - input.GroupBy, - context - ); - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetRightsizingRecommendationRequest = ( input: GetRightsizingRecommendationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.Service !== undefined) { - bodyParams["Service"] = input.Service; - } - return bodyParams; + return { + ...(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 }) + }; }; const serializeAws_json1_1GetSavingsPlansCoverageRequest = ( input: GetSavingsPlansCoverageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1GroupDefinitions( - input.GroupBy, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_json1_1MetricNames( - input.Metrics, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetSavingsPlansPurchaseRecommendationRequest = ( input: GetSavingsPlansPurchaseRecommendationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LookbackPeriodInDays !== undefined) { - bodyParams["LookbackPeriodInDays"] = input.LookbackPeriodInDays; - } - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PaymentOption !== undefined) { - bodyParams["PaymentOption"] = input.PaymentOption; - } - if (input.SavingsPlansType !== undefined) { - bodyParams["SavingsPlansType"] = input.SavingsPlansType; - } - if (input.TermInYears !== undefined) { - bodyParams["TermInYears"] = input.TermInYears; - } - return bodyParams; + return { + ...(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 }) + }; }; const serializeAws_json1_1GetSavingsPlansUtilizationDetailsRequest = ( input: GetSavingsPlansUtilizationDetailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetSavingsPlansUtilizationRequest = ( input: GetSavingsPlansUtilizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetTagsRequest = ( input: GetTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.SearchString !== undefined) { - bodyParams["SearchString"] = input.SearchString; - } - if (input.TagKey !== undefined) { - bodyParams["TagKey"] = input.TagKey; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetUsageForecastRequest = ( input: GetUsageForecastRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1Expression( - input.Filter, - context - ); - } - if (input.Granularity !== undefined) { - bodyParams["Granularity"] = input.Granularity; - } - if (input.Metric !== undefined) { - bodyParams["Metric"] = input.Metric; - } - if (input.PredictionIntervalLevel !== undefined) { - bodyParams["PredictionIntervalLevel"] = input.PredictionIntervalLevel; - } - if (input.TimePeriod !== undefined) { - bodyParams["TimePeriod"] = serializeAws_json1_1DateInterval( - input.TimePeriod, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GroupDefinition = ( input: GroupDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1GroupDefinitions = ( @@ -2882,14 +2714,10 @@ const serializeAws_json1_1ListCostCategoryDefinitionsRequest = ( input: ListCostCategoryDefinitionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EffectiveOn !== undefined) { - bodyParams["EffectiveOn"] = input.EffectiveOn; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.EffectiveOn !== undefined && { EffectiveOn: input.EffectiveOn }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1MetricNames = ( @@ -2903,48 +2731,41 @@ const serializeAws_json1_1ServiceSpecification = ( input: ServiceSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EC2Specification !== undefined) { - bodyParams["EC2Specification"] = serializeAws_json1_1EC2Specification( - input.EC2Specification, - context - ); - } - return bodyParams; + return { + ...(input.EC2Specification !== undefined && { + EC2Specification: serializeAws_json1_1EC2Specification( + input.EC2Specification, + context + ) + }) + }; }; const serializeAws_json1_1TagValues = ( input: TagValues, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1Values(input.Values, context); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1Values(input.Values, context) + }) + }; }; const serializeAws_json1_1UpdateCostCategoryDefinitionRequest = ( input: UpdateCostCategoryDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CostCategoryArn !== undefined) { - bodyParams["CostCategoryArn"] = input.CostCategoryArn; - } - if (input.RuleVersion !== undefined) { - bodyParams["RuleVersion"] = input.RuleVersion; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1CostCategoryRulesList( - input.Rules, - context - ); - } - return bodyParams; + return { + ...(input.CostCategoryArn !== undefined && { + CostCategoryArn: input.CostCategoryArn + }), + ...(input.RuleVersion !== undefined && { RuleVersion: input.RuleVersion }), + ...(input.Rules !== undefined && { + Rules: serializeAws_json1_1CostCategoryRulesList(input.Rules, context) + }) + }; }; const serializeAws_json1_1Values = ( diff --git a/clients/client-data-pipeline/protocols/Aws_json1_1.ts b/clients/client-data-pipeline/protocols/Aws_json1_1.ts index def79dd81056..08d4e5565a29 100644 --- a/clients/client-data-pipeline/protocols/Aws_json1_1.ts +++ b/clients/client-data-pipeline/protocols/Aws_json1_1.ts @@ -2241,222 +2241,165 @@ const serializeAws_json1_1ActivatePipelineInput = ( input: ActivatePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.parameterValues !== undefined) { - bodyParams["parameterValues"] = serializeAws_json1_1ParameterValueList( - input.parameterValues, - context - ); - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.startTimestamp !== undefined) { - bodyParams["startTimestamp"] = Math.round( - input.startTimestamp.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1AddTagsInput = ( input: AddTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1tagList(input.tags, context); - } - return bodyParams; + return { + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1tagList(input.tags, context) + }) + }; }; const serializeAws_json1_1CreatePipelineInput = ( input: CreatePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1tagList(input.tags, context); - } - if (input.uniqueId !== undefined) { - bodyParams["uniqueId"] = input.uniqueId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeactivatePipelineInput = ( input: DeactivatePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cancelActive !== undefined) { - bodyParams["cancelActive"] = input.cancelActive; - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - return bodyParams; + return { + ...(input.cancelActive !== undefined && { + cancelActive: input.cancelActive + }), + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }) + }; }; const serializeAws_json1_1DeletePipelineInput = ( input: DeletePipelineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - return bodyParams; + return { + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }) + }; }; const serializeAws_json1_1DescribeObjectsInput = ( input: DescribeObjectsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.evaluateExpressions !== undefined) { - bodyParams["evaluateExpressions"] = input.evaluateExpressions; - } - if (input.marker !== undefined) { - bodyParams["marker"] = input.marker; - } - if (input.objectIds !== undefined) { - bodyParams["objectIds"] = serializeAws_json1_1idList( - input.objectIds, - context - ); - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribePipelinesInput = ( input: DescribePipelinesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineIds !== undefined) { - bodyParams["pipelineIds"] = serializeAws_json1_1idList( - input.pipelineIds, - context - ); - } - return bodyParams; + return { + ...(input.pipelineIds !== undefined && { + pipelineIds: serializeAws_json1_1idList(input.pipelineIds, context) + }) + }; }; const serializeAws_json1_1EvaluateExpressionInput = ( input: EvaluateExpressionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expression !== undefined) { - bodyParams["expression"] = input.expression; - } - if (input.objectId !== undefined) { - bodyParams["objectId"] = input.objectId; - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - return bodyParams; + return { + ...(input.expression !== undefined && { expression: input.expression }), + ...(input.objectId !== undefined && { objectId: input.objectId }), + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }) + }; }; const serializeAws_json1_1Field = ( input: Field, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.refValue !== undefined) { - bodyParams["refValue"] = input.refValue; - } - if (input.stringValue !== undefined) { - bodyParams["stringValue"] = input.stringValue; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.refValue !== undefined && { refValue: input.refValue }), + ...(input.stringValue !== undefined && { stringValue: input.stringValue }) + }; }; const serializeAws_json1_1GetPipelineDefinitionInput = ( input: GetPipelineDefinitionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_json1_1InstanceIdentity = ( input: InstanceIdentity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.document !== undefined) { - bodyParams["document"] = input.document; - } - if (input.signature !== undefined) { - bodyParams["signature"] = input.signature; - } - return bodyParams; + return { + ...(input.document !== undefined && { document: input.document }), + ...(input.signature !== undefined && { signature: input.signature }) + }; }; const serializeAws_json1_1ListPipelinesInput = ( input: ListPipelinesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.marker !== undefined) { - bodyParams["marker"] = input.marker; - } - return bodyParams; + return { + ...(input.marker !== undefined && { marker: input.marker }) + }; }; const serializeAws_json1_1Operator = ( input: Operator, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1stringList( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.type !== undefined && { type: input.type }), + ...(input.values !== undefined && { + values: serializeAws_json1_1stringList(input.values, context) + }) + }; }; const serializeAws_json1_1ParameterAttribute = ( input: ParameterAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.stringValue !== undefined) { - bodyParams["stringValue"] = input.stringValue; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.stringValue !== undefined && { stringValue: input.stringValue }) + }; }; const serializeAws_json1_1ParameterAttributeList = ( @@ -2472,17 +2415,15 @@ const serializeAws_json1_1ParameterObject = ( input: ParameterObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_json1_1ParameterAttributeList( - input.attributes, - context - ); - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_json1_1ParameterAttributeList( + input.attributes, + context + ) + }), + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1ParameterObjectList = ( @@ -2498,14 +2439,10 @@ const serializeAws_json1_1ParameterValue = ( input: ParameterValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.stringValue !== undefined) { - bodyParams["stringValue"] = input.stringValue; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.stringValue !== undefined && { stringValue: input.stringValue }) + }; }; const serializeAws_json1_1ParameterValueList = ( @@ -2519,17 +2456,13 @@ const serializeAws_json1_1PipelineObject = ( input: PipelineObject, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fields !== undefined) { - bodyParams["fields"] = serializeAws_json1_1fieldList(input.fields, context); - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.fields !== undefined && { + fields: serializeAws_json1_1fieldList(input.fields, context) + }), + ...(input.id !== undefined && { id: input.id }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1PipelineObjectList = ( @@ -2543,151 +2476,118 @@ const serializeAws_json1_1PollForTaskInput = ( input: PollForTaskInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hostname !== undefined) { - bodyParams["hostname"] = input.hostname; - } - if (input.instanceIdentity !== undefined) { - bodyParams["instanceIdentity"] = serializeAws_json1_1InstanceIdentity( - input.instanceIdentity, - context - ); - } - if (input.workerGroup !== undefined) { - bodyParams["workerGroup"] = input.workerGroup; - } - return bodyParams; + return { + ...(input.hostname !== undefined && { hostname: input.hostname }), + ...(input.instanceIdentity !== undefined && { + instanceIdentity: serializeAws_json1_1InstanceIdentity( + input.instanceIdentity, + context + ) + }), + ...(input.workerGroup !== undefined && { workerGroup: input.workerGroup }) + }; }; const serializeAws_json1_1PutPipelineDefinitionInput = ( input: PutPipelineDefinitionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.parameterObjects !== undefined) { - bodyParams["parameterObjects"] = serializeAws_json1_1ParameterObjectList( - input.parameterObjects, - context - ); - } - if (input.parameterValues !== undefined) { - bodyParams["parameterValues"] = serializeAws_json1_1ParameterValueList( - input.parameterValues, - context - ); - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.pipelineObjects !== undefined) { - bodyParams["pipelineObjects"] = serializeAws_json1_1PipelineObjectList( - input.pipelineObjects, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1Query = ( input: Query, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.selectors !== undefined) { - bodyParams["selectors"] = serializeAws_json1_1SelectorList( - input.selectors, - context - ); - } - return bodyParams; + return { + ...(input.selectors !== undefined && { + selectors: serializeAws_json1_1SelectorList(input.selectors, context) + }) + }; }; const serializeAws_json1_1QueryObjectsInput = ( input: QueryObjectsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.limit !== undefined) { - bodyParams["limit"] = input.limit; - } - if (input.marker !== undefined) { - bodyParams["marker"] = input.marker; - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.query !== undefined) { - bodyParams["query"] = serializeAws_json1_1Query(input.query, context); - } - if (input.sphere !== undefined) { - bodyParams["sphere"] = input.sphere; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RemoveTagsInput = ( input: RemoveTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1stringList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1stringList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1ReportTaskProgressInput = ( input: ReportTaskProgressInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fields !== undefined) { - bodyParams["fields"] = serializeAws_json1_1fieldList(input.fields, context); - } - if (input.taskId !== undefined) { - bodyParams["taskId"] = input.taskId; - } - return bodyParams; + return { + ...(input.fields !== undefined && { + fields: serializeAws_json1_1fieldList(input.fields, context) + }), + ...(input.taskId !== undefined && { taskId: input.taskId }) + }; }; const serializeAws_json1_1ReportTaskRunnerHeartbeatInput = ( input: ReportTaskRunnerHeartbeatInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hostname !== undefined) { - bodyParams["hostname"] = input.hostname; - } - if (input.taskrunnerId !== undefined) { - bodyParams["taskrunnerId"] = input.taskrunnerId; - } - if (input.workerGroup !== undefined) { - bodyParams["workerGroup"] = input.workerGroup; - } - return bodyParams; + return { + ...(input.hostname !== undefined && { hostname: input.hostname }), + ...(input.taskrunnerId !== undefined && { + taskrunnerId: input.taskrunnerId + }), + ...(input.workerGroup !== undefined && { workerGroup: input.workerGroup }) + }; }; const serializeAws_json1_1Selector = ( input: Selector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fieldName !== undefined) { - bodyParams["fieldName"] = input.fieldName; - } - if (input.operator !== undefined) { - bodyParams["operator"] = serializeAws_json1_1Operator( - input.operator, - context - ); - } - return bodyParams; + return { + ...(input.fieldName !== undefined && { fieldName: input.fieldName }), + ...(input.operator !== undefined && { + operator: serializeAws_json1_1Operator(input.operator, context) + }) + }; }; const serializeAws_json1_1SelectorList = ( @@ -2701,83 +2601,64 @@ const serializeAws_json1_1SetStatusInput = ( input: SetStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.objectIds !== undefined) { - bodyParams["objectIds"] = serializeAws_json1_1idList( - input.objectIds, - context - ); - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.objectIds !== undefined && { + objectIds: serializeAws_json1_1idList(input.objectIds, context) + }), + ...(input.pipelineId !== undefined && { pipelineId: input.pipelineId }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1SetTaskStatusInput = ( input: SetTaskStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.errorId !== undefined) { - bodyParams["errorId"] = input.errorId; - } - if (input.errorMessage !== undefined) { - bodyParams["errorMessage"] = input.errorMessage; - } - if (input.errorStackTrace !== undefined) { - bodyParams["errorStackTrace"] = input.errorStackTrace; - } - if (input.taskId !== undefined) { - bodyParams["taskId"] = input.taskId; - } - if (input.taskStatus !== undefined) { - bodyParams["taskStatus"] = input.taskStatus; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1ValidatePipelineDefinitionInput = ( input: ValidatePipelineDefinitionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.parameterObjects !== undefined) { - bodyParams["parameterObjects"] = serializeAws_json1_1ParameterObjectList( - input.parameterObjects, - context - ); - } - if (input.parameterValues !== undefined) { - bodyParams["parameterValues"] = serializeAws_json1_1ParameterValueList( - input.parameterValues, - context - ); - } - if (input.pipelineId !== undefined) { - bodyParams["pipelineId"] = input.pipelineId; - } - if (input.pipelineObjects !== undefined) { - bodyParams["pipelineObjects"] = serializeAws_json1_1PipelineObjectList( - input.pipelineObjects, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1fieldList = ( 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 6abcea1912e7..560d75d894a2 100644 --- a/clients/client-database-migration-service/protocols/Aws_json1_1.ts +++ b/clients/client-database-migration-service/protocols/Aws_json1_1.ts @@ -5301,768 +5301,606 @@ const serializeAws_json1_1AddTagsToResourceMessage = ( input: AddTagsToResourceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1ApplyPendingMaintenanceActionMessage = ( input: ApplyPendingMaintenanceActionMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplyAction !== undefined) { - bodyParams["ApplyAction"] = input.ApplyAction; - } - if (input.OptInType !== undefined) { - bodyParams["OptInType"] = input.OptInType; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.ApplyAction !== undefined && { ApplyAction: input.ApplyAction }), + ...(input.OptInType !== undefined && { OptInType: input.OptInType }), + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1CreateEndpointMessage = ( input: CreateEndpointMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.DmsTransferSettings !== undefined) { - bodyParams["DmsTransferSettings"] = serializeAws_json1_1DmsTransferSettings( - input.DmsTransferSettings, - context - ); - } - if (input.DynamoDbSettings !== undefined) { - bodyParams["DynamoDbSettings"] = serializeAws_json1_1DynamoDbSettings( - input.DynamoDbSettings, - context - ); - } - if (input.ElasticsearchSettings !== undefined) { - bodyParams[ - "ElasticsearchSettings" - ] = serializeAws_json1_1ElasticsearchSettings( - input.ElasticsearchSettings, - context - ); - } - if (input.EndpointIdentifier !== undefined) { - bodyParams["EndpointIdentifier"] = input.EndpointIdentifier; - } - if (input.EndpointType !== undefined) { - bodyParams["EndpointType"] = input.EndpointType; - } - if (input.EngineName !== undefined) { - bodyParams["EngineName"] = input.EngineName; - } - if (input.ExternalTableDefinition !== undefined) { - bodyParams["ExternalTableDefinition"] = input.ExternalTableDefinition; - } - if (input.ExtraConnectionAttributes !== undefined) { - bodyParams["ExtraConnectionAttributes"] = input.ExtraConnectionAttributes; - } - if (input.KinesisSettings !== undefined) { - bodyParams["KinesisSettings"] = serializeAws_json1_1KinesisSettings( - input.KinesisSettings, - context - ); - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.MongoDbSettings !== undefined) { - bodyParams["MongoDbSettings"] = serializeAws_json1_1MongoDbSettings( - input.MongoDbSettings, - context - ); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - if (input.RedshiftSettings !== undefined) { - bodyParams["RedshiftSettings"] = serializeAws_json1_1RedshiftSettings( - input.RedshiftSettings, - context - ); - } - if (input.S3Settings !== undefined) { - bodyParams["S3Settings"] = serializeAws_json1_1S3Settings( - input.S3Settings, - context - ); - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - if (input.SslMode !== undefined) { - bodyParams["SslMode"] = input.SslMode; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.DmsTransferSettings !== undefined && { + DmsTransferSettings: serializeAws_json1_1DmsTransferSettings( + input.DmsTransferSettings, + 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.KinesisSettings !== undefined && { + KinesisSettings: serializeAws_json1_1KinesisSettings( + input.KinesisSettings, + context + ) + }), + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.MongoDbSettings !== undefined && { + MongoDbSettings: serializeAws_json1_1MongoDbSettings( + input.MongoDbSettings, + context + ) + }), + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.Port !== undefined && { Port: input.Port }), + ...(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.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1CreateEventSubscriptionMessage = ( input: CreateEventSubscriptionMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.EventCategories !== undefined) { - bodyParams["EventCategories"] = serializeAws_json1_1EventCategoriesList( - input.EventCategories, - context - ); - } - if (input.SnsTopicArn !== undefined) { - bodyParams["SnsTopicArn"] = input.SnsTopicArn; - } - if (input.SourceIds !== undefined) { - bodyParams["SourceIds"] = serializeAws_json1_1SourceIdsList( - input.SourceIds, - context - ); - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - if (input.SubscriptionName !== undefined) { - bodyParams["SubscriptionName"] = input.SubscriptionName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateReplicationInstanceMessage = ( input: CreateReplicationInstanceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllocatedStorage !== undefined) { - bodyParams["AllocatedStorage"] = input.AllocatedStorage; - } - if (input.AutoMinorVersionUpgrade !== undefined) { - bodyParams["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; - } - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.DnsNameServers !== undefined) { - bodyParams["DnsNameServers"] = input.DnsNameServers; - } - if (input.EngineVersion !== undefined) { - bodyParams["EngineVersion"] = input.EngineVersion; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.MultiAZ !== undefined) { - bodyParams["MultiAZ"] = input.MultiAZ; - } - if (input.PreferredMaintenanceWindow !== undefined) { - bodyParams["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; - } - if (input.PubliclyAccessible !== undefined) { - bodyParams["PubliclyAccessible"] = input.PubliclyAccessible; - } - if (input.ReplicationInstanceClass !== undefined) { - bodyParams["ReplicationInstanceClass"] = input.ReplicationInstanceClass; - } - if (input.ReplicationInstanceIdentifier !== undefined) { - bodyParams["ReplicationInstanceIdentifier"] = - input.ReplicationInstanceIdentifier; - } - if (input.ReplicationSubnetGroupIdentifier !== undefined) { - bodyParams["ReplicationSubnetGroupIdentifier"] = - input.ReplicationSubnetGroupIdentifier; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VpcSecurityGroupIds !== undefined) { - bodyParams[ - "VpcSecurityGroupIds" - ] = serializeAws_json1_1VpcSecurityGroupIdList( - input.VpcSecurityGroupIds, - context - ); - } - return bodyParams; + 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.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }), + ...(input.VpcSecurityGroupIds !== undefined && { + VpcSecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIdList( + input.VpcSecurityGroupIds, + context + ) + }) + }; }; const serializeAws_json1_1CreateReplicationSubnetGroupMessage = ( input: CreateReplicationSubnetGroupMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationSubnetGroupDescription !== undefined) { - bodyParams["ReplicationSubnetGroupDescription"] = - input.ReplicationSubnetGroupDescription; - } - if (input.ReplicationSubnetGroupIdentifier !== undefined) { - bodyParams["ReplicationSubnetGroupIdentifier"] = - input.ReplicationSubnetGroupIdentifier; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIdentifierList( - input.SubnetIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateReplicationTaskMessage = ( input: CreateReplicationTaskMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CdcStartPosition !== undefined) { - bodyParams["CdcStartPosition"] = input.CdcStartPosition; - } - if (input.CdcStartTime !== undefined) { - bodyParams["CdcStartTime"] = Math.round( - input.CdcStartTime.getTime() / 1000 - ); - } - if (input.CdcStopPosition !== undefined) { - bodyParams["CdcStopPosition"] = input.CdcStopPosition; - } - if (input.MigrationType !== undefined) { - bodyParams["MigrationType"] = input.MigrationType; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - if (input.ReplicationTaskIdentifier !== undefined) { - bodyParams["ReplicationTaskIdentifier"] = input.ReplicationTaskIdentifier; - } - if (input.ReplicationTaskSettings !== undefined) { - bodyParams["ReplicationTaskSettings"] = input.ReplicationTaskSettings; - } - if (input.SourceEndpointArn !== undefined) { - bodyParams["SourceEndpointArn"] = input.SourceEndpointArn; - } - if (input.TableMappings !== undefined) { - bodyParams["TableMappings"] = input.TableMappings; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TargetEndpointArn !== undefined) { - bodyParams["TargetEndpointArn"] = input.TargetEndpointArn; - } - return bodyParams; + 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.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 + }) + }; }; const serializeAws_json1_1DeleteCertificateMessage = ( input: DeleteCertificateMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }) + }; }; const serializeAws_json1_1DeleteConnectionMessage = ( input: DeleteConnectionMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1DeleteEndpointMessage = ( input: DeleteEndpointMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }) + }; }; const serializeAws_json1_1DeleteEventSubscriptionMessage = ( input: DeleteEventSubscriptionMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SubscriptionName !== undefined) { - bodyParams["SubscriptionName"] = input.SubscriptionName; - } - return bodyParams; + return { + ...(input.SubscriptionName !== undefined && { + SubscriptionName: input.SubscriptionName + }) + }; }; const serializeAws_json1_1DeleteReplicationInstanceMessage = ( input: DeleteReplicationInstanceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1DeleteReplicationSubnetGroupMessage = ( input: DeleteReplicationSubnetGroupMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationSubnetGroupIdentifier !== undefined) { - bodyParams["ReplicationSubnetGroupIdentifier"] = - input.ReplicationSubnetGroupIdentifier; - } - return bodyParams; + return { + ...(input.ReplicationSubnetGroupIdentifier !== undefined && { + ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier + }) + }; }; const serializeAws_json1_1DeleteReplicationTaskMessage = ( input: DeleteReplicationTaskMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - return bodyParams; + return { + ...(input.ReplicationTaskArn !== undefined && { + ReplicationTaskArn: input.ReplicationTaskArn + }) + }; }; const serializeAws_json1_1DescribeAccountAttributesMessage = ( input: DescribeAccountAttributesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeCertificatesMessage = ( input: DescribeCertificatesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeConnectionsMessage = ( input: DescribeConnectionsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeEndpointTypesMessage = ( input: DescribeEndpointTypesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeEndpointsMessage = ( input: DescribeEndpointsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeEventCategoriesMessage = ( input: DescribeEventCategoriesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.SourceType !== undefined && { SourceType: input.SourceType }) + }; }; const serializeAws_json1_1DescribeEventSubscriptionsMessage = ( input: DescribeEventSubscriptionsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.SubscriptionName !== undefined) { - bodyParams["SubscriptionName"] = input.SubscriptionName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeEventsMessage = ( input: DescribeEventsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.EventCategories !== undefined) { - bodyParams["EventCategories"] = serializeAws_json1_1EventCategoriesList( - input.EventCategories, - context - ); - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.SourceIdentifier !== undefined) { - bodyParams["SourceIdentifier"] = input.SourceIdentifier; - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeOrderableReplicationInstancesMessage = ( input: DescribeOrderableReplicationInstancesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribePendingMaintenanceActionsMessage = ( input: DescribePendingMaintenanceActionsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeRefreshSchemasStatusMessage = ( input: DescribeRefreshSchemasStatusMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }) + }; }; const serializeAws_json1_1DescribeReplicationInstanceTaskLogsMessage = ( input: DescribeReplicationInstanceTaskLogsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1DescribeReplicationInstancesMessage = ( input: DescribeReplicationInstancesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeReplicationSubnetGroupsMessage = ( input: DescribeReplicationSubnetGroupsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeReplicationTaskAssessmentResultsMessage = ( input: DescribeReplicationTaskAssessmentResultsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - return bodyParams; + return { + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }), + ...(input.ReplicationTaskArn !== undefined && { + ReplicationTaskArn: input.ReplicationTaskArn + }) + }; }; const serializeAws_json1_1DescribeReplicationTasksMessage = ( input: DescribeReplicationTasksMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.WithoutSettings !== undefined) { - bodyParams["WithoutSettings"] = input.WithoutSettings; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeSchemasMessage = ( input: DescribeSchemasMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxRecords !== undefined && { MaxRecords: input.MaxRecords }) + }; }; const serializeAws_json1_1DescribeTableStatisticsMessage = ( input: DescribeTableStatisticsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxRecords !== undefined) { - bodyParams["MaxRecords"] = input.MaxRecords; - } - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DmsTransferSettings = ( input: DmsTransferSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketName !== undefined) { - bodyParams["BucketName"] = input.BucketName; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - return bodyParams; + return { + ...(input.BucketName !== undefined && { BucketName: input.BucketName }), + ...(input.ServiceAccessRoleArn !== undefined && { + ServiceAccessRoleArn: input.ServiceAccessRoleArn + }) + }; }; const serializeAws_json1_1DynamoDbSettings = ( input: DynamoDbSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - return bodyParams; + return { + ...(input.ServiceAccessRoleArn !== undefined && { + ServiceAccessRoleArn: input.ServiceAccessRoleArn + }) + }; }; const serializeAws_json1_1ElasticsearchSettings = ( input: ElasticsearchSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointUri !== undefined) { - bodyParams["EndpointUri"] = input.EndpointUri; - } - if (input.ErrorRetryDuration !== undefined) { - bodyParams["ErrorRetryDuration"] = input.ErrorRetryDuration; - } - if (input.FullLoadErrorPercentage !== undefined) { - bodyParams["FullLoadErrorPercentage"] = input.FullLoadErrorPercentage; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EventCategoriesList = ( @@ -6076,17 +5914,12 @@ const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValueList(input.Values, context) + }) + }; }; const serializeAws_json1_1FilterList = ( @@ -6107,22 +5940,20 @@ const serializeAws_json1_1ImportCertificateMessage = ( input: ImportCertificateMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateIdentifier !== undefined) { - bodyParams["CertificateIdentifier"] = input.CertificateIdentifier; - } - if (input.CertificatePem !== undefined) { - bodyParams["CertificatePem"] = input.CertificatePem; - } - if (input.CertificateWallet !== undefined) { - bodyParams["CertificateWallet"] = context.base64Encoder( - input.CertificateWallet - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1KeyList = ( @@ -6136,511 +5967,426 @@ const serializeAws_json1_1KinesisSettings = ( input: KinesisSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageFormat !== undefined) { - bodyParams["MessageFormat"] = input.MessageFormat; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - if (input.StreamArn !== undefined) { - bodyParams["StreamArn"] = input.StreamArn; - } - return bodyParams; + return { + ...(input.MessageFormat !== undefined && { + MessageFormat: input.MessageFormat + }), + ...(input.ServiceAccessRoleArn !== undefined && { + ServiceAccessRoleArn: input.ServiceAccessRoleArn + }), + ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }) + }; }; const serializeAws_json1_1ListTagsForResourceMessage = ( input: ListTagsForResourceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ModifyEndpointMessage = ( input: ModifyEndpointMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.DmsTransferSettings !== undefined) { - bodyParams["DmsTransferSettings"] = serializeAws_json1_1DmsTransferSettings( - input.DmsTransferSettings, - context - ); - } - if (input.DynamoDbSettings !== undefined) { - bodyParams["DynamoDbSettings"] = serializeAws_json1_1DynamoDbSettings( - input.DynamoDbSettings, - context - ); - } - if (input.ElasticsearchSettings !== undefined) { - bodyParams[ - "ElasticsearchSettings" - ] = serializeAws_json1_1ElasticsearchSettings( - input.ElasticsearchSettings, - context - ); - } - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - if (input.EndpointIdentifier !== undefined) { - bodyParams["EndpointIdentifier"] = input.EndpointIdentifier; - } - if (input.EndpointType !== undefined) { - bodyParams["EndpointType"] = input.EndpointType; - } - if (input.EngineName !== undefined) { - bodyParams["EngineName"] = input.EngineName; - } - if (input.ExternalTableDefinition !== undefined) { - bodyParams["ExternalTableDefinition"] = input.ExternalTableDefinition; - } - if (input.ExtraConnectionAttributes !== undefined) { - bodyParams["ExtraConnectionAttributes"] = input.ExtraConnectionAttributes; - } - if (input.KinesisSettings !== undefined) { - bodyParams["KinesisSettings"] = serializeAws_json1_1KinesisSettings( - input.KinesisSettings, - context - ); - } - if (input.MongoDbSettings !== undefined) { - bodyParams["MongoDbSettings"] = serializeAws_json1_1MongoDbSettings( - input.MongoDbSettings, - context - ); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - if (input.RedshiftSettings !== undefined) { - bodyParams["RedshiftSettings"] = serializeAws_json1_1RedshiftSettings( - input.RedshiftSettings, - context - ); - } - if (input.S3Settings !== undefined) { - bodyParams["S3Settings"] = serializeAws_json1_1S3Settings( - input.S3Settings, - context - ); - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - if (input.SslMode !== undefined) { - bodyParams["SslMode"] = input.SslMode; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + CertificateArn: input.CertificateArn + }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.DmsTransferSettings !== undefined && { + DmsTransferSettings: serializeAws_json1_1DmsTransferSettings( + input.DmsTransferSettings, + 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.KinesisSettings !== undefined && { + KinesisSettings: serializeAws_json1_1KinesisSettings( + input.KinesisSettings, + context + ) + }), + ...(input.MongoDbSettings !== undefined && { + MongoDbSettings: serializeAws_json1_1MongoDbSettings( + input.MongoDbSettings, + context + ) + }), + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.Port !== undefined && { Port: input.Port }), + ...(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.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1ModifyEventSubscriptionMessage = ( input: ModifyEventSubscriptionMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.EventCategories !== undefined) { - bodyParams["EventCategories"] = serializeAws_json1_1EventCategoriesList( - input.EventCategories, - context - ); - } - if (input.SnsTopicArn !== undefined) { - bodyParams["SnsTopicArn"] = input.SnsTopicArn; - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - if (input.SubscriptionName !== undefined) { - bodyParams["SubscriptionName"] = input.SubscriptionName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ModifyReplicationInstanceMessage = ( input: ModifyReplicationInstanceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllocatedStorage !== undefined) { - bodyParams["AllocatedStorage"] = input.AllocatedStorage; - } - if (input.AllowMajorVersionUpgrade !== undefined) { - bodyParams["AllowMajorVersionUpgrade"] = input.AllowMajorVersionUpgrade; - } - if (input.ApplyImmediately !== undefined) { - bodyParams["ApplyImmediately"] = input.ApplyImmediately; - } - if (input.AutoMinorVersionUpgrade !== undefined) { - bodyParams["AutoMinorVersionUpgrade"] = input.AutoMinorVersionUpgrade; - } - if (input.EngineVersion !== undefined) { - bodyParams["EngineVersion"] = input.EngineVersion; - } - if (input.MultiAZ !== undefined) { - bodyParams["MultiAZ"] = input.MultiAZ; - } - if (input.PreferredMaintenanceWindow !== undefined) { - bodyParams["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - if (input.ReplicationInstanceClass !== undefined) { - bodyParams["ReplicationInstanceClass"] = input.ReplicationInstanceClass; - } - if (input.ReplicationInstanceIdentifier !== undefined) { - bodyParams["ReplicationInstanceIdentifier"] = - input.ReplicationInstanceIdentifier; - } - if (input.VpcSecurityGroupIds !== undefined) { - bodyParams[ - "VpcSecurityGroupIds" - ] = serializeAws_json1_1VpcSecurityGroupIdList( - input.VpcSecurityGroupIds, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ModifyReplicationSubnetGroupMessage = ( input: ModifyReplicationSubnetGroupMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationSubnetGroupDescription !== undefined) { - bodyParams["ReplicationSubnetGroupDescription"] = - input.ReplicationSubnetGroupDescription; - } - if (input.ReplicationSubnetGroupIdentifier !== undefined) { - bodyParams["ReplicationSubnetGroupIdentifier"] = - input.ReplicationSubnetGroupIdentifier; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIdentifierList( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.ReplicationSubnetGroupDescription !== undefined && { + ReplicationSubnetGroupDescription: input.ReplicationSubnetGroupDescription + }), + ...(input.ReplicationSubnetGroupIdentifier !== undefined && { + ReplicationSubnetGroupIdentifier: input.ReplicationSubnetGroupIdentifier + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIdentifierList( + input.SubnetIds, + context + ) + }) + }; }; const serializeAws_json1_1ModifyReplicationTaskMessage = ( input: ModifyReplicationTaskMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CdcStartPosition !== undefined) { - bodyParams["CdcStartPosition"] = input.CdcStartPosition; - } - if (input.CdcStartTime !== undefined) { - bodyParams["CdcStartTime"] = Math.round( - input.CdcStartTime.getTime() / 1000 - ); - } - if (input.CdcStopPosition !== undefined) { - bodyParams["CdcStopPosition"] = input.CdcStopPosition; - } - if (input.MigrationType !== undefined) { - bodyParams["MigrationType"] = input.MigrationType; - } - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - if (input.ReplicationTaskIdentifier !== undefined) { - bodyParams["ReplicationTaskIdentifier"] = input.ReplicationTaskIdentifier; - } - if (input.ReplicationTaskSettings !== undefined) { - bodyParams["ReplicationTaskSettings"] = input.ReplicationTaskSettings; - } - if (input.TableMappings !== undefined) { - bodyParams["TableMappings"] = input.TableMappings; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MongoDbSettings = ( input: MongoDbSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthMechanism !== undefined) { - bodyParams["AuthMechanism"] = input.AuthMechanism; - } - if (input.AuthSource !== undefined) { - bodyParams["AuthSource"] = input.AuthSource; - } - if (input.AuthType !== undefined) { - bodyParams["AuthType"] = input.AuthType; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.DocsToInvestigate !== undefined) { - bodyParams["DocsToInvestigate"] = input.DocsToInvestigate; - } - if (input.ExtractDocId !== undefined) { - bodyParams["ExtractDocId"] = input.ExtractDocId; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.NestingLevel !== undefined) { - bodyParams["NestingLevel"] = input.NestingLevel; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RebootReplicationInstanceMessage = ( input: RebootReplicationInstanceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForceFailover !== undefined) { - bodyParams["ForceFailover"] = input.ForceFailover; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.ForceFailover !== undefined && { + ForceFailover: input.ForceFailover + }), + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1RedshiftSettings = ( input: RedshiftSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptAnyDate !== undefined) { - bodyParams["AcceptAnyDate"] = input.AcceptAnyDate; - } - if (input.AfterConnectScript !== undefined) { - bodyParams["AfterConnectScript"] = input.AfterConnectScript; - } - if (input.BucketFolder !== undefined) { - bodyParams["BucketFolder"] = input.BucketFolder; - } - if (input.BucketName !== undefined) { - bodyParams["BucketName"] = input.BucketName; - } - if (input.ConnectionTimeout !== undefined) { - bodyParams["ConnectionTimeout"] = input.ConnectionTimeout; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.DateFormat !== undefined) { - bodyParams["DateFormat"] = input.DateFormat; - } - if (input.EmptyAsNull !== undefined) { - bodyParams["EmptyAsNull"] = input.EmptyAsNull; - } - if (input.EncryptionMode !== undefined) { - bodyParams["EncryptionMode"] = input.EncryptionMode; - } - if (input.FileTransferUploadStreams !== undefined) { - bodyParams["FileTransferUploadStreams"] = input.FileTransferUploadStreams; - } - if (input.LoadTimeout !== undefined) { - bodyParams["LoadTimeout"] = input.LoadTimeout; - } - if (input.MaxFileSize !== undefined) { - bodyParams["MaxFileSize"] = input.MaxFileSize; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - if (input.RemoveQuotes !== undefined) { - bodyParams["RemoveQuotes"] = input.RemoveQuotes; - } - if (input.ReplaceChars !== undefined) { - bodyParams["ReplaceChars"] = input.ReplaceChars; - } - if (input.ReplaceInvalidChars !== undefined) { - bodyParams["ReplaceInvalidChars"] = input.ReplaceInvalidChars; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.ServerSideEncryptionKmsKeyId !== undefined) { - bodyParams["ServerSideEncryptionKmsKeyId"] = - input.ServerSideEncryptionKmsKeyId; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - if (input.TimeFormat !== undefined) { - bodyParams["TimeFormat"] = input.TimeFormat; - } - if (input.TrimBlanks !== undefined) { - bodyParams["TrimBlanks"] = input.TrimBlanks; - } - if (input.TruncateColumns !== undefined) { - bodyParams["TruncateColumns"] = input.TruncateColumns; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - if (input.WriteBufferSize !== undefined) { - bodyParams["WriteBufferSize"] = input.WriteBufferSize; - } - return bodyParams; + 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.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.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 + }) + }; }; const serializeAws_json1_1RefreshSchemasMessage = ( input: RefreshSchemasMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1ReloadTablesMessage = ( input: ReloadTablesMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReloadOption !== undefined) { - bodyParams["ReloadOption"] = input.ReloadOption; - } - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - if (input.TablesToReload !== undefined) { - bodyParams["TablesToReload"] = serializeAws_json1_1TableListToReload( - input.TablesToReload, - context - ); - } - return bodyParams; + return { + ...(input.ReloadOption !== undefined && { + ReloadOption: input.ReloadOption + }), + ...(input.ReplicationTaskArn !== undefined && { + ReplicationTaskArn: input.ReplicationTaskArn + }), + ...(input.TablesToReload !== undefined && { + TablesToReload: serializeAws_json1_1TableListToReload( + input.TablesToReload, + context + ) + }) + }; }; const serializeAws_json1_1RemoveTagsFromResourceMessage = ( input: RemoveTagsFromResourceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1KeyList(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1S3Settings = ( input: S3Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketFolder !== undefined) { - bodyParams["BucketFolder"] = input.BucketFolder; - } - if (input.BucketName !== undefined) { - bodyParams["BucketName"] = input.BucketName; - } - if (input.CdcInsertsOnly !== undefined) { - bodyParams["CdcInsertsOnly"] = input.CdcInsertsOnly; - } - if (input.CompressionType !== undefined) { - bodyParams["CompressionType"] = input.CompressionType; - } - if (input.CsvDelimiter !== undefined) { - bodyParams["CsvDelimiter"] = input.CsvDelimiter; - } - if (input.CsvRowDelimiter !== undefined) { - bodyParams["CsvRowDelimiter"] = input.CsvRowDelimiter; - } - if (input.DataFormat !== undefined) { - bodyParams["DataFormat"] = input.DataFormat; - } - if (input.DataPageSize !== undefined) { - bodyParams["DataPageSize"] = input.DataPageSize; - } - if (input.DictPageSizeLimit !== undefined) { - bodyParams["DictPageSizeLimit"] = input.DictPageSizeLimit; - } - if (input.EnableStatistics !== undefined) { - bodyParams["EnableStatistics"] = input.EnableStatistics; - } - if (input.EncodingType !== undefined) { - bodyParams["EncodingType"] = input.EncodingType; - } - if (input.EncryptionMode !== undefined) { - bodyParams["EncryptionMode"] = input.EncryptionMode; - } - if (input.ExternalTableDefinition !== undefined) { - bodyParams["ExternalTableDefinition"] = input.ExternalTableDefinition; - } - if (input.IncludeOpForFullLoad !== undefined) { - bodyParams["IncludeOpForFullLoad"] = input.IncludeOpForFullLoad; - } - if (input.ParquetTimestampInMillisecond !== undefined) { - bodyParams["ParquetTimestampInMillisecond"] = - input.ParquetTimestampInMillisecond; - } - if (input.ParquetVersion !== undefined) { - bodyParams["ParquetVersion"] = input.ParquetVersion; - } - if (input.RowGroupLength !== undefined) { - bodyParams["RowGroupLength"] = input.RowGroupLength; - } - if (input.ServerSideEncryptionKmsKeyId !== undefined) { - bodyParams["ServerSideEncryptionKmsKeyId"] = - input.ServerSideEncryptionKmsKeyId; - } - if (input.ServiceAccessRoleArn !== undefined) { - bodyParams["ServiceAccessRoleArn"] = input.ServiceAccessRoleArn; - } - if (input.TimestampColumnName !== undefined) { - bodyParams["TimestampColumnName"] = input.TimestampColumnName; - } - return bodyParams; + return { + ...(input.BucketFolder !== undefined && { + BucketFolder: input.BucketFolder + }), + ...(input.BucketName !== undefined && { BucketName: input.BucketName }), + ...(input.CdcInsertsOnly !== undefined && { + CdcInsertsOnly: input.CdcInsertsOnly + }), + ...(input.CompressionType !== undefined && { + CompressionType: input.CompressionType + }), + ...(input.CsvDelimiter !== undefined && { + CsvDelimiter: input.CsvDelimiter + }), + ...(input.CsvRowDelimiter !== undefined && { + CsvRowDelimiter: input.CsvRowDelimiter + }), + ...(input.DataFormat !== undefined && { DataFormat: input.DataFormat }), + ...(input.DataPageSize !== undefined && { + DataPageSize: input.DataPageSize + }), + ...(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.RowGroupLength !== undefined && { + RowGroupLength: input.RowGroupLength + }), + ...(input.ServerSideEncryptionKmsKeyId !== undefined && { + ServerSideEncryptionKmsKeyId: input.ServerSideEncryptionKmsKeyId + }), + ...(input.ServiceAccessRoleArn !== undefined && { + ServiceAccessRoleArn: input.ServiceAccessRoleArn + }), + ...(input.TimestampColumnName !== undefined && { + TimestampColumnName: input.TimestampColumnName + }) + }; }; const serializeAws_json1_1SourceIdsList = ( @@ -6654,47 +6400,45 @@ const serializeAws_json1_1StartReplicationTaskAssessmentMessage = ( input: StartReplicationTaskAssessmentMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - return bodyParams; + return { + ...(input.ReplicationTaskArn !== undefined && { + ReplicationTaskArn: input.ReplicationTaskArn + }) + }; }; const serializeAws_json1_1StartReplicationTaskMessage = ( input: StartReplicationTaskMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CdcStartPosition !== undefined) { - bodyParams["CdcStartPosition"] = input.CdcStartPosition; - } - if (input.CdcStartTime !== undefined) { - bodyParams["CdcStartTime"] = Math.round( - input.CdcStartTime.getTime() / 1000 - ); - } - if (input.CdcStopPosition !== undefined) { - bodyParams["CdcStopPosition"] = input.CdcStopPosition; - } - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - if (input.StartReplicationTaskType !== undefined) { - bodyParams["StartReplicationTaskType"] = input.StartReplicationTaskType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1StopReplicationTaskMessage = ( input: StopReplicationTaskMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReplicationTaskArn !== undefined) { - bodyParams["ReplicationTaskArn"] = input.ReplicationTaskArn; - } - return bodyParams; + return { + ...(input.ReplicationTaskArn !== undefined && { + ReplicationTaskArn: input.ReplicationTaskArn + }) + }; }; const serializeAws_json1_1SubnetIdentifierList = ( @@ -6715,25 +6459,17 @@ const serializeAws_json1_1TableToReload = ( input: TableToReload, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SchemaName !== undefined) { - bodyParams["SchemaName"] = input.SchemaName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.SchemaName !== undefined && { SchemaName: input.SchemaName }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagList = ( @@ -6747,14 +6483,12 @@ const serializeAws_json1_1TestConnectionMessage = ( input: TestConnectionMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointArn !== undefined) { - bodyParams["EndpointArn"] = input.EndpointArn; - } - if (input.ReplicationInstanceArn !== undefined) { - bodyParams["ReplicationInstanceArn"] = input.ReplicationInstanceArn; - } - return bodyParams; + return { + ...(input.EndpointArn !== undefined && { EndpointArn: input.EndpointArn }), + ...(input.ReplicationInstanceArn !== undefined && { + ReplicationInstanceArn: input.ReplicationInstanceArn + }) + }; }; const serializeAws_json1_1VpcSecurityGroupIdList = ( diff --git a/clients/client-dataexchange/protocols/Aws_restJson1_1.ts b/clients/client-dataexchange/protocols/Aws_restJson1_1.ts index 167abb247fb4..28ca236d8ef5 100644 --- a/clients/client-dataexchange/protocols/Aws_restJson1_1.ts +++ b/clients/client-dataexchange/protocols/Aws_restJson1_1.ts @@ -3645,110 +3645,76 @@ const serializeAws_restJson1_1AssetDestinationEntry = ( input: AssetDestinationEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssetId !== undefined) { - bodyParams["AssetId"] = input.AssetId; - } - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - return bodyParams; + return { + ...(input.AssetId !== undefined && { AssetId: input.AssetId }), + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Key !== undefined && { Key: input.Key }) + }; }; const serializeAws_restJson1_1AssetSourceEntry = ( input: AssetSourceEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Key !== undefined && { Key: input.Key }) + }; }; const serializeAws_restJson1_1ExportAssetToSignedUrlRequestDetails = ( input: ExportAssetToSignedUrlRequestDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssetId !== undefined) { - bodyParams["AssetId"] = input.AssetId; - } - if (input.DataSetId !== undefined) { - bodyParams["DataSetId"] = input.DataSetId; - } - if (input.RevisionId !== undefined) { - bodyParams["RevisionId"] = input.RevisionId; - } - return bodyParams; + return { + ...(input.AssetId !== undefined && { AssetId: input.AssetId }), + ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), + ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }) + }; }; const serializeAws_restJson1_1ExportAssetsToS3RequestDetails = ( input: ExportAssetsToS3RequestDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssetDestinations !== undefined) { - bodyParams[ - "AssetDestinations" - ] = serializeAws_restJson1_1ListOfAssetDestinationEntry( - input.AssetDestinations, - context - ); - } - if (input.DataSetId !== undefined) { - bodyParams["DataSetId"] = input.DataSetId; - } - if (input.RevisionId !== undefined) { - bodyParams["RevisionId"] = input.RevisionId; - } - return bodyParams; + return { + ...(input.AssetDestinations !== undefined && { + AssetDestinations: serializeAws_restJson1_1ListOfAssetDestinationEntry( + input.AssetDestinations, + context + ) + }), + ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), + ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }) + }; }; const serializeAws_restJson1_1ImportAssetFromSignedUrlRequestDetails = ( input: ImportAssetFromSignedUrlRequestDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssetName !== undefined) { - bodyParams["AssetName"] = input.AssetName; - } - if (input.DataSetId !== undefined) { - bodyParams["DataSetId"] = input.DataSetId; - } - if (input.Md5Hash !== undefined) { - bodyParams["Md5Hash"] = input.Md5Hash; - } - if (input.RevisionId !== undefined) { - bodyParams["RevisionId"] = input.RevisionId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1ImportAssetsFromS3RequestDetails = ( input: ImportAssetsFromS3RequestDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssetSources !== undefined) { - bodyParams["AssetSources"] = serializeAws_restJson1_1ListOfAssetSourceEntry( - input.AssetSources, - context - ); - } - if (input.DataSetId !== undefined) { - bodyParams["DataSetId"] = input.DataSetId; - } - if (input.RevisionId !== undefined) { - bodyParams["RevisionId"] = input.RevisionId; - } - return bodyParams; + return { + ...(input.AssetSources !== undefined && { + AssetSources: serializeAws_restJson1_1ListOfAssetSourceEntry( + input.AssetSources, + context + ) + }), + ...(input.DataSetId !== undefined && { DataSetId: input.DataSetId }), + ...(input.RevisionId !== undefined && { RevisionId: input.RevisionId }) + }; }; const serializeAws_restJson1_1ListOfAssetDestinationEntry = ( @@ -3783,40 +3749,32 @@ const serializeAws_restJson1_1RequestDetails = ( input: RequestDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExportAssetToSignedUrl !== undefined) { - bodyParams[ - "ExportAssetToSignedUrl" - ] = serializeAws_restJson1_1ExportAssetToSignedUrlRequestDetails( - input.ExportAssetToSignedUrl, - context - ); - } - if (input.ExportAssetsToS3 !== undefined) { - bodyParams[ - "ExportAssetsToS3" - ] = serializeAws_restJson1_1ExportAssetsToS3RequestDetails( - input.ExportAssetsToS3, - context - ); - } - if (input.ImportAssetFromSignedUrl !== undefined) { - bodyParams[ - "ImportAssetFromSignedUrl" - ] = serializeAws_restJson1_1ImportAssetFromSignedUrlRequestDetails( - input.ImportAssetFromSignedUrl, - context - ); - } - if (input.ImportAssetsFromS3 !== undefined) { - bodyParams[ - "ImportAssetsFromS3" - ] = serializeAws_restJson1_1ImportAssetsFromS3RequestDetails( - input.ImportAssetsFromS3, - context - ); - } - return bodyParams; + return { + ...(input.ExportAssetToSignedUrl !== undefined && { + ExportAssetToSignedUrl: serializeAws_restJson1_1ExportAssetToSignedUrlRequestDetails( + input.ExportAssetToSignedUrl, + context + ) + }), + ...(input.ExportAssetsToS3 !== undefined && { + ExportAssetsToS3: serializeAws_restJson1_1ExportAssetsToS3RequestDetails( + input.ExportAssetsToS3, + context + ) + }), + ...(input.ImportAssetFromSignedUrl !== undefined && { + ImportAssetFromSignedUrl: serializeAws_restJson1_1ImportAssetFromSignedUrlRequestDetails( + input.ImportAssetFromSignedUrl, + context + ) + }), + ...(input.ImportAssetsFromS3 !== undefined && { + ImportAssetsFromS3: serializeAws_restJson1_1ImportAssetsFromS3RequestDetails( + input.ImportAssetsFromS3, + context + ) + }) + }; }; const deserializeAws_restJson1_1AssetDestinationEntry = ( diff --git a/clients/client-datasync/protocols/Aws_json1_1.ts b/clients/client-datasync/protocols/Aws_json1_1.ts index 8af3b8468c19..86ede9fab305 100644 --- a/clients/client-datasync/protocols/Aws_json1_1.ts +++ b/clients/client-datasync/protocols/Aws_json1_1.ts @@ -2570,328 +2570,274 @@ const serializeAws_json1_1CancelTaskExecutionRequest = ( input: CancelTaskExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskExecutionArn !== undefined) { - bodyParams["TaskExecutionArn"] = input.TaskExecutionArn; - } - return bodyParams; + return { + ...(input.TaskExecutionArn !== undefined && { + TaskExecutionArn: input.TaskExecutionArn + }) + }; }; const serializeAws_json1_1CreateAgentRequest = ( input: CreateAgentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActivationKey !== undefined) { - bodyParams["ActivationKey"] = input.ActivationKey; - } - if (input.AgentName !== undefined) { - bodyParams["AgentName"] = input.AgentName; - } - if (input.SecurityGroupArns !== undefined) { - bodyParams[ - "SecurityGroupArns" - ] = serializeAws_json1_1PLSecurityGroupArnList( - input.SecurityGroupArns, - context - ); - } - if (input.SubnetArns !== undefined) { - bodyParams["SubnetArns"] = serializeAws_json1_1PLSubnetArnList( - input.SubnetArns, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VpcEndpointId !== undefined) { - bodyParams["VpcEndpointId"] = input.VpcEndpointId; - } - return bodyParams; + 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_1TagList(input.Tags, context) + }), + ...(input.VpcEndpointId !== undefined && { + VpcEndpointId: input.VpcEndpointId + }) + }; }; const serializeAws_json1_1CreateLocationEfsRequest = ( input: CreateLocationEfsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ec2Config !== undefined) { - bodyParams["Ec2Config"] = serializeAws_json1_1Ec2Config( - input.Ec2Config, - context - ); - } - if (input.EfsFilesystemArn !== undefined) { - bodyParams["EfsFilesystemArn"] = input.EfsFilesystemArn; - } - if (input.Subdirectory !== undefined) { - bodyParams["Subdirectory"] = input.Subdirectory; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateLocationNfsRequest = ( input: CreateLocationNfsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MountOptions !== undefined) { - bodyParams["MountOptions"] = serializeAws_json1_1NfsMountOptions( - input.MountOptions, - context - ); - } - if (input.OnPremConfig !== undefined) { - bodyParams["OnPremConfig"] = serializeAws_json1_1OnPremConfig( - input.OnPremConfig, - context - ); - } - if (input.ServerHostname !== undefined) { - bodyParams["ServerHostname"] = input.ServerHostname; - } - if (input.Subdirectory !== undefined) { - bodyParams["Subdirectory"] = input.Subdirectory; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateLocationS3Request = ( input: CreateLocationS3Request, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3BucketArn !== undefined) { - bodyParams["S3BucketArn"] = input.S3BucketArn; - } - if (input.S3Config !== undefined) { - bodyParams["S3Config"] = serializeAws_json1_1S3Config( - input.S3Config, - context - ); - } - if (input.S3StorageClass !== undefined) { - bodyParams["S3StorageClass"] = input.S3StorageClass; - } - if (input.Subdirectory !== undefined) { - bodyParams["Subdirectory"] = input.Subdirectory; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(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_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateLocationSmbRequest = ( input: CreateLocationSmbRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentArns !== undefined) { - bodyParams["AgentArns"] = serializeAws_json1_1AgentArnList( - input.AgentArns, - context - ); - } - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.MountOptions !== undefined) { - bodyParams["MountOptions"] = serializeAws_json1_1SmbMountOptions( - input.MountOptions, - context - ); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.ServerHostname !== undefined) { - bodyParams["ServerHostname"] = input.ServerHostname; - } - if (input.Subdirectory !== undefined) { - bodyParams["Subdirectory"] = input.Subdirectory; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.User !== undefined) { - bodyParams["User"] = input.User; - } - return bodyParams; + 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_1TagList(input.Tags, context) + }), + ...(input.User !== undefined && { User: input.User }) + }; }; const serializeAws_json1_1CreateTaskRequest = ( input: CreateTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogGroupArn !== undefined) { - bodyParams["CloudWatchLogGroupArn"] = input.CloudWatchLogGroupArn; - } - if (input.DestinationLocationArn !== undefined) { - bodyParams["DestinationLocationArn"] = input.DestinationLocationArn; - } - if (input.Excludes !== undefined) { - bodyParams["Excludes"] = serializeAws_json1_1FilterList( - input.Excludes, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Options !== undefined) { - bodyParams["Options"] = serializeAws_json1_1Options(input.Options, context); - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = serializeAws_json1_1TaskSchedule( - input.Schedule, - context - ); - } - if (input.SourceLocationArn !== undefined) { - bodyParams["SourceLocationArn"] = input.SourceLocationArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1DeleteAgentRequest = ( input: DeleteAgentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentArn !== undefined) { - bodyParams["AgentArn"] = input.AgentArn; - } - return bodyParams; + return { + ...(input.AgentArn !== undefined && { AgentArn: input.AgentArn }) + }; }; const serializeAws_json1_1DeleteLocationRequest = ( input: DeleteLocationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocationArn !== undefined) { - bodyParams["LocationArn"] = input.LocationArn; - } - return bodyParams; + return { + ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }) + }; }; const serializeAws_json1_1DeleteTaskRequest = ( input: DeleteTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - return bodyParams; + return { + ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }) + }; }; const serializeAws_json1_1DescribeAgentRequest = ( input: DescribeAgentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentArn !== undefined) { - bodyParams["AgentArn"] = input.AgentArn; - } - return bodyParams; + return { + ...(input.AgentArn !== undefined && { AgentArn: input.AgentArn }) + }; }; const serializeAws_json1_1DescribeLocationEfsRequest = ( input: DescribeLocationEfsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocationArn !== undefined) { - bodyParams["LocationArn"] = input.LocationArn; - } - return bodyParams; + return { + ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }) + }; }; const serializeAws_json1_1DescribeLocationNfsRequest = ( input: DescribeLocationNfsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocationArn !== undefined) { - bodyParams["LocationArn"] = input.LocationArn; - } - return bodyParams; + return { + ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }) + }; }; const serializeAws_json1_1DescribeLocationS3Request = ( input: DescribeLocationS3Request, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocationArn !== undefined) { - bodyParams["LocationArn"] = input.LocationArn; - } - return bodyParams; + return { + ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }) + }; }; const serializeAws_json1_1DescribeLocationSmbRequest = ( input: DescribeLocationSmbRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocationArn !== undefined) { - bodyParams["LocationArn"] = input.LocationArn; - } - return bodyParams; + return { + ...(input.LocationArn !== undefined && { LocationArn: input.LocationArn }) + }; }; const serializeAws_json1_1DescribeTaskExecutionRequest = ( input: DescribeTaskExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskExecutionArn !== undefined) { - bodyParams["TaskExecutionArn"] = input.TaskExecutionArn; - } - return bodyParams; + return { + ...(input.TaskExecutionArn !== undefined && { + TaskExecutionArn: input.TaskExecutionArn + }) + }; }; const serializeAws_json1_1DescribeTaskRequest = ( input: DescribeTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - return bodyParams; + return { + ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }) + }; }; const serializeAws_json1_1Ec2Config = ( input: Ec2Config, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupArns !== undefined) { - bodyParams[ - "SecurityGroupArns" - ] = serializeAws_json1_1Ec2SecurityGroupArnList( - input.SecurityGroupArns, - context - ); - } - if (input.SubnetArn !== undefined) { - bodyParams["SubnetArn"] = input.SubnetArn; - } - return bodyParams; + return { + ...(input.SecurityGroupArns !== undefined && { + SecurityGroupArns: serializeAws_json1_1Ec2SecurityGroupArnList( + input.SecurityGroupArns, + context + ) + }), + ...(input.SubnetArn !== undefined && { SubnetArn: input.SubnetArn }) + }; }; const serializeAws_json1_1Ec2SecurityGroupArnList = ( @@ -2912,156 +2858,113 @@ const serializeAws_json1_1FilterRule = ( input: FilterRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FilterType !== undefined) { - bodyParams["FilterType"] = input.FilterType; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.FilterType !== undefined && { FilterType: input.FilterType }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ListAgentsRequest = ( input: ListAgentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListLocationsRequest = ( input: ListLocationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListTaskExecutionsRequest = ( input: ListTaskExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.TaskArn !== undefined && { TaskArn: input.TaskArn }) + }; }; const serializeAws_json1_1ListTasksRequest = ( input: ListTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1NfsMountOptions = ( input: NfsMountOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1OnPremConfig = ( input: OnPremConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentArns !== undefined) { - bodyParams["AgentArns"] = serializeAws_json1_1AgentArnList( - input.AgentArns, - context - ); - } - return bodyParams; + return { + ...(input.AgentArns !== undefined && { + AgentArns: serializeAws_json1_1AgentArnList(input.AgentArns, context) + }) + }; }; const serializeAws_json1_1Options = ( input: Options, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Atime !== undefined) { - bodyParams["Atime"] = input.Atime; - } - if (input.BytesPerSecond !== undefined) { - bodyParams["BytesPerSecond"] = input.BytesPerSecond; - } - if (input.Gid !== undefined) { - bodyParams["Gid"] = input.Gid; - } - if (input.Mtime !== undefined) { - bodyParams["Mtime"] = input.Mtime; - } - if (input.OverwriteMode !== undefined) { - bodyParams["OverwriteMode"] = input.OverwriteMode; - } - if (input.PosixPermissions !== undefined) { - bodyParams["PosixPermissions"] = input.PosixPermissions; - } - if (input.PreserveDeletedFiles !== undefined) { - bodyParams["PreserveDeletedFiles"] = input.PreserveDeletedFiles; - } - if (input.PreserveDevices !== undefined) { - bodyParams["PreserveDevices"] = input.PreserveDevices; - } - if (input.TaskQueueing !== undefined) { - bodyParams["TaskQueueing"] = input.TaskQueueing; - } - if (input.Uid !== undefined) { - bodyParams["Uid"] = input.Uid; - } - if (input.VerifyMode !== undefined) { - bodyParams["VerifyMode"] = input.VerifyMode; - } - return bodyParams; + return { + ...(input.Atime !== undefined && { Atime: input.Atime }), + ...(input.BytesPerSecond !== undefined && { + BytesPerSecond: input.BytesPerSecond + }), + ...(input.Gid !== undefined && { Gid: input.Gid }), + ...(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.Uid !== undefined && { Uid: input.Uid }), + ...(input.VerifyMode !== undefined && { VerifyMode: input.VerifyMode }) + }; }; const serializeAws_json1_1PLSecurityGroupArnList = ( @@ -3082,45 +2985,38 @@ const serializeAws_json1_1S3Config = ( input: S3Config, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketAccessRoleArn !== undefined) { - bodyParams["BucketAccessRoleArn"] = input.BucketAccessRoleArn; - } - return bodyParams; + return { + ...(input.BucketAccessRoleArn !== undefined && { + BucketAccessRoleArn: input.BucketAccessRoleArn + }) + }; }; const serializeAws_json1_1SmbMountOptions = ( input: SmbMountOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1StartTaskExecutionRequest = ( input: StartTaskExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Includes !== undefined) { - bodyParams["Includes"] = serializeAws_json1_1FilterList( - input.Includes, - context - ); - } - if (input.OverrideOptions !== undefined) { - bodyParams["OverrideOptions"] = serializeAws_json1_1Options( - input.OverrideOptions, - context - ); - } - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -3141,99 +3037,77 @@ const serializeAws_json1_1TagListEntry = ( input: TagListEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TaskSchedule = ( input: TaskSchedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - return bodyParams; + return { + ...(input.ScheduleExpression !== undefined && { + ScheduleExpression: input.ScheduleExpression + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Keys !== undefined) { - bodyParams["Keys"] = serializeAws_json1_1TagKeyList(input.Keys, context); - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.Keys !== undefined && { + Keys: serializeAws_json1_1TagKeyList(input.Keys, context) + }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1UpdateAgentRequest = ( input: UpdateAgentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentArn !== undefined) { - bodyParams["AgentArn"] = input.AgentArn; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.AgentArn !== undefined && { AgentArn: input.AgentArn }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateTaskRequest = ( input: UpdateTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogGroupArn !== undefined) { - bodyParams["CloudWatchLogGroupArn"] = input.CloudWatchLogGroupArn; - } - if (input.Excludes !== undefined) { - bodyParams["Excludes"] = serializeAws_json1_1FilterList( - input.Excludes, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Options !== undefined) { - bodyParams["Options"] = serializeAws_json1_1Options(input.Options, context); - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = serializeAws_json1_1TaskSchedule( - input.Schedule, - context - ); - } - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AgentArnList = ( diff --git a/clients/client-dax/protocols/Aws_json1_1.ts b/clients/client-dax/protocols/Aws_json1_1.ts index 10114c74b974..1c4b323494db 100644 --- a/clients/client-dax/protocols/Aws_json1_1.ts +++ b/clients/client-dax/protocols/Aws_json1_1.ts @@ -3314,296 +3314,242 @@ const serializeAws_json1_1CreateClusterRequest = ( input: CreateClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZones !== undefined) { - bodyParams["AvailabilityZones"] = serializeAws_json1_1AvailabilityZoneList( - input.AvailabilityZones, - context - ); - } - if (input.ClusterName !== undefined) { - bodyParams["ClusterName"] = input.ClusterName; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.NodeType !== undefined) { - bodyParams["NodeType"] = input.NodeType; - } - if (input.NotificationTopicArn !== undefined) { - bodyParams["NotificationTopicArn"] = input.NotificationTopicArn; - } - if (input.ParameterGroupName !== undefined) { - bodyParams["ParameterGroupName"] = input.ParameterGroupName; - } - if (input.PreferredMaintenanceWindow !== undefined) { - bodyParams["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; - } - if (input.ReplicationFactor !== undefined) { - bodyParams["ReplicationFactor"] = input.ReplicationFactor; - } - if (input.SSESpecification !== undefined) { - bodyParams["SSESpecification"] = serializeAws_json1_1SSESpecification( - input.SSESpecification, - context - ); - } - if (input.SecurityGroupIds !== undefined) { - bodyParams[ - "SecurityGroupIds" - ] = serializeAws_json1_1SecurityGroupIdentifierList( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetGroupName !== undefined) { - bodyParams["SubnetGroupName"] = input.SubnetGroupName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateParameterGroupRequest = ( input: CreateParameterGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ParameterGroupName !== undefined) { - bodyParams["ParameterGroupName"] = input.ParameterGroupName; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.ParameterGroupName !== undefined && { + ParameterGroupName: input.ParameterGroupName + }) + }; }; const serializeAws_json1_1CreateSubnetGroupRequest = ( input: CreateSubnetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.SubnetGroupName !== undefined) { - bodyParams["SubnetGroupName"] = input.SubnetGroupName; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIdentifierList( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.SubnetGroupName !== undefined && { + SubnetGroupName: input.SubnetGroupName + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIdentifierList( + input.SubnetIds, + context + ) + }) + }; }; const serializeAws_json1_1DecreaseReplicationFactorRequest = ( input: DecreaseReplicationFactorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZones !== undefined) { - bodyParams["AvailabilityZones"] = serializeAws_json1_1AvailabilityZoneList( - input.AvailabilityZones, - context - ); - } - if (input.ClusterName !== undefined) { - bodyParams["ClusterName"] = input.ClusterName; - } - if (input.NewReplicationFactor !== undefined) { - bodyParams["NewReplicationFactor"] = input.NewReplicationFactor; - } - if (input.NodeIdsToRemove !== undefined) { - bodyParams["NodeIdsToRemove"] = serializeAws_json1_1NodeIdentifierList( - input.NodeIdsToRemove, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DeleteClusterRequest = ( input: DeleteClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterName !== undefined) { - bodyParams["ClusterName"] = input.ClusterName; - } - return bodyParams; + return { + ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }) + }; }; const serializeAws_json1_1DeleteParameterGroupRequest = ( input: DeleteParameterGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterGroupName !== undefined) { - bodyParams["ParameterGroupName"] = input.ParameterGroupName; - } - return bodyParams; + return { + ...(input.ParameterGroupName !== undefined && { + ParameterGroupName: input.ParameterGroupName + }) + }; }; const serializeAws_json1_1DeleteSubnetGroupRequest = ( input: DeleteSubnetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SubnetGroupName !== undefined) { - bodyParams["SubnetGroupName"] = input.SubnetGroupName; - } - return bodyParams; + return { + ...(input.SubnetGroupName !== undefined && { + SubnetGroupName: input.SubnetGroupName + }) + }; }; const serializeAws_json1_1DescribeClustersRequest = ( input: DescribeClustersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterNames !== undefined) { - bodyParams["ClusterNames"] = serializeAws_json1_1ClusterNameList( - input.ClusterNames, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ClusterNames !== undefined && { + ClusterNames: serializeAws_json1_1ClusterNameList( + input.ClusterNames, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeDefaultParametersRequest = ( input: DescribeDefaultParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeEventsRequest = ( input: DescribeEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SourceName !== undefined) { - bodyParams["SourceName"] = input.SourceName; - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeParameterGroupsRequest = ( input: DescribeParameterGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParameterGroupNames !== undefined) { - bodyParams[ - "ParameterGroupNames" - ] = serializeAws_json1_1ParameterGroupNameList( - input.ParameterGroupNames, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ParameterGroupNames !== undefined && { + ParameterGroupNames: serializeAws_json1_1ParameterGroupNameList( + input.ParameterGroupNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeParametersRequest = ( input: DescribeParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParameterGroupName !== undefined) { - bodyParams["ParameterGroupName"] = input.ParameterGroupName; - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeSubnetGroupsRequest = ( input: DescribeSubnetGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SubnetGroupNames !== undefined) { - bodyParams["SubnetGroupNames"] = serializeAws_json1_1SubnetGroupNameList( - input.SubnetGroupNames, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.SubnetGroupNames !== undefined && { + SubnetGroupNames: serializeAws_json1_1SubnetGroupNameList( + input.SubnetGroupNames, + context + ) + }) + }; }; const serializeAws_json1_1IncreaseReplicationFactorRequest = ( input: IncreaseReplicationFactorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZones !== undefined) { - bodyParams["AvailabilityZones"] = serializeAws_json1_1AvailabilityZoneList( - input.AvailabilityZones, - context - ); - } - if (input.ClusterName !== undefined) { - bodyParams["ClusterName"] = input.ClusterName; - } - if (input.NewReplicationFactor !== undefined) { - bodyParams["NewReplicationFactor"] = input.NewReplicationFactor; - } - return bodyParams; + return { + ...(input.AvailabilityZones !== undefined && { + AvailabilityZones: serializeAws_json1_1AvailabilityZoneList( + input.AvailabilityZones, + context + ) + }), + ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), + ...(input.NewReplicationFactor !== undefined && { + NewReplicationFactor: input.NewReplicationFactor + }) + }; }; const serializeAws_json1_1KeyList = ( @@ -3617,14 +3563,12 @@ const serializeAws_json1_1ListTagsRequest = ( input: ListTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceName !== undefined && { + ResourceName: input.ResourceName + }) + }; }; const serializeAws_json1_1NodeIdentifierList = ( @@ -3645,14 +3589,14 @@ const serializeAws_json1_1ParameterNameValue = ( input: ParameterNameValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterName !== undefined) { - bodyParams["ParameterName"] = input.ParameterName; - } - if (input.ParameterValue !== undefined) { - bodyParams["ParameterValue"] = input.ParameterValue; - } - return bodyParams; + return { + ...(input.ParameterName !== undefined && { + ParameterName: input.ParameterName + }), + ...(input.ParameterValue !== undefined && { + ParameterValue: input.ParameterValue + }) + }; }; const serializeAws_json1_1ParameterNameValueList = ( @@ -3668,25 +3612,19 @@ const serializeAws_json1_1RebootNodeRequest = ( input: RebootNodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterName !== undefined) { - bodyParams["ClusterName"] = input.ClusterName; - } - if (input.NodeId !== undefined) { - bodyParams["NodeId"] = input.NodeId; - } - return bodyParams; + return { + ...(input.ClusterName !== undefined && { ClusterName: input.ClusterName }), + ...(input.NodeId !== undefined && { NodeId: input.NodeId }) + }; }; const serializeAws_json1_1SSESpecification = ( input: SSESpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_json1_1SecurityGroupIdentifierList = ( @@ -3711,14 +3649,10 @@ const serializeAws_json1_1SubnetIdentifierList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagList = ( @@ -3732,101 +3666,91 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceName !== undefined && { + ResourceName: input.ResourceName + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1KeyList(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceName !== undefined && { + ResourceName: input.ResourceName + }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateClusterRequest = ( input: UpdateClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterName !== undefined) { - bodyParams["ClusterName"] = input.ClusterName; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.NotificationTopicArn !== undefined) { - bodyParams["NotificationTopicArn"] = input.NotificationTopicArn; - } - if (input.NotificationTopicStatus !== undefined) { - bodyParams["NotificationTopicStatus"] = input.NotificationTopicStatus; - } - if (input.ParameterGroupName !== undefined) { - bodyParams["ParameterGroupName"] = input.ParameterGroupName; - } - if (input.PreferredMaintenanceWindow !== undefined) { - bodyParams["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams[ - "SecurityGroupIds" - ] = serializeAws_json1_1SecurityGroupIdentifierList( - input.SecurityGroupIds, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateParameterGroupRequest = ( input: UpdateParameterGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterGroupName !== undefined) { - bodyParams["ParameterGroupName"] = input.ParameterGroupName; - } - if (input.ParameterNameValues !== undefined) { - bodyParams[ - "ParameterNameValues" - ] = serializeAws_json1_1ParameterNameValueList( - input.ParameterNameValues, - context - ); - } - return bodyParams; + return { + ...(input.ParameterGroupName !== undefined && { + ParameterGroupName: input.ParameterGroupName + }), + ...(input.ParameterNameValues !== undefined && { + ParameterNameValues: serializeAws_json1_1ParameterNameValueList( + input.ParameterNameValues, + context + ) + }) + }; }; const serializeAws_json1_1UpdateSubnetGroupRequest = ( input: UpdateSubnetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.SubnetGroupName !== undefined) { - bodyParams["SubnetGroupName"] = input.SubnetGroupName; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIdentifierList( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.SubnetGroupName !== undefined && { + SubnetGroupName: input.SubnetGroupName + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIdentifierList( + input.SubnetIds, + context + ) + }) + }; }; const deserializeAws_json1_1InvalidParameterCombinationException = ( diff --git a/clients/client-detective/protocols/Aws_restJson1_1.ts b/clients/client-detective/protocols/Aws_restJson1_1.ts index 32ca3d611748..77d38df0fbe3 100644 --- a/clients/client-detective/protocols/Aws_restJson1_1.ts +++ b/clients/client-detective/protocols/Aws_restJson1_1.ts @@ -1434,14 +1434,12 @@ const serializeAws_restJson1_1Account = ( input: Account, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.EmailAddress !== undefined) { - bodyParams["EmailAddress"] = input.EmailAddress; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.EmailAddress !== undefined && { + EmailAddress: input.EmailAddress + }) + }; }; const serializeAws_restJson1_1AccountIdList = ( diff --git a/clients/client-device-farm/protocols/Aws_json1_1.ts b/clients/client-device-farm/protocols/Aws_json1_1.ts index ae1b0b1f45fd..cf1a13c396c4 100644 --- a/clients/client-device-farm/protocols/Aws_json1_1.ts +++ b/clients/client-device-farm/protocols/Aws_json1_1.ts @@ -9083,391 +9083,310 @@ const serializeAws_json1_1CreateDevicePoolRequest = ( input: CreateDevicePoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.maxDevices !== undefined) { - bodyParams["maxDevices"] = input.maxDevices; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.rules !== undefined) { - bodyParams["rules"] = serializeAws_json1_1Rules(input.rules, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateInstanceProfileRequest = ( input: CreateInstanceProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.excludeAppPackagesFromCleanup !== undefined) { - bodyParams[ - "excludeAppPackagesFromCleanup" - ] = serializeAws_json1_1PackageIds( - input.excludeAppPackagesFromCleanup, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.packageCleanup !== undefined) { - bodyParams["packageCleanup"] = input.packageCleanup; - } - if (input.rebootAfterUse !== undefined) { - bodyParams["rebootAfterUse"] = input.rebootAfterUse; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateNetworkProfileRequest = ( input: CreateNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.downlinkBandwidthBits !== undefined) { - bodyParams["downlinkBandwidthBits"] = input.downlinkBandwidthBits; - } - if (input.downlinkDelayMs !== undefined) { - bodyParams["downlinkDelayMs"] = input.downlinkDelayMs; - } - if (input.downlinkJitterMs !== undefined) { - bodyParams["downlinkJitterMs"] = input.downlinkJitterMs; - } - if (input.downlinkLossPercent !== undefined) { - bodyParams["downlinkLossPercent"] = input.downlinkLossPercent; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.uplinkBandwidthBits !== undefined) { - bodyParams["uplinkBandwidthBits"] = input.uplinkBandwidthBits; - } - if (input.uplinkDelayMs !== undefined) { - bodyParams["uplinkDelayMs"] = input.uplinkDelayMs; - } - if (input.uplinkJitterMs !== undefined) { - bodyParams["uplinkJitterMs"] = input.uplinkJitterMs; - } - if (input.uplinkLossPercent !== undefined) { - bodyParams["uplinkLossPercent"] = input.uplinkLossPercent; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateProjectRequest = ( input: CreateProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultJobTimeoutMinutes !== undefined) { - bodyParams["defaultJobTimeoutMinutes"] = input.defaultJobTimeoutMinutes; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.defaultJobTimeoutMinutes !== undefined && { + defaultJobTimeoutMinutes: input.defaultJobTimeoutMinutes + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1CreateRemoteAccessSessionConfiguration = ( input: CreateRemoteAccessSessionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.billingMethod !== undefined) { - bodyParams["billingMethod"] = input.billingMethod; - } - if (input.vpceConfigurationArns !== undefined) { - bodyParams[ - "vpceConfigurationArns" - ] = serializeAws_json1_1AmazonResourceNames( - input.vpceConfigurationArns, - context - ); - } - return bodyParams; + return { + ...(input.billingMethod !== undefined && { + billingMethod: input.billingMethod + }), + ...(input.vpceConfigurationArns !== undefined && { + vpceConfigurationArns: serializeAws_json1_1AmazonResourceNames( + input.vpceConfigurationArns, + context + ) + }) + }; }; const serializeAws_json1_1CreateRemoteAccessSessionRequest = ( input: CreateRemoteAccessSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientId !== undefined) { - bodyParams["clientId"] = input.clientId; - } - if (input.configuration !== undefined) { - bodyParams[ - "configuration" - ] = serializeAws_json1_1CreateRemoteAccessSessionConfiguration( - input.configuration, - context - ); - } - if (input.deviceArn !== undefined) { - bodyParams["deviceArn"] = input.deviceArn; - } - if (input.instanceArn !== undefined) { - bodyParams["instanceArn"] = input.instanceArn; - } - if (input.interactionMode !== undefined) { - bodyParams["interactionMode"] = input.interactionMode; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.remoteDebugEnabled !== undefined) { - bodyParams["remoteDebugEnabled"] = input.remoteDebugEnabled; - } - if (input.remoteRecordAppArn !== undefined) { - bodyParams["remoteRecordAppArn"] = input.remoteRecordAppArn; - } - if (input.remoteRecordEnabled !== undefined) { - bodyParams["remoteRecordEnabled"] = input.remoteRecordEnabled; - } - if (input.skipAppResign !== undefined) { - bodyParams["skipAppResign"] = input.skipAppResign; - } - if (input.sshPublicKey !== undefined) { - bodyParams["sshPublicKey"] = input.sshPublicKey; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateTestGridProjectRequest = ( input: CreateTestGridProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1CreateTestGridUrlRequest = ( input: CreateTestGridUrlRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expiresInSeconds !== undefined) { - bodyParams["expiresInSeconds"] = input.expiresInSeconds; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - return bodyParams; + return { + ...(input.expiresInSeconds !== undefined && { + expiresInSeconds: input.expiresInSeconds + }), + ...(input.projectArn !== undefined && { projectArn: input.projectArn }) + }; }; const serializeAws_json1_1CreateUploadRequest = ( input: CreateUploadRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.contentType !== undefined) { - bodyParams["contentType"] = input.contentType; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateVPCEConfigurationRequest = ( input: CreateVPCEConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.serviceDnsName !== undefined) { - bodyParams["serviceDnsName"] = input.serviceDnsName; - } - if (input.vpceConfigurationDescription !== undefined) { - bodyParams["vpceConfigurationDescription"] = - input.vpceConfigurationDescription; - } - if (input.vpceConfigurationName !== undefined) { - bodyParams["vpceConfigurationName"] = input.vpceConfigurationName; - } - if (input.vpceServiceName !== undefined) { - bodyParams["vpceServiceName"] = input.vpceServiceName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CustomerArtifactPaths = ( input: CustomerArtifactPaths, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.androidPaths !== undefined) { - bodyParams["androidPaths"] = serializeAws_json1_1AndroidPaths( - input.androidPaths, - context - ); - } - if (input.deviceHostPaths !== undefined) { - bodyParams["deviceHostPaths"] = serializeAws_json1_1DeviceHostPaths( - input.deviceHostPaths, - context - ); - } - if (input.iosPaths !== undefined) { - bodyParams["iosPaths"] = serializeAws_json1_1IosPaths( - input.iosPaths, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteDevicePoolRequest = ( input: DeleteDevicePoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteInstanceProfileRequest = ( input: DeleteInstanceProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteNetworkProfileRequest = ( input: DeleteNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteProjectRequest = ( input: DeleteProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteRemoteAccessSessionRequest = ( input: DeleteRemoteAccessSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteRunRequest = ( input: DeleteRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteTestGridProjectRequest = ( input: DeleteTestGridProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - return bodyParams; + return { + ...(input.projectArn !== undefined && { projectArn: input.projectArn }) + }; }; const serializeAws_json1_1DeleteUploadRequest = ( input: DeleteUploadRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeleteVPCEConfigurationRequest = ( input: DeleteVPCEConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1DeviceFilter = ( input: DeviceFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attribute !== undefined) { - bodyParams["attribute"] = input.attribute; - } - if (input.operator !== undefined) { - bodyParams["operator"] = input.operator; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1DeviceFilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.attribute !== undefined && { attribute: input.attribute }), + ...(input.operator !== undefined && { operator: input.operator }), + ...(input.values !== undefined && { + values: serializeAws_json1_1DeviceFilterValues(input.values, context) + }) + }; }; const serializeAws_json1_1DeviceFilterValues = ( @@ -9495,273 +9414,222 @@ const serializeAws_json1_1DeviceSelectionConfiguration = ( input: DeviceSelectionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1DeviceFilters( - input.filters, - context - ); - } - if (input.maxDevices !== undefined) { - bodyParams["maxDevices"] = input.maxDevices; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_json1_1DeviceFilters(input.filters, context) + }), + ...(input.maxDevices !== undefined && { maxDevices: input.maxDevices }) + }; }; const serializeAws_json1_1ExecutionConfiguration = ( input: ExecutionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.accountsCleanup !== undefined) { - bodyParams["accountsCleanup"] = input.accountsCleanup; - } - if (input.appPackagesCleanup !== undefined) { - bodyParams["appPackagesCleanup"] = input.appPackagesCleanup; - } - if (input.jobTimeoutMinutes !== undefined) { - bodyParams["jobTimeoutMinutes"] = input.jobTimeoutMinutes; - } - if (input.skipAppResign !== undefined) { - bodyParams["skipAppResign"] = input.skipAppResign; - } - if (input.videoCapture !== undefined) { - bodyParams["videoCapture"] = input.videoCapture; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetAccountSettingsRequest = ( input: GetAccountSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetDeviceInstanceRequest = ( input: GetDeviceInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetDevicePoolCompatibilityRequest = ( input: GetDevicePoolCompatibilityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appArn !== undefined) { - bodyParams["appArn"] = input.appArn; - } - if (input.configuration !== undefined) { - bodyParams["configuration"] = serializeAws_json1_1ScheduleRunConfiguration( - input.configuration, - context - ); - } - if (input.devicePoolArn !== undefined) { - bodyParams["devicePoolArn"] = input.devicePoolArn; - } - if (input.test !== undefined) { - bodyParams["test"] = serializeAws_json1_1ScheduleRunTest( - input.test, - context - ); - } - if (input.testType !== undefined) { - bodyParams["testType"] = input.testType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetDevicePoolRequest = ( input: GetDevicePoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetDeviceRequest = ( input: GetDeviceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetInstanceProfileRequest = ( input: GetInstanceProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetJobRequest = ( input: GetJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetNetworkProfileRequest = ( input: GetNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetOfferingStatusRequest = ( input: GetOfferingStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetProjectRequest = ( input: GetProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetRemoteAccessSessionRequest = ( input: GetRemoteAccessSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetRunRequest = ( input: GetRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetSuiteRequest = ( input: GetSuiteRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetTestGridProjectRequest = ( input: GetTestGridProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - return bodyParams; + return { + ...(input.projectArn !== undefined && { projectArn: input.projectArn }) + }; }; const serializeAws_json1_1GetTestGridSessionRequest = ( input: GetTestGridSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.sessionArn !== undefined) { - bodyParams["sessionArn"] = input.sessionArn; - } - if (input.sessionId !== undefined) { - bodyParams["sessionId"] = input.sessionId; - } - return bodyParams; + return { + ...(input.projectArn !== undefined && { projectArn: input.projectArn }), + ...(input.sessionArn !== undefined && { sessionArn: input.sessionArn }), + ...(input.sessionId !== undefined && { sessionId: input.sessionId }) + }; }; const serializeAws_json1_1GetTestRequest = ( input: GetTestRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetUploadRequest = ( input: GetUploadRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1GetVPCEConfigurationRequest = ( input: GetVPCEConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1InstallToRemoteAccessSessionRequest = ( input: InstallToRemoteAccessSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appArn !== undefined) { - bodyParams["appArn"] = input.appArn; - } - if (input.remoteAccessSessionArn !== undefined) { - bodyParams["remoteAccessSessionArn"] = input.remoteAccessSessionArn; - } - return bodyParams; + return { + ...(input.appArn !== undefined && { appArn: input.appArn }), + ...(input.remoteAccessSessionArn !== undefined && { + remoteAccessSessionArn: input.remoteAccessSessionArn + }) + }; }; const serializeAws_json1_1InstanceLabels = ( @@ -9782,391 +9650,270 @@ const serializeAws_json1_1ListArtifactsRequest = ( input: ListArtifactsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ListDeviceInstancesRequest = ( input: ListDeviceInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListDevicePoolsRequest = ( input: ListDevicePoolsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ListDevicesRequest = ( input: ListDevicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1DeviceFilters( - input.filters, - context - ); - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.filters !== undefined && { + filters: serializeAws_json1_1DeviceFilters(input.filters, context) + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListInstanceProfilesRequest = ( input: ListInstanceProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListJobsRequest = ( input: ListJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListNetworkProfilesRequest = ( input: ListNetworkProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ListOfferingPromotionsRequest = ( input: ListOfferingPromotionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListOfferingTransactionsRequest = ( input: ListOfferingTransactionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListOfferingsRequest = ( input: ListOfferingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListProjectsRequest = ( input: ListProjectsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListRemoteAccessSessionsRequest = ( input: ListRemoteAccessSessionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListRunsRequest = ( input: ListRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListSamplesRequest = ( input: ListSamplesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListSuitesRequest = ( input: ListSuitesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListTestGridProjectsRequest = ( input: ListTestGridProjectsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResult !== undefined) { - bodyParams["maxResult"] = input.maxResult; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResult !== undefined && { maxResult: input.maxResult }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListTestGridSessionActionsRequest = ( input: ListTestGridSessionActionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResult !== undefined) { - bodyParams["maxResult"] = input.maxResult; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sessionArn !== undefined) { - bodyParams["sessionArn"] = input.sessionArn; - } - return bodyParams; + return { + ...(input.maxResult !== undefined && { maxResult: input.maxResult }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.sessionArn !== undefined && { sessionArn: input.sessionArn }) + }; }; const serializeAws_json1_1ListTestGridSessionArtifactsRequest = ( input: ListTestGridSessionArtifactsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResult !== undefined) { - bodyParams["maxResult"] = input.maxResult; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sessionArn !== undefined) { - bodyParams["sessionArn"] = input.sessionArn; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTestGridSessionsRequest = ( input: ListTestGridSessionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.creationTimeAfter !== undefined) { - bodyParams["creationTimeAfter"] = Math.round( - input.creationTimeAfter.getTime() / 1000 - ); - } - if (input.creationTimeBefore !== undefined) { - bodyParams["creationTimeBefore"] = Math.round( - input.creationTimeBefore.getTime() / 1000 - ); - } - if (input.endTimeAfter !== undefined) { - bodyParams["endTimeAfter"] = Math.round( - input.endTimeAfter.getTime() / 1000 - ); - } - if (input.endTimeBefore !== undefined) { - bodyParams["endTimeBefore"] = Math.round( - input.endTimeBefore.getTime() / 1000 - ); - } - if (input.maxResult !== undefined) { - bodyParams["maxResult"] = input.maxResult; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTestsRequest = ( input: ListTestsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListUniqueProblemsRequest = ( input: ListUniqueProblemsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListUploadsRequest = ( input: ListUploadsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ListVPCEConfigurationsRequest = ( input: ListVPCEConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1Location = ( input: Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.latitude !== undefined) { - bodyParams["latitude"] = input.latitude; - } - if (input.longitude !== undefined) { - bodyParams["longitude"] = input.longitude; - } - return bodyParams; + return { + ...(input.latitude !== undefined && { latitude: input.latitude }), + ...(input.longitude !== undefined && { longitude: input.longitude }) + }; }; const serializeAws_json1_1PackageIds = ( @@ -10180,68 +9927,46 @@ const serializeAws_json1_1PurchaseOfferingRequest = ( input: PurchaseOfferingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.offeringId !== undefined) { - bodyParams["offeringId"] = input.offeringId; - } - if (input.offeringPromotionId !== undefined) { - bodyParams["offeringPromotionId"] = input.offeringPromotionId; - } - if (input.quantity !== undefined) { - bodyParams["quantity"] = input.quantity; - } - return bodyParams; + return { + ...(input.offeringId !== undefined && { offeringId: input.offeringId }), + ...(input.offeringPromotionId !== undefined && { + offeringPromotionId: input.offeringPromotionId + }), + ...(input.quantity !== undefined && { quantity: input.quantity }) + }; }; const serializeAws_json1_1Radios = ( input: Radios, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bluetooth !== undefined) { - bodyParams["bluetooth"] = input.bluetooth; - } - if (input.gps !== undefined) { - bodyParams["gps"] = input.gps; - } - if (input.nfc !== undefined) { - bodyParams["nfc"] = input.nfc; - } - if (input.wifi !== undefined) { - bodyParams["wifi"] = input.wifi; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RenewOfferingRequest = ( input: RenewOfferingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.offeringId !== undefined) { - bodyParams["offeringId"] = input.offeringId; - } - if (input.quantity !== undefined) { - bodyParams["quantity"] = input.quantity; - } - return bodyParams; + return { + ...(input.offeringId !== undefined && { offeringId: input.offeringId }), + ...(input.quantity !== undefined && { quantity: input.quantity }) + }; }; const serializeAws_json1_1Rule = ( input: Rule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attribute !== undefined) { - bodyParams["attribute"] = input.attribute; - } - if (input.operator !== undefined) { - bodyParams["operator"] = input.operator; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.attribute !== undefined && { attribute: input.attribute }), + ...(input.operator !== undefined && { operator: input.operator }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1Rules = ( @@ -10255,169 +9980,128 @@ const serializeAws_json1_1ScheduleRunConfiguration = ( input: ScheduleRunConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.auxiliaryApps !== undefined) { - bodyParams["auxiliaryApps"] = serializeAws_json1_1AmazonResourceNames( - input.auxiliaryApps, - context - ); - } - if (input.billingMethod !== undefined) { - bodyParams["billingMethod"] = input.billingMethod; - } - if (input.customerArtifactPaths !== undefined) { - bodyParams[ - "customerArtifactPaths" - ] = serializeAws_json1_1CustomerArtifactPaths( - input.customerArtifactPaths, - context - ); - } - if (input.extraDataPackageArn !== undefined) { - bodyParams["extraDataPackageArn"] = input.extraDataPackageArn; - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.location !== undefined) { - bodyParams["location"] = serializeAws_json1_1Location( - input.location, - context - ); - } - if (input.networkProfileArn !== undefined) { - bodyParams["networkProfileArn"] = input.networkProfileArn; - } - if (input.radios !== undefined) { - bodyParams["radios"] = serializeAws_json1_1Radios(input.radios, context); - } - if (input.vpceConfigurationArns !== undefined) { - bodyParams[ - "vpceConfigurationArns" - ] = serializeAws_json1_1AmazonResourceNames( - input.vpceConfigurationArns, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ScheduleRunRequest = ( input: ScheduleRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appArn !== undefined) { - bodyParams["appArn"] = input.appArn; - } - if (input.configuration !== undefined) { - bodyParams["configuration"] = serializeAws_json1_1ScheduleRunConfiguration( - input.configuration, - context - ); - } - if (input.devicePoolArn !== undefined) { - bodyParams["devicePoolArn"] = input.devicePoolArn; - } - if (input.deviceSelectionConfiguration !== undefined) { - bodyParams[ - "deviceSelectionConfiguration" - ] = serializeAws_json1_1DeviceSelectionConfiguration( - input.deviceSelectionConfiguration, - context - ); - } - if (input.executionConfiguration !== undefined) { - bodyParams[ - "executionConfiguration" - ] = serializeAws_json1_1ExecutionConfiguration( - input.executionConfiguration, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - if (input.test !== undefined) { - bodyParams["test"] = serializeAws_json1_1ScheduleRunTest( - input.test, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ScheduleRunTest = ( input: ScheduleRunTest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = input.filter; - } - if (input.parameters !== undefined) { - bodyParams["parameters"] = serializeAws_json1_1TestParameters( - input.parameters, - context - ); - } - if (input.testPackageArn !== undefined) { - bodyParams["testPackageArn"] = input.testPackageArn; - } - if (input.testSpecArn !== undefined) { - bodyParams["testSpecArn"] = input.testSpecArn; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StopJobRequest = ( input: StopJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1StopRemoteAccessSessionRequest = ( input: StopRemoteAccessSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1StopRunRequest = ( input: StopRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -10438,14 +10122,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TestParameters = ( @@ -10462,216 +10144,159 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateDeviceInstanceRequest = ( input: UpdateDeviceInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.labels !== undefined) { - bodyParams["labels"] = serializeAws_json1_1InstanceLabels( - input.labels, - context - ); - } - if (input.profileArn !== undefined) { - bodyParams["profileArn"] = input.profileArn; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.labels !== undefined && { + labels: serializeAws_json1_1InstanceLabels(input.labels, context) + }), + ...(input.profileArn !== undefined && { profileArn: input.profileArn }) + }; }; const serializeAws_json1_1UpdateDevicePoolRequest = ( input: UpdateDevicePoolRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.clearMaxDevices !== undefined) { - bodyParams["clearMaxDevices"] = input.clearMaxDevices; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.maxDevices !== undefined) { - bodyParams["maxDevices"] = input.maxDevices; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.rules !== undefined) { - bodyParams["rules"] = serializeAws_json1_1Rules(input.rules, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateInstanceProfileRequest = ( input: UpdateInstanceProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.excludeAppPackagesFromCleanup !== undefined) { - bodyParams[ - "excludeAppPackagesFromCleanup" - ] = serializeAws_json1_1PackageIds( - input.excludeAppPackagesFromCleanup, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.packageCleanup !== undefined) { - bodyParams["packageCleanup"] = input.packageCleanup; - } - if (input.rebootAfterUse !== undefined) { - bodyParams["rebootAfterUse"] = input.rebootAfterUse; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateNetworkProfileRequest = ( input: UpdateNetworkProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.downlinkBandwidthBits !== undefined) { - bodyParams["downlinkBandwidthBits"] = input.downlinkBandwidthBits; - } - if (input.downlinkDelayMs !== undefined) { - bodyParams["downlinkDelayMs"] = input.downlinkDelayMs; - } - if (input.downlinkJitterMs !== undefined) { - bodyParams["downlinkJitterMs"] = input.downlinkJitterMs; - } - if (input.downlinkLossPercent !== undefined) { - bodyParams["downlinkLossPercent"] = input.downlinkLossPercent; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.uplinkBandwidthBits !== undefined) { - bodyParams["uplinkBandwidthBits"] = input.uplinkBandwidthBits; - } - if (input.uplinkDelayMs !== undefined) { - bodyParams["uplinkDelayMs"] = input.uplinkDelayMs; - } - if (input.uplinkJitterMs !== undefined) { - bodyParams["uplinkJitterMs"] = input.uplinkJitterMs; - } - if (input.uplinkLossPercent !== undefined) { - bodyParams["uplinkLossPercent"] = input.uplinkLossPercent; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateProjectRequest = ( input: UpdateProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.defaultJobTimeoutMinutes !== undefined) { - bodyParams["defaultJobTimeoutMinutes"] = input.defaultJobTimeoutMinutes; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.defaultJobTimeoutMinutes !== undefined && { + defaultJobTimeoutMinutes: input.defaultJobTimeoutMinutes + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1UpdateTestGridProjectRequest = ( input: UpdateTestGridProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.projectArn !== undefined) { - bodyParams["projectArn"] = input.projectArn; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.name !== undefined && { name: input.name }), + ...(input.projectArn !== undefined && { projectArn: input.projectArn }) + }; }; const serializeAws_json1_1UpdateUploadRequest = ( input: UpdateUploadRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.contentType !== undefined) { - bodyParams["contentType"] = input.contentType; - } - if (input.editContent !== undefined) { - bodyParams["editContent"] = input.editContent; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateVPCEConfigurationRequest = ( input: UpdateVPCEConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.serviceDnsName !== undefined) { - bodyParams["serviceDnsName"] = input.serviceDnsName; - } - if (input.vpceConfigurationDescription !== undefined) { - bodyParams["vpceConfigurationDescription"] = - input.vpceConfigurationDescription; - } - if (input.vpceConfigurationName !== undefined) { - bodyParams["vpceConfigurationName"] = input.vpceConfigurationName; - } - if (input.vpceServiceName !== undefined) { - bodyParams["vpceServiceName"] = input.vpceServiceName; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1AccountSettings = ( diff --git a/clients/client-direct-connect/protocols/Aws_json1_1.ts b/clients/client-direct-connect/protocols/Aws_json1_1.ts index e81ee644ca83..3545ea4b5d60 100644 --- a/clients/client-direct-connect/protocols/Aws_json1_1.ts +++ b/clients/client-direct-connect/protocols/Aws_json1_1.ts @@ -5399,1059 +5399,920 @@ const serializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalRequest = input: AcceptDirectConnectGatewayAssociationProposalRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.associatedGatewayOwnerAccount !== undefined) { - bodyParams["associatedGatewayOwnerAccount"] = - input.associatedGatewayOwnerAccount; - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.overrideAllowedPrefixesToDirectConnectGateway !== undefined) { - bodyParams[ - "overrideAllowedPrefixesToDirectConnectGateway" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.overrideAllowedPrefixesToDirectConnectGateway, - context - ); - } - if (input.proposalId !== undefined) { - bodyParams["proposalId"] = input.proposalId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AllocateConnectionOnInterconnectRequest = ( input: AllocateConnectionOnInterconnectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bandwidth !== undefined) { - bodyParams["bandwidth"] = input.bandwidth; - } - if (input.connectionName !== undefined) { - bodyParams["connectionName"] = input.connectionName; - } - if (input.interconnectId !== undefined) { - bodyParams["interconnectId"] = input.interconnectId; - } - if (input.ownerAccount !== undefined) { - bodyParams["ownerAccount"] = input.ownerAccount; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AllocateHostedConnectionRequest = ( input: AllocateHostedConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bandwidth !== undefined) { - bodyParams["bandwidth"] = input.bandwidth; - } - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.connectionName !== undefined) { - bodyParams["connectionName"] = input.connectionName; - } - if (input.ownerAccount !== undefined) { - bodyParams["ownerAccount"] = input.ownerAccount; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AllocatePrivateVirtualInterfaceRequest = ( input: AllocatePrivateVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.newPrivateVirtualInterfaceAllocation !== undefined) { - bodyParams[ - "newPrivateVirtualInterfaceAllocation" - ] = serializeAws_json1_1NewPrivateVirtualInterfaceAllocation( - input.newPrivateVirtualInterfaceAllocation, - context - ); - } - if (input.ownerAccount !== undefined) { - bodyParams["ownerAccount"] = input.ownerAccount; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.newPrivateVirtualInterfaceAllocation !== undefined && { + newPrivateVirtualInterfaceAllocation: serializeAws_json1_1NewPrivateVirtualInterfaceAllocation( + input.newPrivateVirtualInterfaceAllocation, + context + ) + }), + ...(input.ownerAccount !== undefined && { + ownerAccount: input.ownerAccount + }) + }; }; const serializeAws_json1_1AllocatePublicVirtualInterfaceRequest = ( input: AllocatePublicVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.newPublicVirtualInterfaceAllocation !== undefined) { - bodyParams[ - "newPublicVirtualInterfaceAllocation" - ] = serializeAws_json1_1NewPublicVirtualInterfaceAllocation( - input.newPublicVirtualInterfaceAllocation, - context - ); - } - if (input.ownerAccount !== undefined) { - bodyParams["ownerAccount"] = input.ownerAccount; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.newPublicVirtualInterfaceAllocation !== undefined && { + newPublicVirtualInterfaceAllocation: serializeAws_json1_1NewPublicVirtualInterfaceAllocation( + input.newPublicVirtualInterfaceAllocation, + context + ) + }), + ...(input.ownerAccount !== undefined && { + ownerAccount: input.ownerAccount + }) + }; }; const serializeAws_json1_1AllocateTransitVirtualInterfaceRequest = ( input: AllocateTransitVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.newTransitVirtualInterfaceAllocation !== undefined) { - bodyParams[ - "newTransitVirtualInterfaceAllocation" - ] = serializeAws_json1_1NewTransitVirtualInterfaceAllocation( - input.newTransitVirtualInterfaceAllocation, - context - ); - } - if (input.ownerAccount !== undefined) { - bodyParams["ownerAccount"] = input.ownerAccount; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.newTransitVirtualInterfaceAllocation !== undefined && { + newTransitVirtualInterfaceAllocation: serializeAws_json1_1NewTransitVirtualInterfaceAllocation( + input.newTransitVirtualInterfaceAllocation, + context + ) + }), + ...(input.ownerAccount !== undefined && { + ownerAccount: input.ownerAccount + }) + }; }; const serializeAws_json1_1AssociateConnectionWithLagRequest = ( input: AssociateConnectionWithLagRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.lagId !== undefined && { lagId: input.lagId }) + }; }; const serializeAws_json1_1AssociateHostedConnectionRequest = ( input: AssociateHostedConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.parentConnectionId !== undefined) { - bodyParams["parentConnectionId"] = input.parentConnectionId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.parentConnectionId !== undefined && { + parentConnectionId: input.parentConnectionId + }) + }; }; const serializeAws_json1_1AssociateVirtualInterfaceRequest = ( input: AssociateVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1ConfirmConnectionRequest = ( input: ConfirmConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }) + }; }; const serializeAws_json1_1ConfirmPrivateVirtualInterfaceRequest = ( input: ConfirmPrivateVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.virtualGatewayId !== undefined) { - bodyParams["virtualGatewayId"] = input.virtualGatewayId; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.directConnectGatewayId !== undefined && { + directConnectGatewayId: input.directConnectGatewayId + }), + ...(input.virtualGatewayId !== undefined && { + virtualGatewayId: input.virtualGatewayId + }), + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1ConfirmPublicVirtualInterfaceRequest = ( input: ConfirmPublicVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1ConfirmTransitVirtualInterfaceRequest = ( input: ConfirmTransitVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.directConnectGatewayId !== undefined && { + directConnectGatewayId: input.directConnectGatewayId + }), + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1CreateBGPPeerRequest = ( input: CreateBGPPeerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.newBGPPeer !== undefined) { - bodyParams["newBGPPeer"] = serializeAws_json1_1NewBGPPeer( - input.newBGPPeer, - context - ); - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.newBGPPeer !== undefined && { + newBGPPeer: serializeAws_json1_1NewBGPPeer(input.newBGPPeer, context) + }), + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1CreateConnectionRequest = ( input: CreateConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bandwidth !== undefined) { - bodyParams["bandwidth"] = input.bandwidth; - } - if (input.connectionName !== undefined) { - bodyParams["connectionName"] = input.connectionName; - } - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.providerName !== undefined) { - bodyParams["providerName"] = input.providerName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateDirectConnectGatewayAssociationProposalRequest = ( input: CreateDirectConnectGatewayAssociationProposalRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addAllowedPrefixesToDirectConnectGateway !== undefined) { - bodyParams[ - "addAllowedPrefixesToDirectConnectGateway" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.addAllowedPrefixesToDirectConnectGateway, - context - ); - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.directConnectGatewayOwnerAccount !== undefined) { - bodyParams["directConnectGatewayOwnerAccount"] = - input.directConnectGatewayOwnerAccount; - } - if (input.gatewayId !== undefined) { - bodyParams["gatewayId"] = input.gatewayId; - } - if (input.removeAllowedPrefixesToDirectConnectGateway !== undefined) { - bodyParams[ - "removeAllowedPrefixesToDirectConnectGateway" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.removeAllowedPrefixesToDirectConnectGateway, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateDirectConnectGatewayAssociationRequest = ( input: CreateDirectConnectGatewayAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addAllowedPrefixesToDirectConnectGateway !== undefined) { - bodyParams[ - "addAllowedPrefixesToDirectConnectGateway" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.addAllowedPrefixesToDirectConnectGateway, - context - ); - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.gatewayId !== undefined) { - bodyParams["gatewayId"] = input.gatewayId; - } - if (input.virtualGatewayId !== undefined) { - bodyParams["virtualGatewayId"] = input.virtualGatewayId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateDirectConnectGatewayRequest = ( input: CreateDirectConnectGatewayRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.amazonSideAsn !== undefined) { - bodyParams["amazonSideAsn"] = input.amazonSideAsn; - } - if (input.directConnectGatewayName !== undefined) { - bodyParams["directConnectGatewayName"] = input.directConnectGatewayName; - } - return bodyParams; + return { + ...(input.amazonSideAsn !== undefined && { + amazonSideAsn: input.amazonSideAsn + }), + ...(input.directConnectGatewayName !== undefined && { + directConnectGatewayName: input.directConnectGatewayName + }) + }; }; const serializeAws_json1_1CreateInterconnectRequest = ( input: CreateInterconnectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bandwidth !== undefined) { - bodyParams["bandwidth"] = input.bandwidth; - } - if (input.interconnectName !== undefined) { - bodyParams["interconnectName"] = input.interconnectName; - } - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.providerName !== undefined) { - bodyParams["providerName"] = input.providerName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateLagRequest = ( input: CreateLagRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.childConnectionTags !== undefined) { - bodyParams["childConnectionTags"] = serializeAws_json1_1TagList( - input.childConnectionTags, - context - ); - } - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.connectionsBandwidth !== undefined) { - bodyParams["connectionsBandwidth"] = input.connectionsBandwidth; - } - if (input.lagName !== undefined) { - bodyParams["lagName"] = input.lagName; - } - if (input.location !== undefined) { - bodyParams["location"] = input.location; - } - if (input.numberOfConnections !== undefined) { - bodyParams["numberOfConnections"] = input.numberOfConnections; - } - if (input.providerName !== undefined) { - bodyParams["providerName"] = input.providerName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreatePrivateVirtualInterfaceRequest = ( input: CreatePrivateVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.newPrivateVirtualInterface !== undefined) { - bodyParams[ - "newPrivateVirtualInterface" - ] = serializeAws_json1_1NewPrivateVirtualInterface( - input.newPrivateVirtualInterface, - context - ); - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.newPrivateVirtualInterface !== undefined && { + newPrivateVirtualInterface: serializeAws_json1_1NewPrivateVirtualInterface( + input.newPrivateVirtualInterface, + context + ) + }) + }; }; const serializeAws_json1_1CreatePublicVirtualInterfaceRequest = ( input: CreatePublicVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.newPublicVirtualInterface !== undefined) { - bodyParams[ - "newPublicVirtualInterface" - ] = serializeAws_json1_1NewPublicVirtualInterface( - input.newPublicVirtualInterface, - context - ); - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.newPublicVirtualInterface !== undefined && { + newPublicVirtualInterface: serializeAws_json1_1NewPublicVirtualInterface( + input.newPublicVirtualInterface, + context + ) + }) + }; }; const serializeAws_json1_1CreateTransitVirtualInterfaceRequest = ( input: CreateTransitVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.newTransitVirtualInterface !== undefined) { - bodyParams[ - "newTransitVirtualInterface" - ] = serializeAws_json1_1NewTransitVirtualInterface( - input.newTransitVirtualInterface, - context - ); - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.newTransitVirtualInterface !== undefined && { + newTransitVirtualInterface: serializeAws_json1_1NewTransitVirtualInterface( + input.newTransitVirtualInterface, + context + ) + }) + }; }; const serializeAws_json1_1DeleteBGPPeerRequest = ( input: DeleteBGPPeerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.bgpPeerId !== undefined) { - bodyParams["bgpPeerId"] = input.bgpPeerId; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteConnectionRequest = ( input: DeleteConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }) + }; }; const serializeAws_json1_1DeleteDirectConnectGatewayAssociationProposalRequest = ( input: DeleteDirectConnectGatewayAssociationProposalRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.proposalId !== undefined) { - bodyParams["proposalId"] = input.proposalId; - } - return bodyParams; + return { + ...(input.proposalId !== undefined && { proposalId: input.proposalId }) + }; }; const serializeAws_json1_1DeleteDirectConnectGatewayAssociationRequest = ( input: DeleteDirectConnectGatewayAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.associationId !== undefined) { - bodyParams["associationId"] = input.associationId; - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.virtualGatewayId !== undefined) { - bodyParams["virtualGatewayId"] = input.virtualGatewayId; - } - return bodyParams; + return { + ...(input.associationId !== undefined && { + associationId: input.associationId + }), + ...(input.directConnectGatewayId !== undefined && { + directConnectGatewayId: input.directConnectGatewayId + }), + ...(input.virtualGatewayId !== undefined && { + virtualGatewayId: input.virtualGatewayId + }) + }; }; const serializeAws_json1_1DeleteDirectConnectGatewayRequest = ( input: DeleteDirectConnectGatewayRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - return bodyParams; + return { + ...(input.directConnectGatewayId !== undefined && { + directConnectGatewayId: input.directConnectGatewayId + }) + }; }; const serializeAws_json1_1DeleteInterconnectRequest = ( input: DeleteInterconnectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.interconnectId !== undefined) { - bodyParams["interconnectId"] = input.interconnectId; - } - return bodyParams; + return { + ...(input.interconnectId !== undefined && { + interconnectId: input.interconnectId + }) + }; }; const serializeAws_json1_1DeleteLagRequest = ( input: DeleteLagRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - return bodyParams; + return { + ...(input.lagId !== undefined && { lagId: input.lagId }) + }; }; const serializeAws_json1_1DeleteVirtualInterfaceRequest = ( input: DeleteVirtualInterfaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1DescribeConnectionLoaRequest = ( input: DescribeConnectionLoaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.loaContentType !== undefined) { - bodyParams["loaContentType"] = input.loaContentType; - } - if (input.providerName !== undefined) { - bodyParams["providerName"] = input.providerName; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.loaContentType !== undefined && { + loaContentType: input.loaContentType + }), + ...(input.providerName !== undefined && { + providerName: input.providerName + }) + }; }; const serializeAws_json1_1DescribeConnectionsOnInterconnectRequest = ( input: DescribeConnectionsOnInterconnectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.interconnectId !== undefined) { - bodyParams["interconnectId"] = input.interconnectId; - } - return bodyParams; + return { + ...(input.interconnectId !== undefined && { + interconnectId: input.interconnectId + }) + }; }; const serializeAws_json1_1DescribeConnectionsRequest = ( input: DescribeConnectionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }) + }; }; const serializeAws_json1_1DescribeDirectConnectGatewayAssociationProposalsRequest = ( input: DescribeDirectConnectGatewayAssociationProposalsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.associatedGatewayId !== undefined) { - bodyParams["associatedGatewayId"] = input.associatedGatewayId; - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.proposalId !== undefined) { - bodyParams["proposalId"] = input.proposalId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeDirectConnectGatewayAssociationsRequest = ( input: DescribeDirectConnectGatewayAssociationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.associatedGatewayId !== undefined) { - bodyParams["associatedGatewayId"] = input.associatedGatewayId; - } - if (input.associationId !== undefined) { - bodyParams["associationId"] = input.associationId; - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.virtualGatewayId !== undefined) { - bodyParams["virtualGatewayId"] = input.virtualGatewayId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeDirectConnectGatewayAttachmentsRequest = ( input: DescribeDirectConnectGatewayAttachmentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeDirectConnectGatewaysRequest = ( input: DescribeDirectConnectGatewaysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.directConnectGatewayId !== undefined && { + directConnectGatewayId: input.directConnectGatewayId + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeHostedConnectionsRequest = ( input: DescribeHostedConnectionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }) + }; }; const serializeAws_json1_1DescribeInterconnectLoaRequest = ( input: DescribeInterconnectLoaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.interconnectId !== undefined) { - bodyParams["interconnectId"] = input.interconnectId; - } - if (input.loaContentType !== undefined) { - bodyParams["loaContentType"] = input.loaContentType; - } - if (input.providerName !== undefined) { - bodyParams["providerName"] = input.providerName; - } - return bodyParams; + return { + ...(input.interconnectId !== undefined && { + interconnectId: input.interconnectId + }), + ...(input.loaContentType !== undefined && { + loaContentType: input.loaContentType + }), + ...(input.providerName !== undefined && { + providerName: input.providerName + }) + }; }; const serializeAws_json1_1DescribeInterconnectsRequest = ( input: DescribeInterconnectsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.interconnectId !== undefined) { - bodyParams["interconnectId"] = input.interconnectId; - } - return bodyParams; + return { + ...(input.interconnectId !== undefined && { + interconnectId: input.interconnectId + }) + }; }; const serializeAws_json1_1DescribeLagsRequest = ( input: DescribeLagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - return bodyParams; + return { + ...(input.lagId !== undefined && { lagId: input.lagId }) + }; }; const serializeAws_json1_1DescribeLoaRequest = ( input: DescribeLoaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.loaContentType !== undefined) { - bodyParams["loaContentType"] = input.loaContentType; - } - if (input.providerName !== undefined) { - bodyParams["providerName"] = input.providerName; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.loaContentType !== undefined && { + loaContentType: input.loaContentType + }), + ...(input.providerName !== undefined && { + providerName: input.providerName + }) + }; }; const serializeAws_json1_1DescribeTagsRequest = ( input: DescribeTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArns !== undefined) { - bodyParams["resourceArns"] = serializeAws_json1_1ResourceArnList( - input.resourceArns, - context - ); - } - return bodyParams; + return { + ...(input.resourceArns !== undefined && { + resourceArns: serializeAws_json1_1ResourceArnList( + input.resourceArns, + context + ) + }) + }; }; const serializeAws_json1_1DescribeVirtualInterfacesRequest = ( input: DescribeVirtualInterfacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const serializeAws_json1_1DisassociateConnectionFromLagRequest = ( input: DisassociateConnectionFromLagRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectionId !== undefined) { - bodyParams["connectionId"] = input.connectionId; - } - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - return bodyParams; + return { + ...(input.connectionId !== undefined && { + connectionId: input.connectionId + }), + ...(input.lagId !== undefined && { lagId: input.lagId }) + }; }; const serializeAws_json1_1NewBGPPeer = ( input: NewBGPPeer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1NewPrivateVirtualInterface = ( input: NewPrivateVirtualInterface, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.mtu !== undefined) { - bodyParams["mtu"] = input.mtu; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.virtualGatewayId !== undefined) { - bodyParams["virtualGatewayId"] = input.virtualGatewayId; - } - if (input.virtualInterfaceName !== undefined) { - bodyParams["virtualInterfaceName"] = input.virtualInterfaceName; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NewPrivateVirtualInterfaceAllocation = ( input: NewPrivateVirtualInterfaceAllocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.mtu !== undefined) { - bodyParams["mtu"] = input.mtu; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.virtualInterfaceName !== undefined) { - bodyParams["virtualInterfaceName"] = input.virtualInterfaceName; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NewPublicVirtualInterface = ( input: NewPublicVirtualInterface, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.routeFilterPrefixes !== undefined) { - bodyParams[ - "routeFilterPrefixes" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.routeFilterPrefixes, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.virtualInterfaceName !== undefined) { - bodyParams["virtualInterfaceName"] = input.virtualInterfaceName; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NewPublicVirtualInterfaceAllocation = ( input: NewPublicVirtualInterfaceAllocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.routeFilterPrefixes !== undefined) { - bodyParams[ - "routeFilterPrefixes" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.routeFilterPrefixes, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.virtualInterfaceName !== undefined) { - bodyParams["virtualInterfaceName"] = input.virtualInterfaceName; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NewTransitVirtualInterface = ( input: NewTransitVirtualInterface, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.directConnectGatewayId !== undefined) { - bodyParams["directConnectGatewayId"] = input.directConnectGatewayId; - } - if (input.mtu !== undefined) { - bodyParams["mtu"] = input.mtu; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.virtualInterfaceName !== undefined) { - bodyParams["virtualInterfaceName"] = input.virtualInterfaceName; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NewTransitVirtualInterfaceAllocation = ( input: NewTransitVirtualInterfaceAllocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addressFamily !== undefined) { - bodyParams["addressFamily"] = input.addressFamily; - } - if (input.amazonAddress !== undefined) { - bodyParams["amazonAddress"] = input.amazonAddress; - } - if (input.asn !== undefined) { - bodyParams["asn"] = input.asn; - } - if (input.authKey !== undefined) { - bodyParams["authKey"] = input.authKey; - } - if (input.customerAddress !== undefined) { - bodyParams["customerAddress"] = input.customerAddress; - } - if (input.mtu !== undefined) { - bodyParams["mtu"] = input.mtu; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.virtualInterfaceName !== undefined) { - bodyParams["virtualInterfaceName"] = input.virtualInterfaceName; - } - if (input.vlan !== undefined) { - bodyParams["vlan"] = input.vlan; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ResourceArnList = ( @@ -6465,11 +6326,9 @@ const serializeAws_json1_1RouteFilterPrefix = ( input: RouteFilterPrefix, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cidr !== undefined) { - bodyParams["cidr"] = input.cidr; - } - return bodyParams; + return { + ...(input.cidr !== undefined && { cidr: input.cidr }) + }; }; const serializeAws_json1_1RouteFilterPrefixList = ( @@ -6482,14 +6341,10 @@ const serializeAws_json1_1RouteFilterPrefixList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -6510,89 +6365,72 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateDirectConnectGatewayAssociationRequest = ( input: UpdateDirectConnectGatewayAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addAllowedPrefixesToDirectConnectGateway !== undefined) { - bodyParams[ - "addAllowedPrefixesToDirectConnectGateway" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.addAllowedPrefixesToDirectConnectGateway, - context - ); - } - if (input.associationId !== undefined) { - bodyParams["associationId"] = input.associationId; - } - if (input.removeAllowedPrefixesToDirectConnectGateway !== undefined) { - bodyParams[ - "removeAllowedPrefixesToDirectConnectGateway" - ] = serializeAws_json1_1RouteFilterPrefixList( - input.removeAllowedPrefixesToDirectConnectGateway, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateLagRequest = ( input: UpdateLagRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lagId !== undefined) { - bodyParams["lagId"] = input.lagId; - } - if (input.lagName !== undefined) { - bodyParams["lagName"] = input.lagName; - } - if (input.minimumLinks !== undefined) { - bodyParams["minimumLinks"] = input.minimumLinks; - } - return bodyParams; + return { + ...(input.lagId !== undefined && { lagId: input.lagId }), + ...(input.lagName !== undefined && { lagName: input.lagName }), + ...(input.minimumLinks !== undefined && { + minimumLinks: input.minimumLinks + }) + }; }; const serializeAws_json1_1UpdateVirtualInterfaceAttributesRequest = ( input: UpdateVirtualInterfaceAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.mtu !== undefined) { - bodyParams["mtu"] = input.mtu; - } - if (input.virtualInterfaceId !== undefined) { - bodyParams["virtualInterfaceId"] = input.virtualInterfaceId; - } - return bodyParams; + return { + ...(input.mtu !== undefined && { mtu: input.mtu }), + ...(input.virtualInterfaceId !== undefined && { + virtualInterfaceId: input.virtualInterfaceId + }) + }; }; const deserializeAws_json1_1AcceptDirectConnectGatewayAssociationProposalResult = ( diff --git a/clients/client-directory-service/protocols/Aws_json1_1.ts b/clients/client-directory-service/protocols/Aws_json1_1.ts index 134fda399a4e..81fe63b4833f 100644 --- a/clients/client-directory-service/protocols/Aws_json1_1.ts +++ b/clients/client-directory-service/protocols/Aws_json1_1.ts @@ -8029,60 +8029,49 @@ const serializeAws_json1_1AcceptSharedDirectoryRequest = ( input: AcceptSharedDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SharedDirectoryId !== undefined) { - bodyParams["SharedDirectoryId"] = input.SharedDirectoryId; - } - return bodyParams; + return { + ...(input.SharedDirectoryId !== undefined && { + SharedDirectoryId: input.SharedDirectoryId + }) + }; }; const serializeAws_json1_1AddIpRoutesRequest = ( input: AddIpRoutesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.IpRoutes !== undefined) { - bodyParams["IpRoutes"] = serializeAws_json1_1IpRoutes( - input.IpRoutes, - context - ); - } - if (input.UpdateSecurityGroupForDirectoryControllers !== undefined) { - bodyParams["UpdateSecurityGroupForDirectoryControllers"] = - input.UpdateSecurityGroupForDirectoryControllers; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.IpRoutes !== undefined && { + IpRoutes: serializeAws_json1_1IpRoutes(input.IpRoutes, context) + }), + ...(input.UpdateSecurityGroupForDirectoryControllers !== undefined && { + UpdateSecurityGroupForDirectoryControllers: + input.UpdateSecurityGroupForDirectoryControllers + }) + }; }; const serializeAws_json1_1AddTagsToResourceRequest = ( input: AddTagsToResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Attribute = ( input: Attribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1Attributes = ( @@ -8096,14 +8085,12 @@ const serializeAws_json1_1CancelSchemaExtensionRequest = ( input: CancelSchemaExtensionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.SchemaExtensionId !== undefined) { - bodyParams["SchemaExtensionId"] = input.SchemaExtensionId; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.SchemaExtensionId !== undefined && { + SchemaExtensionId: input.SchemaExtensionId + }) + }; }; const serializeAws_json1_1CidrIps = ( @@ -8117,515 +8104,390 @@ const serializeAws_json1_1ConnectDirectoryRequest = ( input: ConnectDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectSettings !== undefined) { - bodyParams[ - "ConnectSettings" - ] = serializeAws_json1_1DirectoryConnectSettings( - input.ConnectSettings, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.ShortName !== undefined) { - bodyParams["ShortName"] = input.ShortName; - } - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateAliasRequest = ( input: CreateAliasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alias !== undefined) { - bodyParams["Alias"] = input.Alias; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.Alias !== undefined && { Alias: input.Alias }), + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1CreateComputerRequest = ( input: CreateComputerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComputerAttributes !== undefined) { - bodyParams["ComputerAttributes"] = serializeAws_json1_1Attributes( - input.ComputerAttributes, - context - ); - } - if (input.ComputerName !== undefined) { - bodyParams["ComputerName"] = input.ComputerName; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.OrganizationalUnitDistinguishedName !== undefined) { - bodyParams["OrganizationalUnitDistinguishedName"] = - input.OrganizationalUnitDistinguishedName; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateConditionalForwarderRequest = ( input: CreateConditionalForwarderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.DnsIpAddrs !== undefined) { - bodyParams["DnsIpAddrs"] = serializeAws_json1_1DnsIpAddrs( - input.DnsIpAddrs, - context - ); - } - if (input.RemoteDomainName !== undefined) { - bodyParams["RemoteDomainName"] = input.RemoteDomainName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DnsIpAddrs !== undefined && { + DnsIpAddrs: serializeAws_json1_1DnsIpAddrs(input.DnsIpAddrs, context) + }), + ...(input.RemoteDomainName !== undefined && { + RemoteDomainName: input.RemoteDomainName + }) + }; }; const serializeAws_json1_1CreateDirectoryRequest = ( input: CreateDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.ShortName !== undefined) { - bodyParams["ShortName"] = input.ShortName; - } - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VpcSettings !== undefined) { - bodyParams["VpcSettings"] = serializeAws_json1_1DirectoryVpcSettings( - input.VpcSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateLogSubscriptionRequest = ( input: CreateLogSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.LogGroupName !== undefined) { - bodyParams["LogGroupName"] = input.LogGroupName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.LogGroupName !== undefined && { + LogGroupName: input.LogGroupName + }) + }; }; const serializeAws_json1_1CreateMicrosoftADRequest = ( input: CreateMicrosoftADRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Edition !== undefined) { - bodyParams["Edition"] = input.Edition; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.ShortName !== undefined) { - bodyParams["ShortName"] = input.ShortName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VpcSettings !== undefined) { - bodyParams["VpcSettings"] = serializeAws_json1_1DirectoryVpcSettings( - input.VpcSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateSnapshotRequest = ( input: CreateSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateTrustRequest = ( input: CreateTrustRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionalForwarderIpAddrs !== undefined) { - bodyParams["ConditionalForwarderIpAddrs"] = serializeAws_json1_1DnsIpAddrs( - input.ConditionalForwarderIpAddrs, - context - ); - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.RemoteDomainName !== undefined) { - bodyParams["RemoteDomainName"] = input.RemoteDomainName; - } - if (input.SelectiveAuth !== undefined) { - bodyParams["SelectiveAuth"] = input.SelectiveAuth; - } - if (input.TrustDirection !== undefined) { - bodyParams["TrustDirection"] = input.TrustDirection; - } - if (input.TrustPassword !== undefined) { - bodyParams["TrustPassword"] = input.TrustPassword; - } - if (input.TrustType !== undefined) { - bodyParams["TrustType"] = input.TrustType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteConditionalForwarderRequest = ( input: DeleteConditionalForwarderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.RemoteDomainName !== undefined) { - bodyParams["RemoteDomainName"] = input.RemoteDomainName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.RemoteDomainName !== undefined && { + RemoteDomainName: input.RemoteDomainName + }) + }; }; const serializeAws_json1_1DeleteDirectoryRequest = ( input: DeleteDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1DeleteLogSubscriptionRequest = ( input: DeleteLogSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1DeleteSnapshotRequest = ( input: DeleteSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnapshotId !== undefined) { - bodyParams["SnapshotId"] = input.SnapshotId; - } - return bodyParams; + return { + ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }) + }; }; const serializeAws_json1_1DeleteTrustRequest = ( input: DeleteTrustRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteAssociatedConditionalForwarder !== undefined) { - bodyParams["DeleteAssociatedConditionalForwarder"] = - input.DeleteAssociatedConditionalForwarder; - } - if (input.TrustId !== undefined) { - bodyParams["TrustId"] = input.TrustId; - } - return bodyParams; + return { + ...(input.DeleteAssociatedConditionalForwarder !== undefined && { + DeleteAssociatedConditionalForwarder: + input.DeleteAssociatedConditionalForwarder + }), + ...(input.TrustId !== undefined && { TrustId: input.TrustId }) + }; }; const serializeAws_json1_1DeregisterCertificateRequest = ( input: DeregisterCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateId !== undefined) { - bodyParams["CertificateId"] = input.CertificateId; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.CertificateId !== undefined && { + CertificateId: input.CertificateId + }), + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1DeregisterEventTopicRequest = ( input: DeregisterEventTopicRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.TopicName !== undefined) { - bodyParams["TopicName"] = input.TopicName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.TopicName !== undefined && { TopicName: input.TopicName }) + }; }; const serializeAws_json1_1DescribeCertificateRequest = ( input: DescribeCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateId !== undefined) { - bodyParams["CertificateId"] = input.CertificateId; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.CertificateId !== undefined && { + CertificateId: input.CertificateId + }), + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1DescribeConditionalForwardersRequest = ( input: DescribeConditionalForwardersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.RemoteDomainNames !== undefined) { - bodyParams["RemoteDomainNames"] = serializeAws_json1_1RemoteDomainNames( - input.RemoteDomainNames, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.RemoteDomainNames !== undefined && { + RemoteDomainNames: serializeAws_json1_1RemoteDomainNames( + input.RemoteDomainNames, + context + ) + }) + }; }; const serializeAws_json1_1DescribeDirectoriesRequest = ( input: DescribeDirectoriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryIds !== undefined) { - bodyParams["DirectoryIds"] = serializeAws_json1_1DirectoryIds( - input.DirectoryIds, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryIds !== undefined && { + DirectoryIds: serializeAws_json1_1DirectoryIds( + input.DirectoryIds, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeDomainControllersRequest = ( input: DescribeDomainControllersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.DomainControllerIds !== undefined) { - bodyParams["DomainControllerIds"] = serializeAws_json1_1DomainControllerIds( - input.DomainControllerIds, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEventTopicsRequest = ( input: DescribeEventTopicsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.TopicNames !== undefined) { - bodyParams["TopicNames"] = serializeAws_json1_1TopicNames( - input.TopicNames, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.TopicNames !== undefined && { + TopicNames: serializeAws_json1_1TopicNames(input.TopicNames, context) + }) + }; }; const serializeAws_json1_1DescribeLDAPSSettingsRequest = ( input: DescribeLDAPSSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeSharedDirectoriesRequest = ( input: DescribeSharedDirectoriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OwnerDirectoryId !== undefined) { - bodyParams["OwnerDirectoryId"] = input.OwnerDirectoryId; - } - if (input.SharedDirectoryIds !== undefined) { - bodyParams["SharedDirectoryIds"] = serializeAws_json1_1DirectoryIds( - input.SharedDirectoryIds, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeSnapshotsRequest = ( input: DescribeSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SnapshotIds !== undefined) { - bodyParams["SnapshotIds"] = serializeAws_json1_1SnapshotIds( - input.SnapshotIds, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeTrustsRequest = ( input: DescribeTrustsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TrustIds !== undefined) { - bodyParams["TrustIds"] = serializeAws_json1_1TrustIds( - input.TrustIds, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DirectoryConnectSettings = ( input: DirectoryConnectSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomerDnsIps !== undefined) { - bodyParams["CustomerDnsIps"] = serializeAws_json1_1DnsIpAddrs( - input.CustomerDnsIps, - context - ); - } - if (input.CustomerUserName !== undefined) { - bodyParams["CustomerUserName"] = input.CustomerUserName; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DirectoryIds = ( @@ -8639,59 +8501,42 @@ const serializeAws_json1_1DirectoryVpcSettings = ( input: DirectoryVpcSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + return { + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) + }), + ...(input.VpcId !== undefined && { VpcId: input.VpcId }) + }; }; const serializeAws_json1_1DisableLDAPSRequest = ( input: DisableLDAPSRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1DisableRadiusRequest = ( input: DisableRadiusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1DisableSsoRequest = ( input: DisableSsoRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1DnsIpAddrs = ( @@ -8712,81 +8557,62 @@ const serializeAws_json1_1EnableLDAPSRequest = ( input: EnableLDAPSRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1EnableRadiusRequest = ( input: EnableRadiusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.RadiusSettings !== undefined) { - bodyParams["RadiusSettings"] = serializeAws_json1_1RadiusSettings( - input.RadiusSettings, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.RadiusSettings !== undefined && { + RadiusSettings: serializeAws_json1_1RadiusSettings( + input.RadiusSettings, + context + ) + }) + }; }; const serializeAws_json1_1EnableSsoRequest = ( input: EnableSsoRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1GetDirectoryLimitsRequest = ( input: GetDirectoryLimitsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetSnapshotLimitsRequest = ( input: GetSnapshotLimitsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1IpRoute = ( input: IpRoute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CidrIp !== undefined) { - bodyParams["CidrIp"] = input.CidrIp; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - return bodyParams; + return { + ...(input.CidrIp !== undefined && { CidrIp: input.CidrIp }), + ...(input.Description !== undefined && { Description: input.Description }) + }; }; const serializeAws_json1_1IpRoutes = ( @@ -8800,159 +8626,118 @@ const serializeAws_json1_1ListCertificatesRequest = ( input: ListCertificatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListIpRoutesRequest = ( input: ListIpRoutesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListLogSubscriptionsRequest = ( input: ListLogSubscriptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListSchemaExtensionsRequest = ( input: ListSchemaExtensionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1RadiusSettings = ( input: RadiusSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationProtocol !== undefined) { - bodyParams["AuthenticationProtocol"] = input.AuthenticationProtocol; - } - if (input.DisplayLabel !== undefined) { - bodyParams["DisplayLabel"] = input.DisplayLabel; - } - if (input.RadiusPort !== undefined) { - bodyParams["RadiusPort"] = input.RadiusPort; - } - if (input.RadiusRetries !== undefined) { - bodyParams["RadiusRetries"] = input.RadiusRetries; - } - if (input.RadiusServers !== undefined) { - bodyParams["RadiusServers"] = serializeAws_json1_1Servers( - input.RadiusServers, - context - ); - } - if (input.RadiusTimeout !== undefined) { - bodyParams["RadiusTimeout"] = input.RadiusTimeout; - } - if (input.SharedSecret !== undefined) { - bodyParams["SharedSecret"] = input.SharedSecret; - } - if (input.UseSameUsername !== undefined) { - bodyParams["UseSameUsername"] = input.UseSameUsername; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1RegisterCertificateRequest = ( input: RegisterCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateData !== undefined) { - bodyParams["CertificateData"] = input.CertificateData; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.CertificateData !== undefined && { + CertificateData: input.CertificateData + }), + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1RegisterEventTopicRequest = ( input: RegisterEventTopicRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.TopicName !== undefined) { - bodyParams["TopicName"] = input.TopicName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.TopicName !== undefined && { TopicName: input.TopicName }) + }; }; const serializeAws_json1_1RejectSharedDirectoryRequest = ( input: RejectSharedDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SharedDirectoryId !== undefined) { - bodyParams["SharedDirectoryId"] = input.SharedDirectoryId; - } - return bodyParams; + return { + ...(input.SharedDirectoryId !== undefined && { + SharedDirectoryId: input.SharedDirectoryId + }) + }; }; const serializeAws_json1_1RemoteDomainNames = ( @@ -8966,56 +8751,44 @@ const serializeAws_json1_1RemoveIpRoutesRequest = ( input: RemoveIpRoutesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CidrIps !== undefined) { - bodyParams["CidrIps"] = serializeAws_json1_1CidrIps(input.CidrIps, context); - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.CidrIps !== undefined && { + CidrIps: serializeAws_json1_1CidrIps(input.CidrIps, context) + }), + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1RemoveTagsFromResourceRequest = ( input: RemoveTagsFromResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1ResetUserPasswordRequest = ( input: ResetUserPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.NewPassword !== undefined) { - bodyParams["NewPassword"] = input.NewPassword; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.NewPassword !== undefined && { NewPassword: input.NewPassword }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1RestoreFromSnapshotRequest = ( input: RestoreFromSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnapshotId !== undefined) { - bodyParams["SnapshotId"] = input.SnapshotId; - } - return bodyParams; + return { + ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }) + }; }; const serializeAws_json1_1Servers = ( @@ -9029,37 +8802,24 @@ const serializeAws_json1_1ShareDirectoryRequest = ( input: ShareDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.ShareMethod !== undefined) { - bodyParams["ShareMethod"] = input.ShareMethod; - } - if (input.ShareNotes !== undefined) { - bodyParams["ShareNotes"] = input.ShareNotes; - } - if (input.ShareTarget !== undefined) { - bodyParams["ShareTarget"] = serializeAws_json1_1ShareTarget( - input.ShareTarget, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ShareTarget = ( input: ShareTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1SnapshotIds = ( @@ -9073,21 +8833,15 @@ const serializeAws_json1_1StartSchemaExtensionRequest = ( input: StartSchemaExtensionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreateSnapshotBeforeSchemaExtension !== undefined) { - bodyParams["CreateSnapshotBeforeSchemaExtension"] = - input.CreateSnapshotBeforeSchemaExtension; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.LdifContent !== undefined) { - bodyParams["LdifContent"] = input.LdifContent; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SubnetIds = ( @@ -9098,14 +8852,10 @@ const serializeAws_json1_1SubnetIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -9140,107 +8890,88 @@ const serializeAws_json1_1UnshareDirectoryRequest = ( input: UnshareDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.UnshareTarget !== undefined) { - bodyParams["UnshareTarget"] = serializeAws_json1_1UnshareTarget( - input.UnshareTarget, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.UnshareTarget !== undefined && { + UnshareTarget: serializeAws_json1_1UnshareTarget( + input.UnshareTarget, + context + ) + }) + }; }; const serializeAws_json1_1UnshareTarget = ( input: UnshareTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1UpdateConditionalForwarderRequest = ( input: UpdateConditionalForwarderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.DnsIpAddrs !== undefined) { - bodyParams["DnsIpAddrs"] = serializeAws_json1_1DnsIpAddrs( - input.DnsIpAddrs, - context - ); - } - if (input.RemoteDomainName !== undefined) { - bodyParams["RemoteDomainName"] = input.RemoteDomainName; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.DnsIpAddrs !== undefined && { + DnsIpAddrs: serializeAws_json1_1DnsIpAddrs(input.DnsIpAddrs, context) + }), + ...(input.RemoteDomainName !== undefined && { + RemoteDomainName: input.RemoteDomainName + }) + }; }; const serializeAws_json1_1UpdateNumberOfDomainControllersRequest = ( input: UpdateNumberOfDomainControllersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredNumber !== undefined) { - bodyParams["DesiredNumber"] = input.DesiredNumber; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.DesiredNumber !== undefined && { + DesiredNumber: input.DesiredNumber + }), + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1UpdateRadiusRequest = ( input: UpdateRadiusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.RadiusSettings !== undefined) { - bodyParams["RadiusSettings"] = serializeAws_json1_1RadiusSettings( - input.RadiusSettings, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.RadiusSettings !== undefined && { + RadiusSettings: serializeAws_json1_1RadiusSettings( + input.RadiusSettings, + context + ) + }) + }; }; const serializeAws_json1_1UpdateTrustRequest = ( input: UpdateTrustRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SelectiveAuth !== undefined) { - bodyParams["SelectiveAuth"] = input.SelectiveAuth; - } - if (input.TrustId !== undefined) { - bodyParams["TrustId"] = input.TrustId; - } - return bodyParams; + return { + ...(input.SelectiveAuth !== undefined && { + SelectiveAuth: input.SelectiveAuth + }), + ...(input.TrustId !== undefined && { TrustId: input.TrustId }) + }; }; const serializeAws_json1_1VerifyTrustRequest = ( input: VerifyTrustRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrustId !== undefined) { - bodyParams["TrustId"] = input.TrustId; - } - return bodyParams; + return { + ...(input.TrustId !== undefined && { TrustId: input.TrustId }) + }; }; const deserializeAws_json1_1AcceptSharedDirectoryResult = ( diff --git a/clients/client-dlm/protocols/Aws_restJson1_1.ts b/clients/client-dlm/protocols/Aws_restJson1_1.ts index 2e288d23d593..c7da5d4fbbaf 100644 --- a/clients/client-dlm/protocols/Aws_restJson1_1.ts +++ b/clients/client-dlm/protocols/Aws_restJson1_1.ts @@ -1181,62 +1181,47 @@ const serializeAws_restJson1_1CreateRule = ( input: CreateRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Interval !== undefined) { - bodyParams["Interval"] = input.Interval; - } - if (input.IntervalUnit !== undefined) { - bodyParams["IntervalUnit"] = input.IntervalUnit; - } - if (input.Times !== undefined) { - bodyParams["Times"] = serializeAws_restJson1_1TimesList( - input.Times, - context - ); - } - return bodyParams; + return { + ...(input.Interval !== undefined && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && { + IntervalUnit: input.IntervalUnit + }), + ...(input.Times !== undefined && { + Times: serializeAws_restJson1_1TimesList(input.Times, context) + }) + }; }; const serializeAws_restJson1_1CrossRegionCopyRetainRule = ( input: CrossRegionCopyRetainRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Interval !== undefined) { - bodyParams["Interval"] = input.Interval; - } - if (input.IntervalUnit !== undefined) { - bodyParams["IntervalUnit"] = input.IntervalUnit; - } - return bodyParams; + return { + ...(input.Interval !== undefined && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && { + IntervalUnit: input.IntervalUnit + }) + }; }; const serializeAws_restJson1_1CrossRegionCopyRule = ( input: CrossRegionCopyRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CmkArn !== undefined) { - bodyParams["CmkArn"] = input.CmkArn; - } - if (input.CopyTags !== undefined) { - bodyParams["CopyTags"] = input.CopyTags; - } - if (input.Encrypted !== undefined) { - bodyParams["Encrypted"] = input.Encrypted; - } - if (input.RetainRule !== undefined) { - bodyParams[ - "RetainRule" - ] = serializeAws_restJson1_1CrossRegionCopyRetainRule( - input.RetainRule, - context - ); - } - if (input.TargetRegion !== undefined) { - bodyParams["TargetRegion"] = input.TargetRegion; - } - return bodyParams; + return { + ...(input.CmkArn !== undefined && { CmkArn: input.CmkArn }), + ...(input.CopyTags !== undefined && { CopyTags: input.CopyTags }), + ...(input.Encrypted !== undefined && { Encrypted: input.Encrypted }), + ...(input.RetainRule !== undefined && { + RetainRule: serializeAws_restJson1_1CrossRegionCopyRetainRule( + input.RetainRule, + context + ) + }), + ...(input.TargetRegion !== undefined && { + TargetRegion: input.TargetRegion + }) + }; }; const serializeAws_restJson1_1CrossRegionCopyRules = ( @@ -1252,73 +1237,57 @@ const serializeAws_restJson1_1FastRestoreRule = ( input: FastRestoreRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZones !== undefined) { - bodyParams[ - "AvailabilityZones" - ] = serializeAws_restJson1_1AvailabilityZoneList( - input.AvailabilityZones, - context - ); - } - if (input.Count !== undefined) { - bodyParams["Count"] = input.Count; - } - if (input.Interval !== undefined) { - bodyParams["Interval"] = input.Interval; - } - if (input.IntervalUnit !== undefined) { - bodyParams["IntervalUnit"] = input.IntervalUnit; - } - return bodyParams; + return { + ...(input.AvailabilityZones !== undefined && { + AvailabilityZones: serializeAws_restJson1_1AvailabilityZoneList( + input.AvailabilityZones, + context + ) + }), + ...(input.Count !== undefined && { Count: input.Count }), + ...(input.Interval !== undefined && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && { + IntervalUnit: input.IntervalUnit + }) + }; }; const serializeAws_restJson1_1_Parameters = ( input: _Parameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludeBootVolume !== undefined) { - bodyParams["ExcludeBootVolume"] = input.ExcludeBootVolume; - } - return bodyParams; + return { + ...(input.ExcludeBootVolume !== undefined && { + ExcludeBootVolume: input.ExcludeBootVolume + }) + }; }; const serializeAws_restJson1_1PolicyDetails = ( input: PolicyDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_restJson1_1_Parameters( - input.Parameters, - context - ); - } - if (input.PolicyType !== undefined) { - bodyParams["PolicyType"] = input.PolicyType; - } - if (input.ResourceTypes !== undefined) { - bodyParams[ - "ResourceTypes" - ] = serializeAws_restJson1_1ResourceTypeValuesList( - input.ResourceTypes, - context - ); - } - if (input.Schedules !== undefined) { - bodyParams["Schedules"] = serializeAws_restJson1_1ScheduleList( - input.Schedules, - context - ); - } - if (input.TargetTags !== undefined) { - bodyParams["TargetTags"] = serializeAws_restJson1_1TargetTagList( - input.TargetTags, - context - ); - } - return bodyParams; + return { + ...(input.Parameters !== undefined && { + Parameters: serializeAws_restJson1_1_Parameters(input.Parameters, context) + }), + ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), + ...(input.ResourceTypes !== undefined && { + ResourceTypes: serializeAws_restJson1_1ResourceTypeValuesList( + input.ResourceTypes, + context + ) + }), + ...(input.Schedules !== undefined && { + Schedules: serializeAws_restJson1_1ScheduleList(input.Schedules, context) + }), + ...(input.TargetTags !== undefined && { + TargetTags: serializeAws_restJson1_1TargetTagList( + input.TargetTags, + context + ) + }) + }; }; const serializeAws_restJson1_1ResourceTypeValuesList = ( @@ -1332,69 +1301,50 @@ const serializeAws_restJson1_1RetainRule = ( input: RetainRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Count !== undefined) { - bodyParams["Count"] = input.Count; - } - if (input.Interval !== undefined) { - bodyParams["Interval"] = input.Interval; - } - if (input.IntervalUnit !== undefined) { - bodyParams["IntervalUnit"] = input.IntervalUnit; - } - return bodyParams; + return { + ...(input.Count !== undefined && { Count: input.Count }), + ...(input.Interval !== undefined && { Interval: input.Interval }), + ...(input.IntervalUnit !== undefined && { + IntervalUnit: input.IntervalUnit + }) + }; }; const serializeAws_restJson1_1Schedule = ( input: Schedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CopyTags !== undefined) { - bodyParams["CopyTags"] = input.CopyTags; - } - if (input.CreateRule !== undefined) { - bodyParams["CreateRule"] = serializeAws_restJson1_1CreateRule( - input.CreateRule, - context - ); - } - if (input.CrossRegionCopyRules !== undefined) { - bodyParams[ - "CrossRegionCopyRules" - ] = serializeAws_restJson1_1CrossRegionCopyRules( - input.CrossRegionCopyRules, - context - ); - } - if (input.FastRestoreRule !== undefined) { - bodyParams["FastRestoreRule"] = serializeAws_restJson1_1FastRestoreRule( - input.FastRestoreRule, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RetainRule !== undefined) { - bodyParams["RetainRule"] = serializeAws_restJson1_1RetainRule( - input.RetainRule, - context - ); - } - if (input.TagsToAdd !== undefined) { - bodyParams["TagsToAdd"] = serializeAws_restJson1_1TagsToAddList( - input.TagsToAdd, - context - ); - } - if (input.VariableTags !== undefined) { - bodyParams["VariableTags"] = serializeAws_restJson1_1VariableTagsList( - input.VariableTags, - context - ); - } - return bodyParams; + return { + ...(input.CopyTags !== undefined && { CopyTags: input.CopyTags }), + ...(input.CreateRule !== undefined && { + CreateRule: serializeAws_restJson1_1CreateRule(input.CreateRule, context) + }), + ...(input.CrossRegionCopyRules !== undefined && { + CrossRegionCopyRules: serializeAws_restJson1_1CrossRegionCopyRules( + input.CrossRegionCopyRules, + context + ) + }), + ...(input.FastRestoreRule !== undefined && { + FastRestoreRule: serializeAws_restJson1_1FastRestoreRule( + input.FastRestoreRule, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RetainRule !== undefined && { + RetainRule: serializeAws_restJson1_1RetainRule(input.RetainRule, context) + }), + ...(input.TagsToAdd !== undefined && { + TagsToAdd: serializeAws_restJson1_1TagsToAddList(input.TagsToAdd, context) + }), + ...(input.VariableTags !== undefined && { + VariableTags: serializeAws_restJson1_1VariableTagsList( + input.VariableTags, + context + ) + }) + }; }; const serializeAws_restJson1_1ScheduleList = ( @@ -1408,14 +1358,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagMap = ( diff --git a/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts b/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts index a27db03e86c8..04888bef4539 100644 --- a/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb-streams/protocols/Aws_json1_0.ts @@ -529,68 +529,54 @@ const serializeAws_json1_0DescribeStreamInput = ( input: DescribeStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartShardId !== undefined) { - bodyParams["ExclusiveStartShardId"] = input.ExclusiveStartShardId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.StreamArn !== undefined) { - bodyParams["StreamArn"] = input.StreamArn; - } - return bodyParams; + return { + ...(input.ExclusiveStartShardId !== undefined && { + ExclusiveStartShardId: input.ExclusiveStartShardId + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.StreamArn !== undefined && { StreamArn: input.StreamArn }) + }; }; const serializeAws_json1_0GetRecordsInput = ( input: GetRecordsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.ShardIterator !== undefined) { - bodyParams["ShardIterator"] = input.ShardIterator; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.ShardIterator !== undefined && { + ShardIterator: input.ShardIterator + }) + }; }; const serializeAws_json1_0GetShardIteratorInput = ( input: GetShardIteratorInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SequenceNumber !== undefined) { - bodyParams["SequenceNumber"] = input.SequenceNumber; - } - if (input.ShardId !== undefined) { - bodyParams["ShardId"] = input.ShardId; - } - if (input.ShardIteratorType !== undefined) { - bodyParams["ShardIteratorType"] = input.ShardIteratorType; - } - if (input.StreamArn !== undefined) { - bodyParams["StreamArn"] = input.StreamArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0ListStreamsInput = ( input: ListStreamsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartStreamArn !== undefined) { - bodyParams["ExclusiveStartStreamArn"] = input.ExclusiveStartStreamArn; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.ExclusiveStartStreamArn !== undefined && { + ExclusiveStartStreamArn: input.ExclusiveStartStreamArn + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const deserializeAws_json1_0DescribeStreamOutput = ( diff --git a/clients/client-dynamodb/protocols/Aws_json1_0.ts b/clients/client-dynamodb/protocols/Aws_json1_0.ts index 69e579f4457c..fa1c2a45156b 100644 --- a/clients/client-dynamodb/protocols/Aws_json1_0.ts +++ b/clients/client-dynamodb/protocols/Aws_json1_0.ts @@ -5504,22 +5504,21 @@ const serializeAws_json1_0DescribeEndpointsRequest = ( input: DescribeEndpointsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_0AttributeDefinition = ( input: AttributeDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.AttributeType !== undefined) { - bodyParams["AttributeType"] = input.AttributeType; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.AttributeType !== undefined && { + AttributeType: input.AttributeType + }) + }; }; const serializeAws_json1_0AttributeDefinitions = ( @@ -5552,47 +5551,28 @@ const serializeAws_json1_0AttributeValue = ( input: AttributeValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.B !== undefined) { - bodyParams["B"] = context.base64Encoder(input.B); - } - if (input.BOOL !== undefined) { - bodyParams["BOOL"] = input.BOOL; - } - if (input.BS !== undefined) { - bodyParams["BS"] = serializeAws_json1_0BinarySetAttributeValue( - input.BS, - context - ); - } - if (input.L !== undefined) { - bodyParams["L"] = serializeAws_json1_0ListAttributeValue(input.L, context); - } - if (input.M !== undefined) { - bodyParams["M"] = serializeAws_json1_0MapAttributeValue(input.M, context); - } - if (input.N !== undefined) { - bodyParams["N"] = input.N; - } - if (input.NS !== undefined) { - bodyParams["NS"] = serializeAws_json1_0NumberSetAttributeValue( - input.NS, - context - ); - } - if (input.NULL !== undefined) { - bodyParams["NULL"] = input.NULL; - } - if (input.S !== undefined) { - bodyParams["S"] = input.S; - } - if (input.SS !== undefined) { - bodyParams["SS"] = serializeAws_json1_0StringSetAttributeValue( - input.SS, - context - ); - } - return bodyParams; + return { + ...(input.B !== undefined && { B: context.base64Encoder(input.B) }), + ...(input.BOOL !== undefined && { BOOL: input.BOOL }), + ...(input.BS !== undefined && { + BS: serializeAws_json1_0BinarySetAttributeValue(input.BS, context) + }), + ...(input.L !== undefined && { + L: serializeAws_json1_0ListAttributeValue(input.L, context) + }), + ...(input.M !== undefined && { + M: serializeAws_json1_0MapAttributeValue(input.M, context) + }), + ...(input.N !== undefined && { N: input.N }), + ...(input.NS !== undefined && { + NS: serializeAws_json1_0NumberSetAttributeValue(input.NS, context) + }), + ...(input.NULL !== undefined && { NULL: input.NULL }), + ...(input.S !== undefined && { S: input.S }), + ...(input.SS !== undefined && { + SS: serializeAws_json1_0StringSetAttributeValue(input.SS, context) + }) + }; }; const serializeAws_json1_0AttributeValueList = ( @@ -5606,101 +5586,88 @@ const serializeAws_json1_0AttributeValueUpdate = ( input: AttributeValueUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Value !== undefined) { - bodyParams["Value"] = serializeAws_json1_0AttributeValue( - input.Value, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Value !== undefined && { + Value: serializeAws_json1_0AttributeValue(input.Value, context) + }) + }; }; const serializeAws_json1_0AutoScalingPolicyUpdate = ( input: AutoScalingPolicyUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - if (input.TargetTrackingScalingPolicyConfiguration !== undefined) { - bodyParams[ - "TargetTrackingScalingPolicyConfiguration" - ] = serializeAws_json1_0AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( - input.TargetTrackingScalingPolicyConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }), + ...(input.TargetTrackingScalingPolicyConfiguration !== undefined && { + TargetTrackingScalingPolicyConfiguration: serializeAws_json1_0AutoScalingTargetTrackingScalingPolicyConfigurationUpdate( + input.TargetTrackingScalingPolicyConfiguration, + context + ) + }) + }; }; const serializeAws_json1_0AutoScalingSettingsUpdate = ( input: AutoScalingSettingsUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoScalingDisabled !== undefined) { - bodyParams["AutoScalingDisabled"] = input.AutoScalingDisabled; - } - if (input.AutoScalingRoleArn !== undefined) { - bodyParams["AutoScalingRoleArn"] = input.AutoScalingRoleArn; - } - if (input.MaximumUnits !== undefined) { - bodyParams["MaximumUnits"] = input.MaximumUnits; - } - if (input.MinimumUnits !== undefined) { - bodyParams["MinimumUnits"] = input.MinimumUnits; - } - if (input.ScalingPolicyUpdate !== undefined) { - bodyParams[ - "ScalingPolicyUpdate" - ] = serializeAws_json1_0AutoScalingPolicyUpdate( - input.ScalingPolicyUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0AutoScalingTargetTrackingScalingPolicyConfigurationUpdate = ( input: AutoScalingTargetTrackingScalingPolicyConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisableScaleIn !== undefined) { - bodyParams["DisableScaleIn"] = input.DisableScaleIn; - } - if (input.ScaleInCooldown !== undefined) { - bodyParams["ScaleInCooldown"] = input.ScaleInCooldown; - } - if (input.ScaleOutCooldown !== undefined) { - bodyParams["ScaleOutCooldown"] = input.ScaleOutCooldown; - } - if (input.TargetValue !== undefined) { - bodyParams["TargetValue"] = input.TargetValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0BatchGetItemInput = ( input: BatchGetItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RequestItems !== undefined) { - bodyParams["RequestItems"] = serializeAws_json1_0BatchGetRequestMap( - input.RequestItems, - context - ); - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - return bodyParams; + return { + ...(input.RequestItems !== undefined && { + RequestItems: serializeAws_json1_0BatchGetRequestMap( + input.RequestItems, + context + ) + }), + ...(input.ReturnConsumedCapacity !== undefined && { + ReturnConsumedCapacity: input.ReturnConsumedCapacity + }) + }; }; const serializeAws_json1_0BatchGetRequestMap = ( @@ -5717,21 +5684,20 @@ const serializeAws_json1_0BatchWriteItemInput = ( input: BatchWriteItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RequestItems !== undefined) { - bodyParams["RequestItems"] = serializeAws_json1_0BatchWriteItemRequestMap( - input.RequestItems, - context - ); - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ReturnItemCollectionMetrics !== undefined) { - bodyParams["ReturnItemCollectionMetrics"] = - input.ReturnItemCollectionMetrics; - } - return bodyParams; + return { + ...(input.RequestItems !== undefined && { + RequestItems: serializeAws_json1_0BatchWriteItemRequestMap( + input.RequestItems, + context + ) + }), + ...(input.ReturnConsumedCapacity !== undefined && { + ReturnConsumedCapacity: input.ReturnConsumedCapacity + }), + ...(input.ReturnItemCollectionMetrics !== undefined && { + ReturnItemCollectionMetrics: input.ReturnItemCollectionMetrics + }) + }; }; const serializeAws_json1_0BatchWriteItemRequestMap = ( @@ -5755,478 +5721,397 @@ const serializeAws_json1_0Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeValueList !== undefined) { - bodyParams["AttributeValueList"] = serializeAws_json1_0AttributeValueList( - input.AttributeValueList, - context - ); - } - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - return bodyParams; + return { + ...(input.AttributeValueList !== undefined && { + AttributeValueList: serializeAws_json1_0AttributeValueList( + input.AttributeValueList, + context + ) + }), + ...(input.ComparisonOperator !== undefined && { + ComparisonOperator: input.ComparisonOperator + }) + }; }; const serializeAws_json1_0ConditionCheck = ( input: ConditionCheck, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ReturnValuesOnConditionCheckFailure !== undefined) { - bodyParams["ReturnValuesOnConditionCheckFailure"] = - input.ReturnValuesOnConditionCheckFailure; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0CreateBackupInput = ( input: CreateBackupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupName !== undefined) { - bodyParams["BackupName"] = input.BackupName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.BackupName !== undefined && { BackupName: input.BackupName }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0CreateGlobalSecondaryIndexAction = ( input: CreateGlobalSecondaryIndexAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.KeySchema !== undefined) { - bodyParams["KeySchema"] = serializeAws_json1_0KeySchema( - input.KeySchema, - context - ); - } - if (input.Projection !== undefined) { - bodyParams["Projection"] = serializeAws_json1_0Projection( - input.Projection, - context - ); - } - if (input.ProvisionedThroughput !== undefined) { - bodyParams[ - "ProvisionedThroughput" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughput, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0CreateGlobalTableInput = ( input: CreateGlobalTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalTableName !== undefined) { - bodyParams["GlobalTableName"] = input.GlobalTableName; - } - if (input.ReplicationGroup !== undefined) { - bodyParams["ReplicationGroup"] = serializeAws_json1_0ReplicaList( - input.ReplicationGroup, - context - ); - } - return bodyParams; + return { + ...(input.GlobalTableName !== undefined && { + GlobalTableName: input.GlobalTableName + }), + ...(input.ReplicationGroup !== undefined && { + ReplicationGroup: serializeAws_json1_0ReplicaList( + input.ReplicationGroup, + context + ) + }) + }; }; const serializeAws_json1_0CreateReplicaAction = ( input: CreateReplicaAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + return { + ...(input.RegionName !== undefined && { RegionName: input.RegionName }) + }; }; const serializeAws_json1_0CreateReplicationGroupMemberAction = ( input: CreateReplicationGroupMemberAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalSecondaryIndexes !== undefined) { - bodyParams[ - "GlobalSecondaryIndexes" - ] = serializeAws_json1_0ReplicaGlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ); - } - if (input.KMSMasterKeyId !== undefined) { - bodyParams["KMSMasterKeyId"] = input.KMSMasterKeyId; - } - if (input.ProvisionedThroughputOverride !== undefined) { - bodyParams[ - "ProvisionedThroughputOverride" - ] = serializeAws_json1_0ProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ); - } - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0CreateTableInput = ( input: CreateTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeDefinitions !== undefined) { - bodyParams[ - "AttributeDefinitions" - ] = serializeAws_json1_0AttributeDefinitions( - input.AttributeDefinitions, - context - ); - } - if (input.BillingMode !== undefined) { - bodyParams["BillingMode"] = input.BillingMode; - } - if (input.GlobalSecondaryIndexes !== undefined) { - bodyParams[ - "GlobalSecondaryIndexes" - ] = serializeAws_json1_0GlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ); - } - if (input.KeySchema !== undefined) { - bodyParams["KeySchema"] = serializeAws_json1_0KeySchema( - input.KeySchema, - context - ); - } - if (input.LocalSecondaryIndexes !== undefined) { - bodyParams[ - "LocalSecondaryIndexes" - ] = serializeAws_json1_0LocalSecondaryIndexList( - input.LocalSecondaryIndexes, - context - ); - } - if (input.ProvisionedThroughput !== undefined) { - bodyParams[ - "ProvisionedThroughput" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughput, - context - ); - } - if (input.SSESpecification !== undefined) { - bodyParams["SSESpecification"] = serializeAws_json1_0SSESpecification( - input.SSESpecification, - context - ); - } - if (input.StreamSpecification !== undefined) { - bodyParams["StreamSpecification"] = serializeAws_json1_0StreamSpecification( - input.StreamSpecification, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_0TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_0Delete = ( input: Delete, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ReturnValuesOnConditionCheckFailure !== undefined) { - bodyParams["ReturnValuesOnConditionCheckFailure"] = - input.ReturnValuesOnConditionCheckFailure; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0DeleteBackupInput = ( input: DeleteBackupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupArn !== undefined) { - bodyParams["BackupArn"] = input.BackupArn; - } - return bodyParams; + return { + ...(input.BackupArn !== undefined && { BackupArn: input.BackupArn }) + }; }; const serializeAws_json1_0DeleteGlobalSecondaryIndexAction = ( input: DeleteGlobalSecondaryIndexAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }) + }; }; const serializeAws_json1_0DeleteItemInput = ( input: DeleteItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ConditionalOperator !== undefined) { - bodyParams["ConditionalOperator"] = input.ConditionalOperator; - } - if (input.Expected !== undefined) { - bodyParams["Expected"] = serializeAws_json1_0ExpectedAttributeMap( - input.Expected, - context - ); - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ReturnItemCollectionMetrics !== undefined) { - bodyParams["ReturnItemCollectionMetrics"] = - input.ReturnItemCollectionMetrics; - } - if (input.ReturnValues !== undefined) { - bodyParams["ReturnValues"] = input.ReturnValues; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0DeleteReplicaAction = ( input: DeleteReplicaAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + return { + ...(input.RegionName !== undefined && { RegionName: input.RegionName }) + }; }; const serializeAws_json1_0DeleteReplicationGroupMemberAction = ( input: DeleteReplicationGroupMemberAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + return { + ...(input.RegionName !== undefined && { RegionName: input.RegionName }) + }; }; const serializeAws_json1_0DeleteRequest = ( input: DeleteRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - return bodyParams; + return { + ...(input.Key !== undefined && { + Key: serializeAws_json1_0Key(input.Key, context) + }) + }; }; const serializeAws_json1_0DeleteTableInput = ( input: DeleteTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0DescribeBackupInput = ( input: DescribeBackupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupArn !== undefined) { - bodyParams["BackupArn"] = input.BackupArn; - } - return bodyParams; + return { + ...(input.BackupArn !== undefined && { BackupArn: input.BackupArn }) + }; }; const serializeAws_json1_0DescribeContinuousBackupsInput = ( input: DescribeContinuousBackupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0DescribeContributorInsightsInput = ( input: DescribeContributorInsightsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0DescribeGlobalTableInput = ( input: DescribeGlobalTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalTableName !== undefined) { - bodyParams["GlobalTableName"] = input.GlobalTableName; - } - return bodyParams; + return { + ...(input.GlobalTableName !== undefined && { + GlobalTableName: input.GlobalTableName + }) + }; }; const serializeAws_json1_0DescribeGlobalTableSettingsInput = ( input: DescribeGlobalTableSettingsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalTableName !== undefined) { - bodyParams["GlobalTableName"] = input.GlobalTableName; - } - return bodyParams; + return { + ...(input.GlobalTableName !== undefined && { + GlobalTableName: input.GlobalTableName + }) + }; }; const serializeAws_json1_0DescribeLimitsInput = ( input: DescribeLimitsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_0DescribeTableInput = ( input: DescribeTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0DescribeTableReplicaAutoScalingInput = ( input: DescribeTableReplicaAutoScalingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0DescribeTimeToLiveInput = ( input: DescribeTimeToLiveInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0ExpectedAttributeMap = ( @@ -6243,26 +6128,21 @@ const serializeAws_json1_0ExpectedAttributeValue = ( input: ExpectedAttributeValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeValueList !== undefined) { - bodyParams["AttributeValueList"] = serializeAws_json1_0AttributeValueList( - input.AttributeValueList, - context - ); - } - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.Exists !== undefined) { - bodyParams["Exists"] = input.Exists; - } - if (input.Value !== undefined) { - bodyParams["Value"] = serializeAws_json1_0AttributeValue( - input.Value, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_0ExpressionAttributeNameMap = ( @@ -6296,112 +6176,90 @@ const serializeAws_json1_0FilterConditionMap = ( }; const serializeAws_json1_0Get = (input: Get, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ProjectionExpression !== undefined) { - bodyParams["ProjectionExpression"] = input.ProjectionExpression; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0GetItemInput = ( input: GetItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributesToGet !== undefined) { - bodyParams["AttributesToGet"] = serializeAws_json1_0AttributeNameList( - input.AttributesToGet, - context - ); - } - if (input.ConsistentRead !== undefined) { - bodyParams["ConsistentRead"] = input.ConsistentRead; - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ProjectionExpression !== undefined) { - bodyParams["ProjectionExpression"] = input.ProjectionExpression; - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0GlobalSecondaryIndex = ( input: GlobalSecondaryIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.KeySchema !== undefined) { - bodyParams["KeySchema"] = serializeAws_json1_0KeySchema( - input.KeySchema, - context - ); - } - if (input.Projection !== undefined) { - bodyParams["Projection"] = serializeAws_json1_0Projection( - input.Projection, - context - ); - } - if (input.ProvisionedThroughput !== undefined) { - bodyParams[ - "ProvisionedThroughput" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughput, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdate = ( input: GlobalSecondaryIndexAutoScalingUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined) { - bodyParams[ - "ProvisionedWriteCapacityAutoScalingUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedWriteCapacityAutoScalingUpdate, - context - ); - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined && { + ProvisionedWriteCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingUpdate, + context + ) + }) + }; }; const serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdateList = ( @@ -6426,26 +6284,26 @@ const serializeAws_json1_0GlobalSecondaryIndexUpdate = ( input: GlobalSecondaryIndexUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Create !== undefined) { - bodyParams["Create"] = serializeAws_json1_0CreateGlobalSecondaryIndexAction( - input.Create, - context - ); - } - if (input.Delete !== undefined) { - bodyParams["Delete"] = serializeAws_json1_0DeleteGlobalSecondaryIndexAction( - input.Delete, - context - ); - } - if (input.Update !== undefined) { - bodyParams["Update"] = serializeAws_json1_0UpdateGlobalSecondaryIndexAction( - input.Update, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0GlobalSecondaryIndexUpdateList = ( @@ -6461,23 +6319,19 @@ const serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdate = ( input: GlobalTableGlobalSecondaryIndexSettingsUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.ProvisionedWriteCapacityAutoScalingSettingsUpdate !== undefined) { - bodyParams[ - "ProvisionedWriteCapacityAutoScalingSettingsUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedWriteCapacityAutoScalingSettingsUpdate, - context - ); - } - if (input.ProvisionedWriteCapacityUnits !== undefined) { - bodyParams["ProvisionedWriteCapacityUnits"] = - input.ProvisionedWriteCapacityUnits; - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.ProvisionedWriteCapacityAutoScalingSettingsUpdate !== + undefined && { + ProvisionedWriteCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedWriteCapacityAutoScalingSettingsUpdate, + context + ) + }), + ...(input.ProvisionedWriteCapacityUnits !== undefined && { + ProvisionedWriteCapacityUnits: input.ProvisionedWriteCapacityUnits + }) + }; }; const serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdateList = ( @@ -6532,45 +6386,41 @@ const serializeAws_json1_0KeySchemaElement = ( input: KeySchemaElement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.KeyType !== undefined) { - bodyParams["KeyType"] = input.KeyType; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.KeyType !== undefined && { KeyType: input.KeyType }) + }; }; const serializeAws_json1_0KeysAndAttributes = ( input: KeysAndAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributesToGet !== undefined) { - bodyParams["AttributesToGet"] = serializeAws_json1_0AttributeNameList( - input.AttributesToGet, - context - ); - } - if (input.ConsistentRead !== undefined) { - bodyParams["ConsistentRead"] = input.ConsistentRead; - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.Keys !== undefined) { - bodyParams["Keys"] = serializeAws_json1_0KeyList(input.Keys, context); - } - if (input.ProjectionExpression !== undefined) { - bodyParams["ProjectionExpression"] = input.ProjectionExpression; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ListAttributeValue = ( @@ -6584,116 +6434,85 @@ const serializeAws_json1_0ListBackupsInput = ( input: ListBackupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupType !== undefined) { - bodyParams["BackupType"] = input.BackupType; - } - if (input.ExclusiveStartBackupArn !== undefined) { - bodyParams["ExclusiveStartBackupArn"] = input.ExclusiveStartBackupArn; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.TimeRangeLowerBound !== undefined) { - bodyParams["TimeRangeLowerBound"] = Math.round( - input.TimeRangeLowerBound.getTime() / 1000 - ); - } - if (input.TimeRangeUpperBound !== undefined) { - bodyParams["TimeRangeUpperBound"] = Math.round( - input.TimeRangeUpperBound.getTime() / 1000 - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0ListContributorInsightsInput = ( input: ListContributorInsightsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0ListGlobalTablesInput = ( input: ListGlobalTablesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartGlobalTableName !== undefined) { - bodyParams["ExclusiveStartGlobalTableName"] = - input.ExclusiveStartGlobalTableName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + return { + ...(input.ExclusiveStartGlobalTableName !== undefined && { + ExclusiveStartGlobalTableName: input.ExclusiveStartGlobalTableName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.RegionName !== undefined && { RegionName: input.RegionName }) + }; }; const serializeAws_json1_0ListTablesInput = ( input: ListTablesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartTableName !== undefined) { - bodyParams["ExclusiveStartTableName"] = input.ExclusiveStartTableName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.ExclusiveStartTableName !== undefined && { + ExclusiveStartTableName: input.ExclusiveStartTableName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_0ListTagsOfResourceInput = ( input: ListTagsOfResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_0LocalSecondaryIndex = ( input: LocalSecondaryIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.KeySchema !== undefined) { - bodyParams["KeySchema"] = serializeAws_json1_0KeySchema( - input.KeySchema, - context - ); - } - if (input.Projection !== undefined) { - bodyParams["Projection"] = serializeAws_json1_0Projection( - input.Projection, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_0LocalSecondaryIndexList = ( @@ -6733,147 +6552,126 @@ const serializeAws_json1_0PointInTimeRecoverySpecification = ( input: PointInTimeRecoverySpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PointInTimeRecoveryEnabled !== undefined) { - bodyParams["PointInTimeRecoveryEnabled"] = input.PointInTimeRecoveryEnabled; - } - return bodyParams; + return { + ...(input.PointInTimeRecoveryEnabled !== undefined && { + PointInTimeRecoveryEnabled: input.PointInTimeRecoveryEnabled + }) + }; }; const serializeAws_json1_0Projection = ( input: Projection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NonKeyAttributes !== undefined) { - bodyParams[ - "NonKeyAttributes" - ] = serializeAws_json1_0NonKeyAttributeNameList( - input.NonKeyAttributes, - context - ); - } - if (input.ProjectionType !== undefined) { - bodyParams["ProjectionType"] = input.ProjectionType; - } - return bodyParams; + return { + ...(input.NonKeyAttributes !== undefined && { + NonKeyAttributes: serializeAws_json1_0NonKeyAttributeNameList( + input.NonKeyAttributes, + context + ) + }), + ...(input.ProjectionType !== undefined && { + ProjectionType: input.ProjectionType + }) + }; }; const serializeAws_json1_0ProvisionedThroughput = ( input: ProvisionedThroughput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReadCapacityUnits !== undefined) { - bodyParams["ReadCapacityUnits"] = input.ReadCapacityUnits; - } - if (input.WriteCapacityUnits !== undefined) { - bodyParams["WriteCapacityUnits"] = input.WriteCapacityUnits; - } - return bodyParams; + return { + ...(input.ReadCapacityUnits !== undefined && { + ReadCapacityUnits: input.ReadCapacityUnits + }), + ...(input.WriteCapacityUnits !== undefined && { + WriteCapacityUnits: input.WriteCapacityUnits + }) + }; }; const serializeAws_json1_0ProvisionedThroughputOverride = ( input: ProvisionedThroughputOverride, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReadCapacityUnits !== undefined) { - bodyParams["ReadCapacityUnits"] = input.ReadCapacityUnits; - } - return bodyParams; + return { + ...(input.ReadCapacityUnits !== undefined && { + ReadCapacityUnits: input.ReadCapacityUnits + }) + }; }; const serializeAws_json1_0Put = (input: Put, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Item !== undefined) { - bodyParams["Item"] = serializeAws_json1_0PutItemInputAttributeMap( - input.Item, - context - ); - } - if (input.ReturnValuesOnConditionCheckFailure !== undefined) { - bodyParams["ReturnValuesOnConditionCheckFailure"] = - input.ReturnValuesOnConditionCheckFailure; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0PutItemInput = ( input: PutItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ConditionalOperator !== undefined) { - bodyParams["ConditionalOperator"] = input.ConditionalOperator; - } - if (input.Expected !== undefined) { - bodyParams["Expected"] = serializeAws_json1_0ExpectedAttributeMap( - input.Expected, - context - ); - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Item !== undefined) { - bodyParams["Item"] = serializeAws_json1_0PutItemInputAttributeMap( - input.Item, - context - ); - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ReturnItemCollectionMetrics !== undefined) { - bodyParams["ReturnItemCollectionMetrics"] = - input.ReturnItemCollectionMetrics; - } - if (input.ReturnValues !== undefined) { - bodyParams["ReturnValues"] = input.ReturnValues; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0PutItemInputAttributeMap = ( @@ -6890,133 +6688,110 @@ const serializeAws_json1_0PutRequest = ( input: PutRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Item !== undefined) { - bodyParams["Item"] = serializeAws_json1_0PutItemInputAttributeMap( - input.Item, - context - ); - } - return bodyParams; + return { + ...(input.Item !== undefined && { + Item: serializeAws_json1_0PutItemInputAttributeMap(input.Item, context) + }) + }; }; const serializeAws_json1_0QueryInput = ( input: QueryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributesToGet !== undefined) { - bodyParams["AttributesToGet"] = serializeAws_json1_0AttributeNameList( - input.AttributesToGet, - context - ); - } - if (input.ConditionalOperator !== undefined) { - bodyParams["ConditionalOperator"] = input.ConditionalOperator; - } - if (input.ConsistentRead !== undefined) { - bodyParams["ConsistentRead"] = input.ConsistentRead; - } - if (input.ExclusiveStartKey !== undefined) { - bodyParams["ExclusiveStartKey"] = serializeAws_json1_0Key( - input.ExclusiveStartKey, - context - ); - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.FilterExpression !== undefined) { - bodyParams["FilterExpression"] = input.FilterExpression; - } - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.KeyConditionExpression !== undefined) { - bodyParams["KeyConditionExpression"] = input.KeyConditionExpression; - } - if (input.KeyConditions !== undefined) { - bodyParams["KeyConditions"] = serializeAws_json1_0KeyConditions( - input.KeyConditions, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.ProjectionExpression !== undefined) { - bodyParams["ProjectionExpression"] = input.ProjectionExpression; - } - if (input.QueryFilter !== undefined) { - bodyParams["QueryFilter"] = serializeAws_json1_0FilterConditionMap( - input.QueryFilter, - context - ); - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ScanIndexForward !== undefined) { - bodyParams["ScanIndexForward"] = input.ScanIndexForward; - } - if (input.Select !== undefined) { - bodyParams["Select"] = input.Select; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0Replica = ( input: Replica, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + return { + ...(input.RegionName !== undefined && { RegionName: input.RegionName }) + }; }; const serializeAws_json1_0ReplicaAutoScalingUpdate = ( input: ReplicaAutoScalingUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - if (input.ReplicaGlobalSecondaryIndexUpdates !== undefined) { - bodyParams[ - "ReplicaGlobalSecondaryIndexUpdates" - ] = serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdateList( - input.ReplicaGlobalSecondaryIndexUpdates, - context - ); - } - if (input.ReplicaProvisionedReadCapacityAutoScalingUpdate !== undefined) { - bodyParams[ - "ReplicaProvisionedReadCapacityAutoScalingUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ReplicaProvisionedReadCapacityAutoScalingUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0ReplicaAutoScalingUpdateList = ( @@ -7032,38 +6807,30 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndex = ( input: ReplicaGlobalSecondaryIndex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.ProvisionedThroughputOverride !== undefined) { - bodyParams[ - "ProvisionedThroughputOverride" - ] = serializeAws_json1_0ProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ); - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.ProvisionedThroughputOverride !== undefined && { + ProvisionedThroughputOverride: serializeAws_json1_0ProvisionedThroughputOverride( + input.ProvisionedThroughputOverride, + context + ) + }) + }; }; const serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdate = ( input: ReplicaGlobalSecondaryIndexAutoScalingUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.ProvisionedReadCapacityAutoScalingUpdate !== undefined) { - bodyParams[ - "ProvisionedReadCapacityAutoScalingUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedReadCapacityAutoScalingUpdate, - context - ); - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.ProvisionedReadCapacityAutoScalingUpdate !== undefined && { + ProvisionedReadCapacityAutoScalingUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedReadCapacityAutoScalingUpdate, + context + ) + }) + }; }; const serializeAws_json1_0ReplicaGlobalSecondaryIndexAutoScalingUpdateList = ( @@ -7091,23 +6858,19 @@ const serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdate = ( input: ReplicaGlobalSecondaryIndexSettingsUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.ProvisionedReadCapacityAutoScalingSettingsUpdate !== undefined) { - bodyParams[ - "ProvisionedReadCapacityAutoScalingSettingsUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedReadCapacityAutoScalingSettingsUpdate, - context - ); - } - if (input.ProvisionedReadCapacityUnits !== undefined) { - bodyParams["ProvisionedReadCapacityUnits"] = - input.ProvisionedReadCapacityUnits; - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.ProvisionedReadCapacityAutoScalingSettingsUpdate !== + undefined && { + ProvisionedReadCapacityAutoScalingSettingsUpdate: serializeAws_json1_0AutoScalingSettingsUpdate( + input.ProvisionedReadCapacityAutoScalingSettingsUpdate, + context + ) + }), + ...(input.ProvisionedReadCapacityUnits !== undefined && { + ProvisionedReadCapacityUnits: input.ProvisionedReadCapacityUnits + }) + }; }; const serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdateList = ( @@ -7133,33 +6896,26 @@ const serializeAws_json1_0ReplicaSettingsUpdate = ( input: ReplicaSettingsUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - if (input.ReplicaGlobalSecondaryIndexSettingsUpdate !== undefined) { - bodyParams[ - "ReplicaGlobalSecondaryIndexSettingsUpdate" - ] = serializeAws_json1_0ReplicaGlobalSecondaryIndexSettingsUpdateList( - input.ReplicaGlobalSecondaryIndexSettingsUpdate, - context - ); - } - if ( - input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate !== undefined - ) { - bodyParams[ - "ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ReplicaProvisionedReadCapacityAutoScalingSettingsUpdate, - context - ); - } - if (input.ReplicaProvisionedReadCapacityUnits !== undefined) { - bodyParams["ReplicaProvisionedReadCapacityUnits"] = - input.ReplicaProvisionedReadCapacityUnits; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ReplicaSettingsUpdateList = ( @@ -7175,20 +6931,14 @@ const serializeAws_json1_0ReplicaUpdate = ( input: ReplicaUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Create !== undefined) { - bodyParams["Create"] = serializeAws_json1_0CreateReplicaAction( - input.Create, - context - ); - } - if (input.Delete !== undefined) { - bodyParams["Delete"] = serializeAws_json1_0DeleteReplicaAction( - input.Delete, - context - ); - } - return bodyParams; + return { + ...(input.Create !== undefined && { + Create: serializeAws_json1_0CreateReplicaAction(input.Create, context) + }), + ...(input.Delete !== undefined && { + Delete: serializeAws_json1_0DeleteReplicaAction(input.Delete, context) + }) + }; }; const serializeAws_json1_0ReplicaUpdateList = ( @@ -7202,32 +6952,26 @@ const serializeAws_json1_0ReplicationGroupUpdate = ( input: ReplicationGroupUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Create !== undefined) { - bodyParams[ - "Create" - ] = serializeAws_json1_0CreateReplicationGroupMemberAction( - input.Create, - context - ); - } - if (input.Delete !== undefined) { - bodyParams[ - "Delete" - ] = serializeAws_json1_0DeleteReplicationGroupMemberAction( - input.Delete, - context - ); - } - if (input.Update !== undefined) { - bodyParams[ - "Update" - ] = serializeAws_json1_0UpdateReplicationGroupMemberAction( - input.Update, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0ReplicationGroupUpdateList = ( @@ -7243,196 +6987,162 @@ const serializeAws_json1_0RestoreTableFromBackupInput = ( input: RestoreTableFromBackupInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupArn !== undefined) { - bodyParams["BackupArn"] = input.BackupArn; - } - if (input.BillingModeOverride !== undefined) { - bodyParams["BillingModeOverride"] = input.BillingModeOverride; - } - if (input.GlobalSecondaryIndexOverride !== undefined) { - bodyParams[ - "GlobalSecondaryIndexOverride" - ] = serializeAws_json1_0GlobalSecondaryIndexList( - input.GlobalSecondaryIndexOverride, - context - ); - } - if (input.LocalSecondaryIndexOverride !== undefined) { - bodyParams[ - "LocalSecondaryIndexOverride" - ] = serializeAws_json1_0LocalSecondaryIndexList( - input.LocalSecondaryIndexOverride, - context - ); - } - if (input.ProvisionedThroughputOverride !== undefined) { - bodyParams[ - "ProvisionedThroughputOverride" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughputOverride, - context - ); - } - if (input.TargetTableName !== undefined) { - bodyParams["TargetTableName"] = input.TargetTableName; - } - return bodyParams; + 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.TargetTableName !== undefined && { + TargetTableName: input.TargetTableName + }) + }; }; const serializeAws_json1_0RestoreTableToPointInTimeInput = ( input: RestoreTableToPointInTimeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BillingModeOverride !== undefined) { - bodyParams["BillingModeOverride"] = input.BillingModeOverride; - } - if (input.GlobalSecondaryIndexOverride !== undefined) { - bodyParams[ - "GlobalSecondaryIndexOverride" - ] = serializeAws_json1_0GlobalSecondaryIndexList( - input.GlobalSecondaryIndexOverride, - context - ); - } - if (input.LocalSecondaryIndexOverride !== undefined) { - bodyParams[ - "LocalSecondaryIndexOverride" - ] = serializeAws_json1_0LocalSecondaryIndexList( - input.LocalSecondaryIndexOverride, - context - ); - } - if (input.ProvisionedThroughputOverride !== undefined) { - bodyParams[ - "ProvisionedThroughputOverride" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughputOverride, - context - ); - } - if (input.RestoreDateTime !== undefined) { - bodyParams["RestoreDateTime"] = Math.round( - input.RestoreDateTime.getTime() / 1000 - ); - } - if (input.SourceTableName !== undefined) { - bodyParams["SourceTableName"] = input.SourceTableName; - } - if (input.TargetTableName !== undefined) { - bodyParams["TargetTableName"] = input.TargetTableName; - } - if (input.UseLatestRestorableTime !== undefined) { - bodyParams["UseLatestRestorableTime"] = input.UseLatestRestorableTime; - } - return bodyParams; + 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.SourceTableName !== undefined && { + SourceTableName: input.SourceTableName + }), + ...(input.TargetTableName !== undefined && { + TargetTableName: input.TargetTableName + }), + ...(input.UseLatestRestorableTime !== undefined && { + UseLatestRestorableTime: input.UseLatestRestorableTime + }) + }; }; const serializeAws_json1_0SSESpecification = ( input: SSESpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.KMSMasterKeyId !== undefined) { - bodyParams["KMSMasterKeyId"] = input.KMSMasterKeyId; - } - if (input.SSEType !== undefined) { - bodyParams["SSEType"] = input.SSEType; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.KMSMasterKeyId !== undefined && { + KMSMasterKeyId: input.KMSMasterKeyId + }), + ...(input.SSEType !== undefined && { SSEType: input.SSEType }) + }; }; const serializeAws_json1_0ScanInput = ( input: ScanInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributesToGet !== undefined) { - bodyParams["AttributesToGet"] = serializeAws_json1_0AttributeNameList( - input.AttributesToGet, - context - ); - } - if (input.ConditionalOperator !== undefined) { - bodyParams["ConditionalOperator"] = input.ConditionalOperator; - } - if (input.ConsistentRead !== undefined) { - bodyParams["ConsistentRead"] = input.ConsistentRead; - } - if (input.ExclusiveStartKey !== undefined) { - bodyParams["ExclusiveStartKey"] = serializeAws_json1_0Key( - input.ExclusiveStartKey, - context - ); - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.FilterExpression !== undefined) { - bodyParams["FilterExpression"] = input.FilterExpression; - } - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.ProjectionExpression !== undefined) { - bodyParams["ProjectionExpression"] = input.ProjectionExpression; - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ScanFilter !== undefined) { - bodyParams["ScanFilter"] = serializeAws_json1_0FilterConditionMap( - input.ScanFilter, - context - ); - } - if (input.Segment !== undefined) { - bodyParams["Segment"] = input.Segment; - } - if (input.Select !== undefined) { - bodyParams["Select"] = input.Select; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.TotalSegments !== undefined) { - bodyParams["TotalSegments"] = input.TotalSegments; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0StreamSpecification = ( input: StreamSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StreamEnabled !== undefined) { - bodyParams["StreamEnabled"] = input.StreamEnabled; - } - if (input.StreamViewType !== undefined) { - bodyParams["StreamViewType"] = input.StreamViewType; - } - return bodyParams; + return { + ...(input.StreamEnabled !== undefined && { + StreamEnabled: input.StreamEnabled + }), + ...(input.StreamViewType !== undefined && { + StreamViewType: input.StreamViewType + }) + }; }; const serializeAws_json1_0StringSetAttributeValue = ( @@ -7443,14 +7153,10 @@ const serializeAws_json1_0StringSetAttributeValue = ( }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_0TagKeyList = ( @@ -7471,39 +7177,35 @@ const serializeAws_json1_0TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_0TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_0TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_0TimeToLiveSpecification = ( input: TimeToLiveSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_json1_0TransactGetItem = ( input: TransactGetItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Get !== undefined) { - bodyParams["Get"] = serializeAws_json1_0Get(input.Get, context); - } - return bodyParams; + return { + ...(input.Get !== undefined && { + Get: serializeAws_json1_0Get(input.Get, context) + }) + }; }; const serializeAws_json1_0TransactGetItemList = ( @@ -7519,40 +7221,40 @@ const serializeAws_json1_0TransactGetItemsInput = ( input: TransactGetItemsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.TransactItems !== undefined) { - bodyParams["TransactItems"] = serializeAws_json1_0TransactGetItemList( - input.TransactItems, - context - ); - } - return bodyParams; + return { + ...(input.ReturnConsumedCapacity !== undefined && { + ReturnConsumedCapacity: input.ReturnConsumedCapacity + }), + ...(input.TransactItems !== undefined && { + TransactItems: serializeAws_json1_0TransactGetItemList( + input.TransactItems, + context + ) + }) + }; }; const serializeAws_json1_0TransactWriteItem = ( input: TransactWriteItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionCheck !== undefined) { - bodyParams["ConditionCheck"] = serializeAws_json1_0ConditionCheck( - input.ConditionCheck, - context - ); - } - if (input.Delete !== undefined) { - bodyParams["Delete"] = serializeAws_json1_0Delete(input.Delete, context); - } - if (input.Put !== undefined) { - bodyParams["Put"] = serializeAws_json1_0Put(input.Put, context); - } - if (input.Update !== undefined) { - bodyParams["Update"] = serializeAws_json1_0Update(input.Update, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_0TransactWriteItemList = ( @@ -7568,424 +7270,347 @@ const serializeAws_json1_0TransactWriteItemsInput = ( input: TransactWriteItemsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ReturnItemCollectionMetrics !== undefined) { - bodyParams["ReturnItemCollectionMetrics"] = - input.ReturnItemCollectionMetrics; - } - if (input.TransactItems !== undefined) { - bodyParams["TransactItems"] = serializeAws_json1_0TransactWriteItemList( - input.TransactItems, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_0TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_0TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_0Update = ( input: Update, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ReturnValuesOnConditionCheckFailure !== undefined) { - bodyParams["ReturnValuesOnConditionCheckFailure"] = - input.ReturnValuesOnConditionCheckFailure; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.UpdateExpression !== undefined) { - bodyParams["UpdateExpression"] = input.UpdateExpression; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0UpdateContinuousBackupsInput = ( input: UpdateContinuousBackupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PointInTimeRecoverySpecification !== undefined) { - bodyParams[ - "PointInTimeRecoverySpecification" - ] = serializeAws_json1_0PointInTimeRecoverySpecification( - input.PointInTimeRecoverySpecification, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.PointInTimeRecoverySpecification !== undefined && { + PointInTimeRecoverySpecification: serializeAws_json1_0PointInTimeRecoverySpecification( + input.PointInTimeRecoverySpecification, + context + ) + }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0UpdateContributorInsightsInput = ( input: UpdateContributorInsightsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContributorInsightsAction !== undefined) { - bodyParams["ContributorInsightsAction"] = input.ContributorInsightsAction; - } - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.ContributorInsightsAction !== undefined && { + ContributorInsightsAction: input.ContributorInsightsAction + }), + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_0UpdateGlobalSecondaryIndexAction = ( input: UpdateGlobalSecondaryIndexAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.ProvisionedThroughput !== undefined) { - bodyParams[ - "ProvisionedThroughput" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughput, - context - ); - } - return bodyParams; + return { + ...(input.IndexName !== undefined && { IndexName: input.IndexName }), + ...(input.ProvisionedThroughput !== undefined && { + ProvisionedThroughput: serializeAws_json1_0ProvisionedThroughput( + input.ProvisionedThroughput, + context + ) + }) + }; }; const serializeAws_json1_0UpdateGlobalTableInput = ( input: UpdateGlobalTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalTableName !== undefined) { - bodyParams["GlobalTableName"] = input.GlobalTableName; - } - if (input.ReplicaUpdates !== undefined) { - bodyParams["ReplicaUpdates"] = serializeAws_json1_0ReplicaUpdateList( - input.ReplicaUpdates, - context - ); - } - return bodyParams; + return { + ...(input.GlobalTableName !== undefined && { + GlobalTableName: input.GlobalTableName + }), + ...(input.ReplicaUpdates !== undefined && { + ReplicaUpdates: serializeAws_json1_0ReplicaUpdateList( + input.ReplicaUpdates, + context + ) + }) + }; }; const serializeAws_json1_0UpdateGlobalTableSettingsInput = ( input: UpdateGlobalTableSettingsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalTableBillingMode !== undefined) { - bodyParams["GlobalTableBillingMode"] = input.GlobalTableBillingMode; - } - if (input.GlobalTableGlobalSecondaryIndexSettingsUpdate !== undefined) { - bodyParams[ - "GlobalTableGlobalSecondaryIndexSettingsUpdate" - ] = serializeAws_json1_0GlobalTableGlobalSecondaryIndexSettingsUpdateList( - input.GlobalTableGlobalSecondaryIndexSettingsUpdate, - context - ); - } - if (input.GlobalTableName !== undefined) { - bodyParams["GlobalTableName"] = input.GlobalTableName; - } - if ( - input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate !== - undefined - ) { - bodyParams[ - "GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.GlobalTableProvisionedWriteCapacityAutoScalingSettingsUpdate, - context - ); - } - if (input.GlobalTableProvisionedWriteCapacityUnits !== undefined) { - bodyParams["GlobalTableProvisionedWriteCapacityUnits"] = - input.GlobalTableProvisionedWriteCapacityUnits; - } - if (input.ReplicaSettingsUpdate !== undefined) { - bodyParams[ - "ReplicaSettingsUpdate" - ] = serializeAws_json1_0ReplicaSettingsUpdateList( - input.ReplicaSettingsUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0UpdateItemInput = ( input: UpdateItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeUpdates !== undefined) { - bodyParams["AttributeUpdates"] = serializeAws_json1_0AttributeUpdates( - input.AttributeUpdates, - context - ); - } - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - if (input.ConditionalOperator !== undefined) { - bodyParams["ConditionalOperator"] = input.ConditionalOperator; - } - if (input.Expected !== undefined) { - bodyParams["Expected"] = serializeAws_json1_0ExpectedAttributeMap( - input.Expected, - context - ); - } - if (input.ExpressionAttributeNames !== undefined) { - bodyParams[ - "ExpressionAttributeNames" - ] = serializeAws_json1_0ExpressionAttributeNameMap( - input.ExpressionAttributeNames, - context - ); - } - if (input.ExpressionAttributeValues !== undefined) { - bodyParams[ - "ExpressionAttributeValues" - ] = serializeAws_json1_0ExpressionAttributeValueMap( - input.ExpressionAttributeValues, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = serializeAws_json1_0Key(input.Key, context); - } - if (input.ReturnConsumedCapacity !== undefined) { - bodyParams["ReturnConsumedCapacity"] = input.ReturnConsumedCapacity; - } - if (input.ReturnItemCollectionMetrics !== undefined) { - bodyParams["ReturnItemCollectionMetrics"] = - input.ReturnItemCollectionMetrics; - } - if (input.ReturnValues !== undefined) { - bodyParams["ReturnValues"] = input.ReturnValues; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.UpdateExpression !== undefined) { - bodyParams["UpdateExpression"] = input.UpdateExpression; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0UpdateReplicationGroupMemberAction = ( input: UpdateReplicationGroupMemberAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalSecondaryIndexes !== undefined) { - bodyParams[ - "GlobalSecondaryIndexes" - ] = serializeAws_json1_0ReplicaGlobalSecondaryIndexList( - input.GlobalSecondaryIndexes, - context - ); - } - if (input.KMSMasterKeyId !== undefined) { - bodyParams["KMSMasterKeyId"] = input.KMSMasterKeyId; - } - if (input.ProvisionedThroughputOverride !== undefined) { - bodyParams[ - "ProvisionedThroughputOverride" - ] = serializeAws_json1_0ProvisionedThroughputOverride( - input.ProvisionedThroughputOverride, - context - ); - } - if (input.RegionName !== undefined) { - bodyParams["RegionName"] = input.RegionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0UpdateTableInput = ( input: UpdateTableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeDefinitions !== undefined) { - bodyParams[ - "AttributeDefinitions" - ] = serializeAws_json1_0AttributeDefinitions( - input.AttributeDefinitions, - context - ); - } - if (input.BillingMode !== undefined) { - bodyParams["BillingMode"] = input.BillingMode; - } - if (input.GlobalSecondaryIndexUpdates !== undefined) { - bodyParams[ - "GlobalSecondaryIndexUpdates" - ] = serializeAws_json1_0GlobalSecondaryIndexUpdateList( - input.GlobalSecondaryIndexUpdates, - context - ); - } - if (input.ProvisionedThroughput !== undefined) { - bodyParams[ - "ProvisionedThroughput" - ] = serializeAws_json1_0ProvisionedThroughput( - input.ProvisionedThroughput, - context - ); - } - if (input.ReplicaUpdates !== undefined) { - bodyParams[ - "ReplicaUpdates" - ] = serializeAws_json1_0ReplicationGroupUpdateList( - input.ReplicaUpdates, - context - ); - } - if (input.SSESpecification !== undefined) { - bodyParams["SSESpecification"] = serializeAws_json1_0SSESpecification( - input.SSESpecification, - context - ); - } - if (input.StreamSpecification !== undefined) { - bodyParams["StreamSpecification"] = serializeAws_json1_0StreamSpecification( - input.StreamSpecification, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0UpdateTableReplicaAutoScalingInput = ( input: UpdateTableReplicaAutoScalingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlobalSecondaryIndexUpdates !== undefined) { - bodyParams[ - "GlobalSecondaryIndexUpdates" - ] = serializeAws_json1_0GlobalSecondaryIndexAutoScalingUpdateList( - input.GlobalSecondaryIndexUpdates, - context - ); - } - if (input.ProvisionedWriteCapacityAutoScalingUpdate !== undefined) { - bodyParams[ - "ProvisionedWriteCapacityAutoScalingUpdate" - ] = serializeAws_json1_0AutoScalingSettingsUpdate( - input.ProvisionedWriteCapacityAutoScalingUpdate, - context - ); - } - if (input.ReplicaUpdates !== undefined) { - bodyParams[ - "ReplicaUpdates" - ] = serializeAws_json1_0ReplicaAutoScalingUpdateList( - input.ReplicaUpdates, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0UpdateTimeToLiveInput = ( input: UpdateTimeToLiveInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.TimeToLiveSpecification !== undefined) { - bodyParams[ - "TimeToLiveSpecification" - ] = serializeAws_json1_0TimeToLiveSpecification( - input.TimeToLiveSpecification, - context - ); - } - return bodyParams; + return { + ...(input.TableName !== undefined && { TableName: input.TableName }), + ...(input.TimeToLiveSpecification !== undefined && { + TimeToLiveSpecification: serializeAws_json1_0TimeToLiveSpecification( + input.TimeToLiveSpecification, + context + ) + }) + }; }; const serializeAws_json1_0WriteRequest = ( input: WriteRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteRequest !== undefined) { - bodyParams["DeleteRequest"] = serializeAws_json1_0DeleteRequest( - input.DeleteRequest, - context - ); - } - if (input.PutRequest !== undefined) { - bodyParams["PutRequest"] = serializeAws_json1_0PutRequest( - input.PutRequest, - context - ); - } - return bodyParams; + return { + ...(input.DeleteRequest !== undefined && { + DeleteRequest: serializeAws_json1_0DeleteRequest( + input.DeleteRequest, + context + ) + }), + ...(input.PutRequest !== undefined && { + PutRequest: serializeAws_json1_0PutRequest(input.PutRequest, context) + }) + }; }; const serializeAws_json1_0WriteRequests = ( 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 ffd68755a3eb..01ba47790cf5 100644 --- a/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts +++ b/clients/client-ec2-instance-connect/protocols/Aws_json1_1.ts @@ -234,20 +234,18 @@ const serializeAws_json1_1SendSSHPublicKeyRequest = ( input: SendSSHPublicKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.InstanceOSUser !== undefined) { - bodyParams["InstanceOSUser"] = input.InstanceOSUser; - } - if (input.SSHPublicKey !== undefined) { - bodyParams["SSHPublicKey"] = input.SSHPublicKey; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1AuthException = ( diff --git a/clients/client-ecr/protocols/Aws_json1_1.ts b/clients/client-ecr/protocols/Aws_json1_1.ts index 23656dfcdfb9..618c09004af1 100644 --- a/clients/client-ecr/protocols/Aws_json1_1.ts +++ b/clients/client-ecr/protocols/Aws_json1_1.ts @@ -3909,68 +3909,54 @@ const serializeAws_json1_1BatchCheckLayerAvailabilityRequest = ( input: BatchCheckLayerAvailabilityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.layerDigests !== undefined) { - bodyParams[ - "layerDigests" - ] = serializeAws_json1_1BatchedOperationLayerDigestList( - input.layerDigests, - context - ); - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.layerDigests !== undefined && { + layerDigests: serializeAws_json1_1BatchedOperationLayerDigestList( + input.layerDigests, + context + ) + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1BatchDeleteImageRequest = ( input: BatchDeleteImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageIds !== undefined) { - bodyParams["imageIds"] = serializeAws_json1_1ImageIdentifierList( - input.imageIds, - context - ); - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.imageIds !== undefined && { + imageIds: serializeAws_json1_1ImageIdentifierList(input.imageIds, context) + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1BatchGetImageRequest = ( input: BatchGetImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.acceptedMediaTypes !== undefined) { - bodyParams["acceptedMediaTypes"] = serializeAws_json1_1MediaTypeList( - input.acceptedMediaTypes, - context - ); - } - if (input.imageIds !== undefined) { - bodyParams["imageIds"] = serializeAws_json1_1ImageIdentifierList( - input.imageIds, - context - ); - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1BatchedOperationLayerDigestList = ( @@ -3984,185 +3970,142 @@ const serializeAws_json1_1CompleteLayerUploadRequest = ( input: CompleteLayerUploadRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.layerDigests !== undefined) { - bodyParams["layerDigests"] = serializeAws_json1_1LayerDigestList( - input.layerDigests, - context - ); - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.uploadId !== undefined) { - bodyParams["uploadId"] = input.uploadId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateRepositoryRequest = ( input: CreateRepositoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageScanningConfiguration !== undefined) { - bodyParams[ - "imageScanningConfiguration" - ] = serializeAws_json1_1ImageScanningConfiguration( - input.imageScanningConfiguration, - context - ); - } - if (input.imageTagMutability !== undefined) { - bodyParams["imageTagMutability"] = input.imageTagMutability; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(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) + }) + }; }; const serializeAws_json1_1DeleteLifecyclePolicyRequest = ( input: DeleteLifecyclePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1DeleteRepositoryPolicyRequest = ( input: DeleteRepositoryPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1DeleteRepositoryRequest = ( input: DeleteRepositoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.force !== undefined && { force: input.force }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1DescribeImageScanFindingsRequest = ( input: DescribeImageScanFindingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageId !== undefined) { - bodyParams["imageId"] = serializeAws_json1_1ImageIdentifier( - input.imageId, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeImagesFilter = ( input: DescribeImagesFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tagStatus !== undefined) { - bodyParams["tagStatus"] = input.tagStatus; - } - return bodyParams; + return { + ...(input.tagStatus !== undefined && { tagStatus: input.tagStatus }) + }; }; const serializeAws_json1_1DescribeImagesRequest = ( input: DescribeImagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1DescribeImagesFilter( - input.filter, - context - ); - } - if (input.imageIds !== undefined) { - bodyParams["imageIds"] = serializeAws_json1_1ImageIdentifierList( - input.imageIds, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeRepositoriesRequest = ( input: DescribeRepositoriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryNames !== undefined) { - bodyParams["repositoryNames"] = serializeAws_json1_1RepositoryNameList( - input.repositoryNames, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1GetAuthorizationTokenRegistryIdList = ( @@ -4176,107 +4119,84 @@ const serializeAws_json1_1GetAuthorizationTokenRequest = ( input: GetAuthorizationTokenRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.registryIds !== undefined) { - bodyParams[ - "registryIds" - ] = serializeAws_json1_1GetAuthorizationTokenRegistryIdList( - input.registryIds, - context - ); - } - return bodyParams; + return { + ...(input.registryIds !== undefined && { + registryIds: serializeAws_json1_1GetAuthorizationTokenRegistryIdList( + input.registryIds, + context + ) + }) + }; }; const serializeAws_json1_1GetDownloadUrlForLayerRequest = ( input: GetDownloadUrlForLayerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.layerDigest !== undefined) { - bodyParams["layerDigest"] = input.layerDigest; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.layerDigest !== undefined && { layerDigest: input.layerDigest }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetLifecyclePolicyPreviewRequest = ( input: GetLifecyclePolicyPreviewRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1LifecyclePolicyPreviewFilter( - input.filter, - context - ); - } - if (input.imageIds !== undefined) { - bodyParams["imageIds"] = serializeAws_json1_1ImageIdentifierList( - input.imageIds, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetLifecyclePolicyRequest = ( input: GetLifecyclePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1GetRepositoryPolicyRequest = ( input: GetRepositoryPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1ImageIdentifier = ( input: ImageIdentifier, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageDigest !== undefined) { - bodyParams["imageDigest"] = input.imageDigest; - } - if (input.imageTag !== undefined) { - bodyParams["imageTag"] = input.imageTag; - } - return bodyParams; + return { + ...(input.imageDigest !== undefined && { imageDigest: input.imageDigest }), + ...(input.imageTag !== undefined && { imageTag: input.imageTag }) + }; }; const serializeAws_json1_1ImageIdentifierList = ( @@ -4292,25 +4212,21 @@ const serializeAws_json1_1ImageScanningConfiguration = ( input: ImageScanningConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.scanOnPush !== undefined) { - bodyParams["scanOnPush"] = input.scanOnPush; - } - return bodyParams; + return { + ...(input.scanOnPush !== undefined && { scanOnPush: input.scanOnPush }) + }; }; const serializeAws_json1_1InitiateLayerUploadRequest = ( input: InitiateLayerUploadRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1LayerDigestList = ( @@ -4324,59 +4240,44 @@ const serializeAws_json1_1LifecyclePolicyPreviewFilter = ( input: LifecyclePolicyPreviewFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tagStatus !== undefined) { - bodyParams["tagStatus"] = input.tagStatus; - } - return bodyParams; + return { + ...(input.tagStatus !== undefined && { tagStatus: input.tagStatus }) + }; }; const serializeAws_json1_1ListImagesFilter = ( input: ListImagesFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tagStatus !== undefined) { - bodyParams["tagStatus"] = input.tagStatus; - } - return bodyParams; + return { + ...(input.tagStatus !== undefined && { tagStatus: input.tagStatus }) + }; }; const serializeAws_json1_1ListImagesRequest = ( input: ListImagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1ListImagesFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1MediaTypeList = ( @@ -4390,76 +4291,64 @@ const serializeAws_json1_1PutImageRequest = ( input: PutImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageManifest !== undefined) { - bodyParams["imageManifest"] = input.imageManifest; - } - if (input.imageTag !== undefined) { - bodyParams["imageTag"] = input.imageTag; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.imageManifest !== undefined && { + imageManifest: input.imageManifest + }), + ...(input.imageTag !== undefined && { imageTag: input.imageTag }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1PutImageScanningConfigurationRequest = ( input: PutImageScanningConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageScanningConfiguration !== undefined) { - bodyParams[ - "imageScanningConfiguration" - ] = serializeAws_json1_1ImageScanningConfiguration( - input.imageScanningConfiguration, - context - ); - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.imageScanningConfiguration !== undefined && { + imageScanningConfiguration: serializeAws_json1_1ImageScanningConfiguration( + input.imageScanningConfiguration, + context + ) + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1PutImageTagMutabilityRequest = ( input: PutImageTagMutabilityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageTagMutability !== undefined) { - bodyParams["imageTagMutability"] = input.imageTagMutability; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.imageTagMutability !== undefined && { + imageTagMutability: input.imageTagMutability + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1PutLifecyclePolicyRequest = ( input: PutLifecyclePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lifecyclePolicyText !== undefined) { - bodyParams["lifecyclePolicyText"] = input.lifecyclePolicyText; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.lifecyclePolicyText !== undefined && { + lifecyclePolicyText: input.lifecyclePolicyText + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1RepositoryNameList = ( @@ -4473,68 +4362,51 @@ const serializeAws_json1_1SetRepositoryPolicyRequest = ( input: SetRepositoryPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - if (input.policyText !== undefined) { - bodyParams["policyText"] = input.policyText; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1StartImageScanRequest = ( input: StartImageScanRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageId !== undefined) { - bodyParams["imageId"] = serializeAws_json1_1ImageIdentifier( - input.imageId, - context - ); - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.imageId !== undefined && { + imageId: serializeAws_json1_1ImageIdentifier(input.imageId, context) + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1StartLifecyclePolicyPreviewRequest = ( input: StartLifecyclePolicyPreviewRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.lifecyclePolicyText !== undefined) { - bodyParams["lifecyclePolicyText"] = input.lifecyclePolicyText; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - return bodyParams; + return { + ...(input.lifecyclePolicyText !== undefined && { + lifecyclePolicyText: input.lifecyclePolicyText + }), + ...(input.registryId !== undefined && { registryId: input.registryId }), + ...(input.repositoryName !== undefined && { + repositoryName: input.repositoryName + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -4555,57 +4427,46 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UploadLayerPartRequest = ( input: UploadLayerPartRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.layerPartBlob !== undefined) { - bodyParams["layerPartBlob"] = context.base64Encoder(input.layerPartBlob); - } - if (input.partFirstByte !== undefined) { - bodyParams["partFirstByte"] = input.partFirstByte; - } - if (input.partLastByte !== undefined) { - bodyParams["partLastByte"] = input.partLastByte; - } - if (input.registryId !== undefined) { - bodyParams["registryId"] = input.registryId; - } - if (input.repositoryName !== undefined) { - bodyParams["repositoryName"] = input.repositoryName; - } - if (input.uploadId !== undefined) { - bodyParams["uploadId"] = input.uploadId; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1Attribute = ( diff --git a/clients/client-ecs/protocols/Aws_json1_1.ts b/clients/client-ecs/protocols/Aws_json1_1.ts index 8f98dc237962..332397382073 100644 --- a/clients/client-ecs/protocols/Aws_json1_1.ts +++ b/clients/client-ecs/protocols/Aws_json1_1.ts @@ -6472,14 +6472,12 @@ const serializeAws_json1_1AttachmentStateChange = ( input: AttachmentStateChange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachmentArn !== undefined) { - bodyParams["attachmentArn"] = input.attachmentArn; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.attachmentArn !== undefined && { + attachmentArn: input.attachmentArn + }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1AttachmentStateChanges = ( @@ -6495,20 +6493,12 @@ const serializeAws_json1_1Attribute = ( input: Attribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.targetId !== undefined) { - bodyParams["targetId"] = input.targetId; - } - if (input.targetType !== undefined) { - bodyParams["targetType"] = input.targetType; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Attributes = ( @@ -6522,44 +6512,40 @@ const serializeAws_json1_1AutoScalingGroupProvider = ( input: AutoScalingGroupProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.autoScalingGroupArn !== undefined) { - bodyParams["autoScalingGroupArn"] = input.autoScalingGroupArn; - } - if (input.managedScaling !== undefined) { - bodyParams["managedScaling"] = serializeAws_json1_1ManagedScaling( - input.managedScaling, - context - ); - } - if (input.managedTerminationProtection !== undefined) { - bodyParams["managedTerminationProtection"] = - input.managedTerminationProtection; - } - return bodyParams; + return { + ...(input.autoScalingGroupArn !== undefined && { + autoScalingGroupArn: input.autoScalingGroupArn + }), + ...(input.managedScaling !== undefined && { + managedScaling: serializeAws_json1_1ManagedScaling( + input.managedScaling, + context + ) + }), + ...(input.managedTerminationProtection !== undefined && { + managedTerminationProtection: input.managedTerminationProtection + }) + }; }; const serializeAws_json1_1AwsVpcConfiguration = ( input: AwsVpcConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assignPublicIp !== undefined) { - bodyParams["assignPublicIp"] = input.assignPublicIp; - } - if (input.securityGroups !== undefined) { - bodyParams["securityGroups"] = serializeAws_json1_1StringList( - input.securityGroups, - context - ); - } - if (input.subnets !== undefined) { - bodyParams["subnets"] = serializeAws_json1_1StringList( - input.subnets, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CapacityProviderFieldList = ( @@ -6582,17 +6568,13 @@ const serializeAws_json1_1CapacityProviderStrategyItem = ( input: CapacityProviderStrategyItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.base !== undefined) { - bodyParams["base"] = input.base; - } - if (input.capacityProvider !== undefined) { - bodyParams["capacityProvider"] = input.capacityProvider; - } - if (input.weight !== undefined) { - bodyParams["weight"] = input.weight; - } - return bodyParams; + return { + ...(input.base !== undefined && { base: input.base }), + ...(input.capacityProvider !== undefined && { + capacityProvider: input.capacityProvider + }), + ...(input.weight !== undefined && { weight: input.weight }) + }; }; const serializeAws_json1_1ClusterFieldList = ( @@ -6606,14 +6588,10 @@ const serializeAws_json1_1ClusterSetting = ( input: ClusterSetting, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1ClusterSettings = ( @@ -6634,191 +6612,144 @@ const serializeAws_json1_1ContainerDefinition = ( input: ContainerDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.command !== undefined) { - bodyParams["command"] = serializeAws_json1_1StringList( - input.command, - context - ); - } - if (input.cpu !== undefined) { - bodyParams["cpu"] = input.cpu; - } - if (input.dependsOn !== undefined) { - bodyParams["dependsOn"] = serializeAws_json1_1ContainerDependencies( - input.dependsOn, - context - ); - } - if (input.disableNetworking !== undefined) { - bodyParams["disableNetworking"] = input.disableNetworking; - } - if (input.dnsSearchDomains !== undefined) { - bodyParams["dnsSearchDomains"] = serializeAws_json1_1StringList( - input.dnsSearchDomains, - context - ); - } - if (input.dnsServers !== undefined) { - bodyParams["dnsServers"] = serializeAws_json1_1StringList( - input.dnsServers, - context - ); - } - if (input.dockerLabels !== undefined) { - bodyParams["dockerLabels"] = serializeAws_json1_1DockerLabelsMap( - input.dockerLabels, - context - ); - } - if (input.dockerSecurityOptions !== undefined) { - bodyParams["dockerSecurityOptions"] = serializeAws_json1_1StringList( - input.dockerSecurityOptions, - context - ); - } - if (input.entryPoint !== undefined) { - bodyParams["entryPoint"] = serializeAws_json1_1StringList( - input.entryPoint, - context - ); - } - if (input.environment !== undefined) { - bodyParams["environment"] = serializeAws_json1_1EnvironmentVariables( - input.environment, - context - ); - } - if (input.essential !== undefined) { - bodyParams["essential"] = input.essential; - } - if (input.extraHosts !== undefined) { - bodyParams["extraHosts"] = serializeAws_json1_1HostEntryList( - input.extraHosts, - context - ); - } - if (input.firelensConfiguration !== undefined) { - bodyParams[ - "firelensConfiguration" - ] = serializeAws_json1_1FirelensConfiguration( - input.firelensConfiguration, - context - ); - } - if (input.healthCheck !== undefined) { - bodyParams["healthCheck"] = serializeAws_json1_1HealthCheck( - input.healthCheck, - context - ); - } - if (input.hostname !== undefined) { - bodyParams["hostname"] = input.hostname; - } - if (input.image !== undefined) { - bodyParams["image"] = input.image; - } - if (input.interactive !== undefined) { - bodyParams["interactive"] = input.interactive; - } - if (input.links !== undefined) { - bodyParams["links"] = serializeAws_json1_1StringList(input.links, context); - } - if (input.linuxParameters !== undefined) { - bodyParams["linuxParameters"] = serializeAws_json1_1LinuxParameters( - input.linuxParameters, - context - ); - } - if (input.logConfiguration !== undefined) { - bodyParams["logConfiguration"] = serializeAws_json1_1LogConfiguration( - input.logConfiguration, - context - ); - } - if (input.memory !== undefined) { - bodyParams["memory"] = input.memory; - } - if (input.memoryReservation !== undefined) { - bodyParams["memoryReservation"] = input.memoryReservation; - } - if (input.mountPoints !== undefined) { - bodyParams["mountPoints"] = serializeAws_json1_1MountPointList( - input.mountPoints, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.portMappings !== undefined) { - bodyParams["portMappings"] = serializeAws_json1_1PortMappingList( - input.portMappings, - context - ); - } - if (input.privileged !== undefined) { - bodyParams["privileged"] = input.privileged; - } - if (input.pseudoTerminal !== undefined) { - bodyParams["pseudoTerminal"] = input.pseudoTerminal; - } - if (input.readonlyRootFilesystem !== undefined) { - bodyParams["readonlyRootFilesystem"] = input.readonlyRootFilesystem; - } - if (input.repositoryCredentials !== undefined) { - bodyParams[ - "repositoryCredentials" - ] = serializeAws_json1_1RepositoryCredentials( - input.repositoryCredentials, - context - ); - } - if (input.resourceRequirements !== undefined) { - bodyParams[ - "resourceRequirements" - ] = serializeAws_json1_1ResourceRequirements( - input.resourceRequirements, - context - ); - } - if (input.secrets !== undefined) { - bodyParams["secrets"] = serializeAws_json1_1SecretList( - input.secrets, - context - ); - } - if (input.startTimeout !== undefined) { - bodyParams["startTimeout"] = input.startTimeout; - } - if (input.stopTimeout !== undefined) { - bodyParams["stopTimeout"] = input.stopTimeout; - } - if (input.systemControls !== undefined) { - bodyParams["systemControls"] = serializeAws_json1_1SystemControls( - input.systemControls, - context - ); - } - if (input.ulimits !== undefined) { - bodyParams["ulimits"] = serializeAws_json1_1UlimitList( - input.ulimits, - context - ); - } - if (input.user !== undefined) { - bodyParams["user"] = input.user; - } - if (input.volumesFrom !== undefined) { - bodyParams["volumesFrom"] = serializeAws_json1_1VolumeFromList( - input.volumesFrom, - context - ); - } - if (input.workingDirectory !== undefined) { - bodyParams["workingDirectory"] = input.workingDirectory; - } - return bodyParams; + 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.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 + }) + }; }; const serializeAws_json1_1ContainerDefinitions = ( @@ -6843,14 +6774,12 @@ const serializeAws_json1_1ContainerDependency = ( input: ContainerDependency, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.condition !== undefined) { - bodyParams["condition"] = input.condition; - } - if (input.containerName !== undefined) { - bodyParams["containerName"] = input.containerName; - } - return bodyParams; + return { + ...(input.condition !== undefined && { condition: input.condition }), + ...(input.containerName !== undefined && { + containerName: input.containerName + }) + }; }; const serializeAws_json1_1ContainerInstanceFieldList = ( @@ -6864,40 +6793,29 @@ const serializeAws_json1_1ContainerOverride = ( input: ContainerOverride, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.command !== undefined) { - bodyParams["command"] = serializeAws_json1_1StringList( - input.command, - context - ); - } - if (input.cpu !== undefined) { - bodyParams["cpu"] = input.cpu; - } - if (input.environment !== undefined) { - bodyParams["environment"] = serializeAws_json1_1EnvironmentVariables( - input.environment, - context - ); - } - if (input.memory !== undefined) { - bodyParams["memory"] = input.memory; - } - if (input.memoryReservation !== undefined) { - bodyParams["memoryReservation"] = input.memoryReservation; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.resourceRequirements !== undefined) { - bodyParams[ - "resourceRequirements" - ] = serializeAws_json1_1ResourceRequirements( - input.resourceRequirements, - context - ); - } - return bodyParams; + 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.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 + ) + }) + }; }; const serializeAws_json1_1ContainerOverrides = ( @@ -6913,32 +6831,22 @@ const serializeAws_json1_1ContainerStateChange = ( input: ContainerStateChange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerName !== undefined) { - bodyParams["containerName"] = input.containerName; - } - if (input.exitCode !== undefined) { - bodyParams["exitCode"] = input.exitCode; - } - if (input.imageDigest !== undefined) { - bodyParams["imageDigest"] = input.imageDigest; - } - if (input.networkBindings !== undefined) { - bodyParams["networkBindings"] = serializeAws_json1_1NetworkBindings( - input.networkBindings, - context - ); - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.runtimeId !== undefined) { - bodyParams["runtimeId"] = input.runtimeId; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ContainerStateChanges = ( @@ -6954,523 +6862,414 @@ const serializeAws_json1_1CreateCapacityProviderRequest = ( input: CreateCapacityProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.autoScalingGroupProvider !== undefined) { - bodyParams[ - "autoScalingGroupProvider" - ] = serializeAws_json1_1AutoScalingGroupProvider( - input.autoScalingGroupProvider, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateClusterRequest = ( input: CreateClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviders !== undefined) { - bodyParams["capacityProviders"] = serializeAws_json1_1StringList( - input.capacityProviders, - context - ); - } - if (input.clusterName !== undefined) { - bodyParams["clusterName"] = input.clusterName; - } - if (input.defaultCapacityProviderStrategy !== undefined) { - bodyParams[ - "defaultCapacityProviderStrategy" - ] = serializeAws_json1_1CapacityProviderStrategy( - input.defaultCapacityProviderStrategy, - context - ); - } - if (input.settings !== undefined) { - bodyParams["settings"] = serializeAws_json1_1ClusterSettings( - input.settings, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateServiceRequest = ( input: CreateServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviderStrategy !== undefined) { - bodyParams[ - "capacityProviderStrategy" - ] = serializeAws_json1_1CapacityProviderStrategy( - input.capacityProviderStrategy, - context - ); - } - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.deploymentConfiguration !== undefined) { - bodyParams[ - "deploymentConfiguration" - ] = serializeAws_json1_1DeploymentConfiguration( - input.deploymentConfiguration, - context - ); - } - if (input.deploymentController !== undefined) { - bodyParams[ - "deploymentController" - ] = serializeAws_json1_1DeploymentController( - input.deploymentController, - context - ); - } - if (input.desiredCount !== undefined) { - bodyParams["desiredCount"] = input.desiredCount; - } - if (input.enableECSManagedTags !== undefined) { - bodyParams["enableECSManagedTags"] = input.enableECSManagedTags; - } - if (input.healthCheckGracePeriodSeconds !== undefined) { - bodyParams["healthCheckGracePeriodSeconds"] = - input.healthCheckGracePeriodSeconds; - } - if (input.launchType !== undefined) { - bodyParams["launchType"] = input.launchType; - } - if (input.loadBalancers !== undefined) { - bodyParams["loadBalancers"] = serializeAws_json1_1LoadBalancers( - input.loadBalancers, - context - ); - } - if (input.networkConfiguration !== undefined) { - bodyParams[ - "networkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.networkConfiguration, - context - ); - } - if (input.placementConstraints !== undefined) { - bodyParams[ - "placementConstraints" - ] = serializeAws_json1_1PlacementConstraints( - input.placementConstraints, - context - ); - } - if (input.placementStrategy !== undefined) { - bodyParams["placementStrategy"] = serializeAws_json1_1PlacementStrategies( - input.placementStrategy, - context - ); - } - if (input.platformVersion !== undefined) { - bodyParams["platformVersion"] = input.platformVersion; - } - if (input.propagateTags !== undefined) { - bodyParams["propagateTags"] = input.propagateTags; - } - if (input.role !== undefined) { - bodyParams["role"] = input.role; - } - if (input.schedulingStrategy !== undefined) { - bodyParams["schedulingStrategy"] = input.schedulingStrategy; - } - if (input.serviceName !== undefined) { - bodyParams["serviceName"] = input.serviceName; - } - if (input.serviceRegistries !== undefined) { - bodyParams["serviceRegistries"] = serializeAws_json1_1ServiceRegistries( - input.serviceRegistries, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateTaskSetRequest = ( input: CreateTaskSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviderStrategy !== undefined) { - bodyParams[ - "capacityProviderStrategy" - ] = serializeAws_json1_1CapacityProviderStrategy( - input.capacityProviderStrategy, - context - ); - } - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.externalId !== undefined) { - bodyParams["externalId"] = input.externalId; - } - if (input.launchType !== undefined) { - bodyParams["launchType"] = input.launchType; - } - if (input.loadBalancers !== undefined) { - bodyParams["loadBalancers"] = serializeAws_json1_1LoadBalancers( - input.loadBalancers, - context - ); - } - if (input.networkConfiguration !== undefined) { - bodyParams[ - "networkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.networkConfiguration, - context - ); - } - if (input.platformVersion !== undefined) { - bodyParams["platformVersion"] = input.platformVersion; - } - if (input.scale !== undefined) { - bodyParams["scale"] = serializeAws_json1_1Scale(input.scale, context); - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - if (input.serviceRegistries !== undefined) { - bodyParams["serviceRegistries"] = serializeAws_json1_1ServiceRegistries( - input.serviceRegistries, - context - ); - } - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + 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.taskDefinition !== undefined && { + taskDefinition: input.taskDefinition + }) + }; }; const serializeAws_json1_1DeleteAccountSettingRequest = ( input: DeleteAccountSettingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.principalArn !== undefined) { - bodyParams["principalArn"] = input.principalArn; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.principalArn !== undefined && { + principalArn: input.principalArn + }) + }; }; const serializeAws_json1_1DeleteAttributesRequest = ( input: DeleteAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_json1_1Attributes( - input.attributes, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_json1_1Attributes(input.attributes, context) + }), + ...(input.cluster !== undefined && { cluster: input.cluster }) + }; }; const serializeAws_json1_1DeleteClusterRequest = ( input: DeleteClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }) + }; }; const serializeAws_json1_1DeleteServiceRequest = ( input: DeleteServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.force !== undefined && { force: input.force }), + ...(input.service !== undefined && { service: input.service }) + }; }; const serializeAws_json1_1DeleteTaskSetRequest = ( input: DeleteTaskSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - if (input.taskSet !== undefined) { - bodyParams["taskSet"] = input.taskSet; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeploymentConfiguration = ( input: DeploymentConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maximumPercent !== undefined) { - bodyParams["maximumPercent"] = input.maximumPercent; - } - if (input.minimumHealthyPercent !== undefined) { - bodyParams["minimumHealthyPercent"] = input.minimumHealthyPercent; - } - return bodyParams; + return { + ...(input.maximumPercent !== undefined && { + maximumPercent: input.maximumPercent + }), + ...(input.minimumHealthyPercent !== undefined && { + minimumHealthyPercent: input.minimumHealthyPercent + }) + }; }; const serializeAws_json1_1DeploymentController = ( input: DeploymentController, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1DeregisterContainerInstanceRequest = ( input: DeregisterContainerInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstance !== undefined) { - bodyParams["containerInstance"] = input.containerInstance; - } - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && { + containerInstance: input.containerInstance + }), + ...(input.force !== undefined && { force: input.force }) + }; }; const serializeAws_json1_1DeregisterTaskDefinitionRequest = ( input: DeregisterTaskDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + return { + ...(input.taskDefinition !== undefined && { + taskDefinition: input.taskDefinition + }) + }; }; const serializeAws_json1_1DescribeCapacityProvidersRequest = ( input: DescribeCapacityProvidersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviders !== undefined) { - bodyParams["capacityProviders"] = serializeAws_json1_1StringList( - input.capacityProviders, - context - ); - } - if (input.include !== undefined) { - bodyParams["include"] = serializeAws_json1_1CapacityProviderFieldList( - input.include, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeClustersRequest = ( input: DescribeClustersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clusters !== undefined) { - bodyParams["clusters"] = serializeAws_json1_1StringList( - input.clusters, - context - ); - } - if (input.include !== undefined) { - bodyParams["include"] = serializeAws_json1_1ClusterFieldList( - input.include, - context - ); - } - return bodyParams; + return { + ...(input.clusters !== undefined && { + clusters: serializeAws_json1_1StringList(input.clusters, context) + }), + ...(input.include !== undefined && { + include: serializeAws_json1_1ClusterFieldList(input.include, context) + }) + }; }; const serializeAws_json1_1DescribeContainerInstancesRequest = ( input: DescribeContainerInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstances !== undefined) { - bodyParams["containerInstances"] = serializeAws_json1_1StringList( - input.containerInstances, - context - ); - } - if (input.include !== undefined) { - bodyParams["include"] = serializeAws_json1_1ContainerInstanceFieldList( - input.include, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeServicesRequest = ( input: DescribeServicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.include !== undefined) { - bodyParams["include"] = serializeAws_json1_1ServiceFieldList( - input.include, - context - ); - } - if (input.services !== undefined) { - bodyParams["services"] = serializeAws_json1_1StringList( - input.services, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeTaskDefinitionRequest = ( input: DescribeTaskDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.include !== undefined) { - bodyParams["include"] = serializeAws_json1_1TaskDefinitionFieldList( - input.include, - context - ); - } - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + return { + ...(input.include !== undefined && { + include: serializeAws_json1_1TaskDefinitionFieldList( + input.include, + context + ) + }), + ...(input.taskDefinition !== undefined && { + taskDefinition: input.taskDefinition + }) + }; }; const serializeAws_json1_1DescribeTaskSetsRequest = ( input: DescribeTaskSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - if (input.taskSets !== undefined) { - bodyParams["taskSets"] = serializeAws_json1_1StringList( - input.taskSets, - context - ); - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.service !== undefined && { service: input.service }), + ...(input.taskSets !== undefined && { + taskSets: serializeAws_json1_1StringList(input.taskSets, context) + }) + }; }; const serializeAws_json1_1DescribeTasksRequest = ( input: DescribeTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.include !== undefined) { - bodyParams["include"] = serializeAws_json1_1TaskFieldList( - input.include, - context - ); - } - if (input.tasks !== undefined) { - bodyParams["tasks"] = serializeAws_json1_1StringList(input.tasks, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1Device = ( input: Device, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerPath !== undefined) { - bodyParams["containerPath"] = input.containerPath; - } - if (input.hostPath !== undefined) { - bodyParams["hostPath"] = input.hostPath; - } - if (input.permissions !== undefined) { - bodyParams["permissions"] = serializeAws_json1_1DeviceCgroupPermissions( - input.permissions, - context - ); - } - return bodyParams; + return { + ...(input.containerPath !== undefined && { + containerPath: input.containerPath + }), + ...(input.hostPath !== undefined && { hostPath: input.hostPath }), + ...(input.permissions !== undefined && { + permissions: serializeAws_json1_1DeviceCgroupPermissions( + input.permissions, + context + ) + }) + }; }; const serializeAws_json1_1DeviceCgroupPermissions = ( @@ -7491,14 +7290,12 @@ const serializeAws_json1_1DiscoverPollEndpointRequest = ( input: DiscoverPollEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstance !== undefined) { - bodyParams["containerInstance"] = input.containerInstance; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && { + containerInstance: input.containerInstance + }) + }; }; const serializeAws_json1_1DockerLabelsMap = ( @@ -7515,40 +7312,33 @@ const serializeAws_json1_1DockerVolumeConfiguration = ( input: DockerVolumeConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.autoprovision !== undefined) { - bodyParams["autoprovision"] = input.autoprovision; - } - if (input.driver !== undefined) { - bodyParams["driver"] = input.driver; - } - if (input.driverOpts !== undefined) { - bodyParams["driverOpts"] = serializeAws_json1_1StringMap( - input.driverOpts, - context - ); - } - if (input.labels !== undefined) { - bodyParams["labels"] = serializeAws_json1_1StringMap(input.labels, context); - } - if (input.scope !== undefined) { - bodyParams["scope"] = input.scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EFSVolumeConfiguration = ( input: EFSVolumeConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fileSystemId !== undefined) { - bodyParams["fileSystemId"] = input.fileSystemId; - } - if (input.rootDirectory !== undefined) { - bodyParams["rootDirectory"] = input.rootDirectory; - } - return bodyParams; + return { + ...(input.fileSystemId !== undefined && { + fileSystemId: input.fileSystemId + }), + ...(input.rootDirectory !== undefined && { + rootDirectory: input.rootDirectory + }) + }; }; const serializeAws_json1_1EnvironmentVariables = ( @@ -7562,17 +7352,15 @@ const serializeAws_json1_1FirelensConfiguration = ( input: FirelensConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.options !== undefined) { - bodyParams["options"] = serializeAws_json1_1FirelensConfigurationOptionsMap( - input.options, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.options !== undefined && { + options: serializeAws_json1_1FirelensConfigurationOptionsMap( + input.options, + context + ) + }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1FirelensConfigurationOptionsMap = ( @@ -7589,40 +7377,25 @@ const serializeAws_json1_1HealthCheck = ( input: HealthCheck, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.command !== undefined) { - bodyParams["command"] = serializeAws_json1_1StringList( - input.command, - context - ); - } - if (input.interval !== undefined) { - bodyParams["interval"] = input.interval; - } - if (input.retries !== undefined) { - bodyParams["retries"] = input.retries; - } - if (input.startPeriod !== undefined) { - bodyParams["startPeriod"] = input.startPeriod; - } - if (input.timeout !== undefined) { - bodyParams["timeout"] = input.timeout; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1HostEntry = ( input: HostEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hostname !== undefined) { - bodyParams["hostname"] = input.hostname; - } - if (input.ipAddress !== undefined) { - bodyParams["ipAddress"] = input.ipAddress; - } - return bodyParams; + return { + ...(input.hostname !== undefined && { hostname: input.hostname }), + ...(input.ipAddress !== undefined && { ipAddress: input.ipAddress }) + }; }; const serializeAws_json1_1HostEntryList = ( @@ -7636,39 +7409,29 @@ const serializeAws_json1_1HostVolumeProperties = ( input: HostVolumeProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.sourcePath !== undefined) { - bodyParams["sourcePath"] = input.sourcePath; - } - return bodyParams; + return { + ...(input.sourcePath !== undefined && { sourcePath: input.sourcePath }) + }; }; const serializeAws_json1_1InferenceAccelerator = ( input: InferenceAccelerator, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deviceName !== undefined) { - bodyParams["deviceName"] = input.deviceName; - } - if (input.deviceType !== undefined) { - bodyParams["deviceType"] = input.deviceType; - } - return bodyParams; + return { + ...(input.deviceName !== undefined && { deviceName: input.deviceName }), + ...(input.deviceType !== undefined && { deviceType: input.deviceType }) + }; }; const serializeAws_json1_1InferenceAcceleratorOverride = ( input: InferenceAcceleratorOverride, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deviceName !== undefined) { - bodyParams["deviceName"] = input.deviceName; - } - if (input.deviceType !== undefined) { - bodyParams["deviceType"] = input.deviceType; - } - return bodyParams; + return { + ...(input.deviceName !== undefined && { deviceName: input.deviceName }), + ...(input.deviceType !== undefined && { deviceType: input.deviceType }) + }; }; const serializeAws_json1_1InferenceAcceleratorOverrides = ( @@ -7693,284 +7456,205 @@ const serializeAws_json1_1KernelCapabilities = ( input: KernelCapabilities, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.add !== undefined) { - bodyParams["add"] = serializeAws_json1_1StringList(input.add, context); - } - if (input.drop !== undefined) { - bodyParams["drop"] = serializeAws_json1_1StringList(input.drop, context); - } - return bodyParams; + return { + ...(input.add !== undefined && { + add: serializeAws_json1_1StringList(input.add, context) + }), + ...(input.drop !== undefined && { + drop: serializeAws_json1_1StringList(input.drop, context) + }) + }; }; const serializeAws_json1_1KeyValuePair = ( input: KeyValuePair, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1LinuxParameters = ( input: LinuxParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capabilities !== undefined) { - bodyParams["capabilities"] = serializeAws_json1_1KernelCapabilities( - input.capabilities, - context - ); - } - if (input.devices !== undefined) { - bodyParams["devices"] = serializeAws_json1_1DevicesList( - input.devices, - context - ); - } - if (input.initProcessEnabled !== undefined) { - bodyParams["initProcessEnabled"] = input.initProcessEnabled; - } - if (input.maxSwap !== undefined) { - bodyParams["maxSwap"] = input.maxSwap; - } - if (input.sharedMemorySize !== undefined) { - bodyParams["sharedMemorySize"] = input.sharedMemorySize; - } - if (input.swappiness !== undefined) { - bodyParams["swappiness"] = input.swappiness; - } - if (input.tmpfs !== undefined) { - bodyParams["tmpfs"] = serializeAws_json1_1TmpfsList(input.tmpfs, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListAccountSettingsRequest = ( input: ListAccountSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.effectiveSettings !== undefined) { - bodyParams["effectiveSettings"] = input.effectiveSettings; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.principalArn !== undefined) { - bodyParams["principalArn"] = input.principalArn; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListAttributesRequest = ( input: ListAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributeName !== undefined) { - bodyParams["attributeName"] = input.attributeName; - } - if (input.attributeValue !== undefined) { - bodyParams["attributeValue"] = input.attributeValue; - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.targetType !== undefined) { - bodyParams["targetType"] = input.targetType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListClustersRequest = ( input: ListClustersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListContainerInstancesRequest = ( input: ListContainerInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.filter !== undefined) { - bodyParams["filter"] = input.filter; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListServicesRequest = ( input: ListServicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.launchType !== undefined) { - bodyParams["launchType"] = input.launchType; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.schedulingStrategy !== undefined) { - bodyParams["schedulingStrategy"] = input.schedulingStrategy; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1ListTaskDefinitionFamiliesRequest = ( input: ListTaskDefinitionFamiliesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.familyPrefix !== undefined) { - bodyParams["familyPrefix"] = input.familyPrefix; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTaskDefinitionsRequest = ( input: ListTaskDefinitionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.familyPrefix !== undefined) { - bodyParams["familyPrefix"] = input.familyPrefix; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.sort !== undefined) { - bodyParams["sort"] = input.sort; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTasksRequest = ( input: ListTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstance !== undefined) { - bodyParams["containerInstance"] = input.containerInstance; - } - if (input.desiredStatus !== undefined) { - bodyParams["desiredStatus"] = input.desiredStatus; - } - if (input.family !== undefined) { - bodyParams["family"] = input.family; - } - if (input.launchType !== undefined) { - bodyParams["launchType"] = input.launchType; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.serviceName !== undefined) { - bodyParams["serviceName"] = input.serviceName; - } - if (input.startedBy !== undefined) { - bodyParams["startedBy"] = input.startedBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1LoadBalancer = ( input: LoadBalancer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerName !== undefined) { - bodyParams["containerName"] = input.containerName; - } - if (input.containerPort !== undefined) { - bodyParams["containerPort"] = input.containerPort; - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - if (input.targetGroupArn !== undefined) { - bodyParams["targetGroupArn"] = input.targetGroupArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1LoadBalancers = ( @@ -7984,23 +7668,21 @@ const serializeAws_json1_1LogConfiguration = ( input: LogConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logDriver !== undefined) { - bodyParams["logDriver"] = input.logDriver; - } - if (input.options !== undefined) { - bodyParams["options"] = serializeAws_json1_1LogConfigurationOptionsMap( - input.options, - context - ); - } - if (input.secretOptions !== undefined) { - bodyParams["secretOptions"] = serializeAws_json1_1SecretList( - input.secretOptions, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1LogConfigurationOptionsMap = ( @@ -8017,37 +7699,33 @@ const serializeAws_json1_1ManagedScaling = ( input: ManagedScaling, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maximumScalingStepSize !== undefined) { - bodyParams["maximumScalingStepSize"] = input.maximumScalingStepSize; - } - if (input.minimumScalingStepSize !== undefined) { - bodyParams["minimumScalingStepSize"] = input.minimumScalingStepSize; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - if (input.targetCapacity !== undefined) { - bodyParams["targetCapacity"] = input.targetCapacity; - } - return bodyParams; + return { + ...(input.maximumScalingStepSize !== undefined && { + maximumScalingStepSize: input.maximumScalingStepSize + }), + ...(input.minimumScalingStepSize !== undefined && { + minimumScalingStepSize: input.minimumScalingStepSize + }), + ...(input.status !== undefined && { status: input.status }), + ...(input.targetCapacity !== undefined && { + targetCapacity: input.targetCapacity + }) + }; }; const serializeAws_json1_1MountPoint = ( input: MountPoint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerPath !== undefined) { - bodyParams["containerPath"] = input.containerPath; - } - if (input.readOnly !== undefined) { - bodyParams["readOnly"] = input.readOnly; - } - if (input.sourceVolume !== undefined) { - bodyParams["sourceVolume"] = input.sourceVolume; - } - return bodyParams; + return { + ...(input.containerPath !== undefined && { + containerPath: input.containerPath + }), + ...(input.readOnly !== undefined && { readOnly: input.readOnly }), + ...(input.sourceVolume !== undefined && { + sourceVolume: input.sourceVolume + }) + }; }; const serializeAws_json1_1MountPointList = ( @@ -8061,20 +7739,14 @@ const serializeAws_json1_1NetworkBinding = ( input: NetworkBinding, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bindIP !== undefined) { - bodyParams["bindIP"] = input.bindIP; - } - if (input.containerPort !== undefined) { - bodyParams["containerPort"] = input.containerPort; - } - if (input.hostPort !== undefined) { - bodyParams["hostPort"] = input.hostPort; - } - if (input.protocol !== undefined) { - bodyParams["protocol"] = input.protocol; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NetworkBindings = ( @@ -8088,28 +7760,24 @@ const serializeAws_json1_1NetworkConfiguration = ( input: NetworkConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsvpcConfiguration !== undefined) { - bodyParams["awsvpcConfiguration"] = serializeAws_json1_1AwsVpcConfiguration( - input.awsvpcConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.awsvpcConfiguration !== undefined && { + awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration( + input.awsvpcConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1PlacementConstraint = ( input: PlacementConstraint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expression !== undefined) { - bodyParams["expression"] = input.expression; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.expression !== undefined && { expression: input.expression }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1PlacementConstraints = ( @@ -8134,28 +7802,20 @@ const serializeAws_json1_1PlacementStrategy = ( input: PlacementStrategy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.field !== undefined) { - bodyParams["field"] = input.field; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.field !== undefined && { field: input.field }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1PlatformDevice = ( input: PlatformDevice, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1PlatformDevices = ( @@ -8169,17 +7829,13 @@ const serializeAws_json1_1PortMapping = ( input: PortMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerPort !== undefined) { - bodyParams["containerPort"] = input.containerPort; - } - if (input.hostPort !== undefined) { - bodyParams["hostPort"] = input.hostPort; - } - if (input.protocol !== undefined) { - bodyParams["protocol"] = input.protocol; - } - return bodyParams; + return { + ...(input.containerPort !== undefined && { + containerPort: input.containerPort + }), + ...(input.hostPort !== undefined && { hostPort: input.hostPort }), + ...(input.protocol !== undefined && { protocol: input.protocol }) + }; }; const serializeAws_json1_1PortMappingList = ( @@ -8193,20 +7849,18 @@ const serializeAws_json1_1ProxyConfiguration = ( input: ProxyConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerName !== undefined) { - bodyParams["containerName"] = input.containerName; - } - if (input.properties !== undefined) { - bodyParams["properties"] = serializeAws_json1_1ProxyConfigurationProperties( - input.properties, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.containerName !== undefined && { + containerName: input.containerName + }), + ...(input.properties !== undefined && { + properties: serializeAws_json1_1ProxyConfigurationProperties( + input.properties, + context + ) + }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1ProxyConfigurationProperties = ( @@ -8220,254 +7874,191 @@ const serializeAws_json1_1PutAccountSettingDefaultRequest = ( input: PutAccountSettingDefaultRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1PutAccountSettingRequest = ( input: PutAccountSettingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.principalArn !== undefined) { - bodyParams["principalArn"] = input.principalArn; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.principalArn !== undefined && { + principalArn: input.principalArn + }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1PutAttributesRequest = ( input: PutAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_json1_1Attributes( - input.attributes, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_json1_1Attributes(input.attributes, context) + }), + ...(input.cluster !== undefined && { cluster: input.cluster }) + }; }; const serializeAws_json1_1PutClusterCapacityProvidersRequest = ( input: PutClusterCapacityProvidersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviders !== undefined) { - bodyParams["capacityProviders"] = serializeAws_json1_1StringList( - input.capacityProviders, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.defaultCapacityProviderStrategy !== undefined) { - bodyParams[ - "defaultCapacityProviderStrategy" - ] = serializeAws_json1_1CapacityProviderStrategy( - input.defaultCapacityProviderStrategy, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RegisterContainerInstanceRequest = ( input: RegisterContainerInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_json1_1Attributes( - input.attributes, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstanceArn !== undefined) { - bodyParams["containerInstanceArn"] = input.containerInstanceArn; - } - if (input.instanceIdentityDocument !== undefined) { - bodyParams["instanceIdentityDocument"] = input.instanceIdentityDocument; - } - if (input.instanceIdentityDocumentSignature !== undefined) { - bodyParams["instanceIdentityDocumentSignature"] = - input.instanceIdentityDocumentSignature; - } - if (input.platformDevices !== undefined) { - bodyParams["platformDevices"] = serializeAws_json1_1PlatformDevices( - input.platformDevices, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - if (input.totalResources !== undefined) { - bodyParams["totalResources"] = serializeAws_json1_1Resources( - input.totalResources, - context - ); - } - if (input.versionInfo !== undefined) { - bodyParams["versionInfo"] = serializeAws_json1_1VersionInfo( - input.versionInfo, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RegisterTaskDefinitionRequest = ( input: RegisterTaskDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerDefinitions !== undefined) { - bodyParams[ - "containerDefinitions" - ] = serializeAws_json1_1ContainerDefinitions( - input.containerDefinitions, - context - ); - } - if (input.cpu !== undefined) { - bodyParams["cpu"] = input.cpu; - } - if (input.executionRoleArn !== undefined) { - bodyParams["executionRoleArn"] = input.executionRoleArn; - } - if (input.family !== undefined) { - bodyParams["family"] = input.family; - } - if (input.inferenceAccelerators !== undefined) { - bodyParams[ - "inferenceAccelerators" - ] = serializeAws_json1_1InferenceAccelerators( - input.inferenceAccelerators, - context - ); - } - if (input.ipcMode !== undefined) { - bodyParams["ipcMode"] = input.ipcMode; - } - if (input.memory !== undefined) { - bodyParams["memory"] = input.memory; - } - if (input.networkMode !== undefined) { - bodyParams["networkMode"] = input.networkMode; - } - if (input.pidMode !== undefined) { - bodyParams["pidMode"] = input.pidMode; - } - if (input.placementConstraints !== undefined) { - bodyParams[ - "placementConstraints" - ] = serializeAws_json1_1TaskDefinitionPlacementConstraints( - input.placementConstraints, - context - ); - } - if (input.proxyConfiguration !== undefined) { - bodyParams["proxyConfiguration"] = serializeAws_json1_1ProxyConfiguration( - input.proxyConfiguration, - context - ); - } - if (input.requiresCompatibilities !== undefined) { - bodyParams[ - "requiresCompatibilities" - ] = serializeAws_json1_1CompatibilityList( - input.requiresCompatibilities, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - if (input.taskRoleArn !== undefined) { - bodyParams["taskRoleArn"] = input.taskRoleArn; - } - if (input.volumes !== undefined) { - bodyParams["volumes"] = serializeAws_json1_1VolumeList( - input.volumes, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RepositoryCredentials = ( input: RepositoryCredentials, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.credentialsParameter !== undefined) { - bodyParams["credentialsParameter"] = input.credentialsParameter; - } - return bodyParams; + return { + ...(input.credentialsParameter !== undefined && { + credentialsParameter: input.credentialsParameter + }) + }; }; const serializeAws_json1_1Resource = ( input: Resource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.doubleValue !== undefined) { - bodyParams["doubleValue"] = input.doubleValue; - } - if (input.integerValue !== undefined) { - bodyParams["integerValue"] = input.integerValue; - } - if (input.longValue !== undefined) { - bodyParams["longValue"] = input.longValue; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.stringSetValue !== undefined) { - bodyParams["stringSetValue"] = serializeAws_json1_1StringList( - input.stringSetValue, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ResourceRequirement = ( input: ResourceRequirement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.type !== undefined && { type: input.type }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1ResourceRequirements = ( @@ -8490,105 +8081,76 @@ const serializeAws_json1_1RunTaskRequest = ( input: RunTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviderStrategy !== undefined) { - bodyParams[ - "capacityProviderStrategy" - ] = serializeAws_json1_1CapacityProviderStrategy( - input.capacityProviderStrategy, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.count !== undefined) { - bodyParams["count"] = input.count; - } - if (input.enableECSManagedTags !== undefined) { - bodyParams["enableECSManagedTags"] = input.enableECSManagedTags; - } - if (input.group !== undefined) { - bodyParams["group"] = input.group; - } - if (input.launchType !== undefined) { - bodyParams["launchType"] = input.launchType; - } - if (input.networkConfiguration !== undefined) { - bodyParams[ - "networkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.networkConfiguration, - context - ); - } - if (input.overrides !== undefined) { - bodyParams["overrides"] = serializeAws_json1_1TaskOverride( - input.overrides, - context - ); - } - if (input.placementConstraints !== undefined) { - bodyParams[ - "placementConstraints" - ] = serializeAws_json1_1PlacementConstraints( - input.placementConstraints, - context - ); - } - if (input.placementStrategy !== undefined) { - bodyParams["placementStrategy"] = serializeAws_json1_1PlacementStrategies( - input.placementStrategy, - context - ); - } - if (input.platformVersion !== undefined) { - bodyParams["platformVersion"] = input.platformVersion; - } - if (input.propagateTags !== undefined) { - bodyParams["propagateTags"] = input.propagateTags; - } - if (input.referenceId !== undefined) { - bodyParams["referenceId"] = input.referenceId; - } - if (input.startedBy !== undefined) { - bodyParams["startedBy"] = input.startedBy; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1Scale = ( input: Scale, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.unit !== undefined) { - bodyParams["unit"] = input.unit; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.unit !== undefined && { unit: input.unit }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1Secret = ( input: Secret, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.valueFrom !== undefined) { - bodyParams["valueFrom"] = input.valueFrom; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.valueFrom !== undefined && { valueFrom: input.valueFrom }) + }; }; const serializeAws_json1_1SecretList = ( @@ -8618,89 +8180,66 @@ const serializeAws_json1_1ServiceRegistry = ( input: ServiceRegistry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerName !== undefined) { - bodyParams["containerName"] = input.containerName; - } - if (input.containerPort !== undefined) { - bodyParams["containerPort"] = input.containerPort; - } - if (input.port !== undefined) { - bodyParams["port"] = input.port; - } - if (input.registryArn !== undefined) { - bodyParams["registryArn"] = input.registryArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartTaskRequest = ( input: StartTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstances !== undefined) { - bodyParams["containerInstances"] = serializeAws_json1_1StringList( - input.containerInstances, - context - ); - } - if (input.enableECSManagedTags !== undefined) { - bodyParams["enableECSManagedTags"] = input.enableECSManagedTags; - } - if (input.group !== undefined) { - bodyParams["group"] = input.group; - } - if (input.networkConfiguration !== undefined) { - bodyParams[ - "networkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.networkConfiguration, - context - ); - } - if (input.overrides !== undefined) { - bodyParams["overrides"] = serializeAws_json1_1TaskOverride( - input.overrides, - context - ); - } - if (input.propagateTags !== undefined) { - bodyParams["propagateTags"] = input.propagateTags; - } - if (input.referenceId !== undefined) { - bodyParams["referenceId"] = input.referenceId; - } - if (input.startedBy !== undefined) { - bodyParams["startedBy"] = input.startedBy; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1StopTaskRequest = ( input: StopTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.task !== undefined) { - bodyParams["task"] = input.task; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.reason !== undefined && { reason: input.reason }), + ...(input.task !== undefined && { task: input.task }) + }; }; const serializeAws_json1_1StringList = ( @@ -8724,113 +8263,81 @@ const serializeAws_json1_1SubmitAttachmentStateChangesRequest = ( input: SubmitAttachmentStateChangesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachments !== undefined) { - bodyParams["attachments"] = serializeAws_json1_1AttachmentStateChanges( - input.attachments, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - return bodyParams; + return { + ...(input.attachments !== undefined && { + attachments: serializeAws_json1_1AttachmentStateChanges( + input.attachments, + context + ) + }), + ...(input.cluster !== undefined && { cluster: input.cluster }) + }; }; const serializeAws_json1_1SubmitContainerStateChangeRequest = ( input: SubmitContainerStateChangeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerName !== undefined) { - bodyParams["containerName"] = input.containerName; - } - if (input.exitCode !== undefined) { - bodyParams["exitCode"] = input.exitCode; - } - if (input.networkBindings !== undefined) { - bodyParams["networkBindings"] = serializeAws_json1_1NetworkBindings( - input.networkBindings, - context - ); - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.runtimeId !== undefined) { - bodyParams["runtimeId"] = input.runtimeId; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - if (input.task !== undefined) { - bodyParams["task"] = input.task; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SubmitTaskStateChangeRequest = ( input: SubmitTaskStateChangeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachments !== undefined) { - bodyParams["attachments"] = serializeAws_json1_1AttachmentStateChanges( - input.attachments, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containers !== undefined) { - bodyParams["containers"] = serializeAws_json1_1ContainerStateChanges( - input.containers, - context - ); - } - if (input.executionStoppedAt !== undefined) { - bodyParams["executionStoppedAt"] = Math.round( - input.executionStoppedAt.getTime() / 1000 - ); - } - if (input.pullStartedAt !== undefined) { - bodyParams["pullStartedAt"] = Math.round( - input.pullStartedAt.getTime() / 1000 - ); - } - if (input.pullStoppedAt !== undefined) { - bodyParams["pullStoppedAt"] = Math.round( - input.pullStoppedAt.getTime() / 1000 - ); - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - if (input.task !== undefined) { - bodyParams["task"] = input.task; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SystemControl = ( input: SystemControl, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.namespace !== undefined) { - bodyParams["namespace"] = input.namespace; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.namespace !== undefined && { namespace: input.namespace }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1SystemControls = ( @@ -8841,14 +8348,10 @@ const serializeAws_json1_1SystemControls = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -8862,14 +8365,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1Tags(input.tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -8890,14 +8391,10 @@ const serializeAws_json1_1TaskDefinitionPlacementConstraint = ( input: TaskDefinitionPlacementConstraint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expression !== undefined) { - bodyParams["expression"] = input.expression; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.expression !== undefined && { expression: input.expression }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1TaskDefinitionPlacementConstraints = ( @@ -8920,54 +8417,41 @@ const serializeAws_json1_1TaskOverride = ( input: TaskOverride, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerOverrides !== undefined) { - bodyParams["containerOverrides"] = serializeAws_json1_1ContainerOverrides( - input.containerOverrides, - context - ); - } - if (input.cpu !== undefined) { - bodyParams["cpu"] = input.cpu; - } - if (input.executionRoleArn !== undefined) { - bodyParams["executionRoleArn"] = input.executionRoleArn; - } - if (input.inferenceAcceleratorOverrides !== undefined) { - bodyParams[ - "inferenceAcceleratorOverrides" - ] = serializeAws_json1_1InferenceAcceleratorOverrides( - input.inferenceAcceleratorOverrides, - context - ); - } - if (input.memory !== undefined) { - bodyParams["memory"] = input.memory; - } - if (input.taskRoleArn !== undefined) { - bodyParams["taskRoleArn"] = input.taskRoleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Tmpfs = ( input: Tmpfs, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.containerPath !== undefined) { - bodyParams["containerPath"] = input.containerPath; - } - if (input.mountOptions !== undefined) { - bodyParams["mountOptions"] = serializeAws_json1_1StringList( - input.mountOptions, - context - ); - } - if (input.size !== undefined) { - bodyParams["size"] = input.size; - } - return bodyParams; + return { + ...(input.containerPath !== undefined && { + containerPath: input.containerPath + }), + ...(input.mountOptions !== undefined && { + mountOptions: serializeAws_json1_1StringList(input.mountOptions, context) + }), + ...(input.size !== undefined && { size: input.size }) + }; }; const serializeAws_json1_1TmpfsList = ( @@ -8981,17 +8465,11 @@ const serializeAws_json1_1Ulimit = ( input: Ulimit, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hardLimit !== undefined) { - bodyParams["hardLimit"] = input.hardLimit; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.softLimit !== undefined) { - bodyParams["softLimit"] = input.softLimit; - } - return bodyParams; + return { + ...(input.hardLimit !== undefined && { hardLimit: input.hardLimit }), + ...(input.name !== undefined && { name: input.name }), + ...(input.softLimit !== undefined && { softLimit: input.softLimit }) + }; }; const serializeAws_json1_1UlimitList = ( @@ -9005,220 +8483,173 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeys(input.tagKeys, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeys(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateClusterSettingsRequest = ( input: UpdateClusterSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.settings !== undefined) { - bodyParams["settings"] = serializeAws_json1_1ClusterSettings( - input.settings, - context - ); - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.settings !== undefined && { + settings: serializeAws_json1_1ClusterSettings(input.settings, context) + }) + }; }; const serializeAws_json1_1UpdateContainerAgentRequest = ( input: UpdateContainerAgentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstance !== undefined) { - bodyParams["containerInstance"] = input.containerInstance; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.containerInstance !== undefined && { + containerInstance: input.containerInstance + }) + }; }; const serializeAws_json1_1UpdateContainerInstancesStateRequest = ( input: UpdateContainerInstancesStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.containerInstances !== undefined) { - bodyParams["containerInstances"] = serializeAws_json1_1StringList( - input.containerInstances, - context - ); - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.containerInstances !== undefined && { + containerInstances: serializeAws_json1_1StringList( + input.containerInstances, + context + ) + }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1UpdateServicePrimaryTaskSetRequest = ( input: UpdateServicePrimaryTaskSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.primaryTaskSet !== undefined) { - bodyParams["primaryTaskSet"] = input.primaryTaskSet; - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - return bodyParams; + return { + ...(input.cluster !== undefined && { cluster: input.cluster }), + ...(input.primaryTaskSet !== undefined && { + primaryTaskSet: input.primaryTaskSet + }), + ...(input.service !== undefined && { service: input.service }) + }; }; const serializeAws_json1_1UpdateServiceRequest = ( input: UpdateServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.capacityProviderStrategy !== undefined) { - bodyParams[ - "capacityProviderStrategy" - ] = serializeAws_json1_1CapacityProviderStrategy( - input.capacityProviderStrategy, - context - ); - } - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.deploymentConfiguration !== undefined) { - bodyParams[ - "deploymentConfiguration" - ] = serializeAws_json1_1DeploymentConfiguration( - input.deploymentConfiguration, - context - ); - } - if (input.desiredCount !== undefined) { - bodyParams["desiredCount"] = input.desiredCount; - } - if (input.forceNewDeployment !== undefined) { - bodyParams["forceNewDeployment"] = input.forceNewDeployment; - } - if (input.healthCheckGracePeriodSeconds !== undefined) { - bodyParams["healthCheckGracePeriodSeconds"] = - input.healthCheckGracePeriodSeconds; - } - if (input.networkConfiguration !== undefined) { - bodyParams[ - "networkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.networkConfiguration, - context - ); - } - if (input.platformVersion !== undefined) { - bodyParams["platformVersion"] = input.platformVersion; - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - if (input.taskDefinition !== undefined) { - bodyParams["taskDefinition"] = input.taskDefinition; - } - return bodyParams; + 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.platformVersion !== undefined && { + platformVersion: input.platformVersion + }), + ...(input.service !== undefined && { service: input.service }), + ...(input.taskDefinition !== undefined && { + taskDefinition: input.taskDefinition + }) + }; }; const serializeAws_json1_1UpdateTaskSetRequest = ( input: UpdateTaskSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cluster !== undefined) { - bodyParams["cluster"] = input.cluster; - } - if (input.scale !== undefined) { - bodyParams["scale"] = serializeAws_json1_1Scale(input.scale, context); - } - if (input.service !== undefined) { - bodyParams["service"] = input.service; - } - if (input.taskSet !== undefined) { - bodyParams["taskSet"] = input.taskSet; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1VersionInfo = ( input: VersionInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.agentHash !== undefined) { - bodyParams["agentHash"] = input.agentHash; - } - if (input.agentVersion !== undefined) { - bodyParams["agentVersion"] = input.agentVersion; - } - if (input.dockerVersion !== undefined) { - bodyParams["dockerVersion"] = input.dockerVersion; - } - return bodyParams; + return { + ...(input.agentHash !== undefined && { agentHash: input.agentHash }), + ...(input.agentVersion !== undefined && { + agentVersion: input.agentVersion + }), + ...(input.dockerVersion !== undefined && { + dockerVersion: input.dockerVersion + }) + }; }; const serializeAws_json1_1Volume = ( input: Volume, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dockerVolumeConfiguration !== undefined) { - bodyParams[ - "dockerVolumeConfiguration" - ] = serializeAws_json1_1DockerVolumeConfiguration( - input.dockerVolumeConfiguration, - context - ); - } - if (input.efsVolumeConfiguration !== undefined) { - bodyParams[ - "efsVolumeConfiguration" - ] = serializeAws_json1_1EFSVolumeConfiguration( - input.efsVolumeConfiguration, - context - ); - } - if (input.host !== undefined) { - bodyParams["host"] = serializeAws_json1_1HostVolumeProperties( - input.host, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.dockerVolumeConfiguration !== undefined && { + dockerVolumeConfiguration: serializeAws_json1_1DockerVolumeConfiguration( + input.dockerVolumeConfiguration, + context + ) + }), + ...(input.efsVolumeConfiguration !== undefined && { + efsVolumeConfiguration: serializeAws_json1_1EFSVolumeConfiguration( + input.efsVolumeConfiguration, + context + ) + }), + ...(input.host !== undefined && { + host: serializeAws_json1_1HostVolumeProperties(input.host, context) + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1VolumeFrom = ( input: VolumeFrom, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.readOnly !== undefined) { - bodyParams["readOnly"] = input.readOnly; - } - if (input.sourceContainer !== undefined) { - bodyParams["sourceContainer"] = input.sourceContainer; - } - return bodyParams; + return { + ...(input.readOnly !== undefined && { readOnly: input.readOnly }), + ...(input.sourceContainer !== undefined && { + sourceContainer: input.sourceContainer + }) + }; }; const serializeAws_json1_1VolumeFromList = ( diff --git a/clients/client-efs/protocols/Aws_restJson1_1.ts b/clients/client-efs/protocols/Aws_restJson1_1.ts index e4c50c23b3c6..cdced1d9e23e 100644 --- a/clients/client-efs/protocols/Aws_restJson1_1.ts +++ b/clients/client-efs/protocols/Aws_restJson1_1.ts @@ -4089,17 +4089,11 @@ const serializeAws_restJson1_1CreationInfo = ( input: CreationInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OwnerGid !== undefined) { - bodyParams["OwnerGid"] = input.OwnerGid; - } - if (input.OwnerUid !== undefined) { - bodyParams["OwnerUid"] = input.OwnerUid; - } - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = input.Permissions; - } - return bodyParams; + return { + ...(input.OwnerGid !== undefined && { OwnerGid: input.OwnerGid }), + ...(input.OwnerUid !== undefined && { OwnerUid: input.OwnerUid }), + ...(input.Permissions !== undefined && { Permissions: input.Permissions }) + }; }; const serializeAws_restJson1_1LifecyclePolicies = ( @@ -4115,48 +4109,42 @@ const serializeAws_restJson1_1LifecyclePolicy = ( input: LifecyclePolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TransitionToIA !== undefined) { - bodyParams["TransitionToIA"] = input.TransitionToIA; - } - return bodyParams; + return { + ...(input.TransitionToIA !== undefined && { + TransitionToIA: input.TransitionToIA + }) + }; }; const serializeAws_restJson1_1PosixUser = ( input: PosixUser, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Gid !== undefined) { - bodyParams["Gid"] = input.Gid; - } - if (input.SecondaryGids !== undefined) { - bodyParams["SecondaryGids"] = serializeAws_restJson1_1SecondaryGids( - input.SecondaryGids, - context - ); - } - if (input.Uid !== undefined) { - bodyParams["Uid"] = input.Uid; - } - return bodyParams; + return { + ...(input.Gid !== undefined && { Gid: input.Gid }), + ...(input.SecondaryGids !== undefined && { + SecondaryGids: serializeAws_restJson1_1SecondaryGids( + input.SecondaryGids, + context + ) + }), + ...(input.Uid !== undefined && { Uid: input.Uid }) + }; }; const serializeAws_restJson1_1RootDirectory = ( input: RootDirectory, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationInfo !== undefined) { - bodyParams["CreationInfo"] = serializeAws_restJson1_1CreationInfo( - input.CreationInfo, - context - ); - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - return bodyParams; + return { + ...(input.CreationInfo !== undefined && { + CreationInfo: serializeAws_restJson1_1CreationInfo( + input.CreationInfo, + context + ) + }), + ...(input.Path !== undefined && { Path: input.Path }) + }; }; const serializeAws_restJson1_1SecondaryGids = ( @@ -4177,14 +4165,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagKeys = ( diff --git a/clients/client-eks/protocols/Aws_restJson1_1.ts b/clients/client-eks/protocols/Aws_restJson1_1.ts index 1bbee2ffa638..d420fabb89ec 100644 --- a/clients/client-eks/protocols/Aws_restJson1_1.ts +++ b/clients/client-eks/protocols/Aws_restJson1_1.ts @@ -3641,17 +3641,12 @@ const serializeAws_restJson1_1FargateProfileSelector = ( input: FargateProfileSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.labels !== undefined) { - bodyParams["labels"] = serializeAws_restJson1_1FargateProfileLabel( - input.labels, - context - ); - } - if (input.namespace !== undefined) { - bodyParams["namespace"] = input.namespace; - } - return bodyParams; + return { + ...(input.labels !== undefined && { + labels: serializeAws_restJson1_1FargateProfileLabel(input.labels, context) + }), + ...(input.namespace !== undefined && { namespace: input.namespace }) + }; }; const serializeAws_restJson1_1FargateProfileSelectors = ( @@ -3667,17 +3662,12 @@ const serializeAws_restJson1_1LogSetup = ( input: LogSetup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - if (input.types !== undefined) { - bodyParams["types"] = serializeAws_restJson1_1LogTypes( - input.types, - context - ); - } - return bodyParams; + return { + ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.types !== undefined && { + types: serializeAws_restJson1_1LogTypes(input.types, context) + }) + }; }; const serializeAws_restJson1_1LogSetups = ( @@ -3698,48 +3688,40 @@ const serializeAws_restJson1_1Logging = ( input: Logging, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clusterLogging !== undefined) { - bodyParams["clusterLogging"] = serializeAws_restJson1_1LogSetups( - input.clusterLogging, - context - ); - } - return bodyParams; + return { + ...(input.clusterLogging !== undefined && { + clusterLogging: serializeAws_restJson1_1LogSetups( + input.clusterLogging, + context + ) + }) + }; }; const serializeAws_restJson1_1NodegroupScalingConfig = ( input: NodegroupScalingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.desiredSize !== undefined) { - bodyParams["desiredSize"] = input.desiredSize; - } - if (input.maxSize !== undefined) { - bodyParams["maxSize"] = input.maxSize; - } - if (input.minSize !== undefined) { - bodyParams["minSize"] = input.minSize; - } - return bodyParams; + return { + ...(input.desiredSize !== undefined && { desiredSize: input.desiredSize }), + ...(input.maxSize !== undefined && { maxSize: input.maxSize }), + ...(input.minSize !== undefined && { minSize: input.minSize }) + }; }; const serializeAws_restJson1_1RemoteAccessConfig = ( input: RemoteAccessConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ec2SshKey !== undefined) { - bodyParams["ec2SshKey"] = input.ec2SshKey; - } - if (input.sourceSecurityGroups !== undefined) { - bodyParams["sourceSecurityGroups"] = serializeAws_restJson1_1StringList( - input.sourceSecurityGroups, - context - ); - } - return bodyParams; + return { + ...(input.ec2SshKey !== undefined && { ec2SshKey: input.ec2SshKey }), + ...(input.sourceSecurityGroups !== undefined && { + sourceSecurityGroups: serializeAws_restJson1_1StringList( + input.sourceSecurityGroups, + context + ) + }) + }; }; const serializeAws_restJson1_1StringList = ( @@ -3763,52 +3745,49 @@ const serializeAws_restJson1_1UpdateLabelsPayload = ( input: UpdateLabelsPayload, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOrUpdateLabels !== undefined) { - bodyParams["addOrUpdateLabels"] = serializeAws_restJson1_1labelsMap( - input.addOrUpdateLabels, - context - ); - } - if (input.removeLabels !== undefined) { - bodyParams["removeLabels"] = serializeAws_restJson1_1labelsKeyList( - input.removeLabels, - context - ); - } - return bodyParams; + return { + ...(input.addOrUpdateLabels !== undefined && { + addOrUpdateLabels: serializeAws_restJson1_1labelsMap( + input.addOrUpdateLabels, + context + ) + }), + ...(input.removeLabels !== undefined && { + removeLabels: serializeAws_restJson1_1labelsKeyList( + input.removeLabels, + context + ) + }) + }; }; const serializeAws_restJson1_1VpcConfigRequest = ( input: VpcConfigRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endpointPrivateAccess !== undefined) { - bodyParams["endpointPrivateAccess"] = input.endpointPrivateAccess; - } - if (input.endpointPublicAccess !== undefined) { - bodyParams["endpointPublicAccess"] = input.endpointPublicAccess; - } - if (input.publicAccessCidrs !== undefined) { - bodyParams["publicAccessCidrs"] = serializeAws_restJson1_1StringList( - input.publicAccessCidrs, - context - ); - } - if (input.securityGroupIds !== undefined) { - bodyParams["securityGroupIds"] = serializeAws_restJson1_1StringList( - input.securityGroupIds, - context - ); - } - if (input.subnetIds !== undefined) { - bodyParams["subnetIds"] = serializeAws_restJson1_1StringList( - input.subnetIds, - context - ); - } - return bodyParams; + return { + ...(input.endpointPrivateAccess !== undefined && { + endpointPrivateAccess: input.endpointPrivateAccess + }), + ...(input.endpointPublicAccess !== undefined && { + endpointPublicAccess: input.endpointPublicAccess + }), + ...(input.publicAccessCidrs !== undefined && { + publicAccessCidrs: serializeAws_restJson1_1StringList( + input.publicAccessCidrs, + context + ) + }), + ...(input.securityGroupIds !== undefined && { + securityGroupIds: serializeAws_restJson1_1StringList( + input.securityGroupIds, + context + ) + }), + ...(input.subnetIds !== undefined && { + subnetIds: serializeAws_restJson1_1StringList(input.subnetIds, context) + }) + }; }; const serializeAws_restJson1_1labelsKeyList = ( diff --git a/clients/client-elastic-transcoder/protocols/Aws_restJson1_1.ts b/clients/client-elastic-transcoder/protocols/Aws_restJson1_1.ts index 45e13b0ecf9c..d1045a871d5b 100644 --- a/clients/client-elastic-transcoder/protocols/Aws_restJson1_1.ts +++ b/clients/client-elastic-transcoder/protocols/Aws_restJson1_1.ts @@ -2815,32 +2815,23 @@ const serializeAws_restJson1_1Artwork = ( input: Artwork, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlbumArtFormat !== undefined) { - bodyParams["AlbumArtFormat"] = input.AlbumArtFormat; - } - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.InputKey !== undefined) { - bodyParams["InputKey"] = input.InputKey; - } - if (input.MaxHeight !== undefined) { - bodyParams["MaxHeight"] = input.MaxHeight; - } - if (input.MaxWidth !== undefined) { - bodyParams["MaxWidth"] = input.MaxWidth; - } - if (input.PaddingPolicy !== undefined) { - bodyParams["PaddingPolicy"] = input.PaddingPolicy; - } - if (input.SizingPolicy !== undefined) { - bodyParams["SizingPolicy"] = input.SizingPolicy; - } - return bodyParams; + return { + ...(input.AlbumArtFormat !== undefined && { + AlbumArtFormat: input.AlbumArtFormat + }), + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(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 + }) + }; }; const serializeAws_restJson1_1Artworks = ( @@ -2854,69 +2845,46 @@ const serializeAws_restJson1_1AudioCodecOptions = ( input: AudioCodecOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BitDepth !== undefined) { - bodyParams["BitDepth"] = input.BitDepth; - } - if (input.BitOrder !== undefined) { - bodyParams["BitOrder"] = input.BitOrder; - } - if (input.Profile !== undefined) { - bodyParams["Profile"] = input.Profile; - } - if (input.Signed !== undefined) { - bodyParams["Signed"] = input.Signed; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1AudioParameters = ( input: AudioParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioPackingMode !== undefined) { - bodyParams["AudioPackingMode"] = input.AudioPackingMode; - } - if (input.BitRate !== undefined) { - bodyParams["BitRate"] = input.BitRate; - } - if (input.Channels !== undefined) { - bodyParams["Channels"] = input.Channels; - } - if (input.Codec !== undefined) { - bodyParams["Codec"] = input.Codec; - } - if (input.CodecOptions !== undefined) { - bodyParams["CodecOptions"] = serializeAws_restJson1_1AudioCodecOptions( - input.CodecOptions, - context - ); - } - if (input.SampleRate !== undefined) { - bodyParams["SampleRate"] = input.SampleRate; - } - return bodyParams; + 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_restJson1_1AudioCodecOptions( + input.CodecOptions, + context + ) + }), + ...(input.SampleRate !== undefined && { SampleRate: input.SampleRate }) + }; }; const serializeAws_restJson1_1CaptionFormat = ( input: CaptionFormat, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.Pattern !== undefined) { - bodyParams["Pattern"] = input.Pattern; - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(input.Encryption, context) + }), + ...(input.Format !== undefined && { Format: input.Format }), + ...(input.Pattern !== undefined && { Pattern: input.Pattern }) + }; }; const serializeAws_restJson1_1CaptionFormats = ( @@ -2932,26 +2900,15 @@ const serializeAws_restJson1_1CaptionSource = ( input: CaptionSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Label !== undefined) { - bodyParams["Label"] = input.Label; - } - if (input.Language !== undefined) { - bodyParams["Language"] = input.Language; - } - if (input.TimeOffset !== undefined) { - bodyParams["TimeOffset"] = input.TimeOffset; - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(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 }) + }; }; const serializeAws_restJson1_1CaptionSources = ( @@ -2967,37 +2924,32 @@ const serializeAws_restJson1_1Captions = ( input: Captions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionFormats !== undefined) { - bodyParams["CaptionFormats"] = serializeAws_restJson1_1CaptionFormats( - input.CaptionFormats, - context - ); - } - if (input.CaptionSources !== undefined) { - bodyParams["CaptionSources"] = serializeAws_restJson1_1CaptionSources( - input.CaptionSources, - context - ); - } - if (input.MergePolicy !== undefined) { - bodyParams["MergePolicy"] = input.MergePolicy; - } - return bodyParams; + return { + ...(input.CaptionFormats !== undefined && { + CaptionFormats: serializeAws_restJson1_1CaptionFormats( + input.CaptionFormats, + context + ) + }), + ...(input.CaptionSources !== undefined && { + CaptionSources: serializeAws_restJson1_1CaptionSources( + input.CaptionSources, + context + ) + }), + ...(input.MergePolicy !== undefined && { MergePolicy: input.MergePolicy }) + }; }; const serializeAws_restJson1_1Clip = ( input: Clip, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TimeSpan !== undefined) { - bodyParams["TimeSpan"] = serializeAws_restJson1_1TimeSpan( - input.TimeSpan, - context - ); - } - return bodyParams; + return { + ...(input.TimeSpan !== undefined && { + TimeSpan: serializeAws_restJson1_1TimeSpan(input.TimeSpan, context) + }) + }; }; const serializeAws_restJson1_1CodecOptions = ( @@ -3021,59 +2973,44 @@ const serializeAws_restJson1_1CreateJobOutput = ( input: CreateJobOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlbumArt !== undefined) { - bodyParams["AlbumArt"] = serializeAws_restJson1_1JobAlbumArt( - input.AlbumArt, - context - ); - } - if (input.Captions !== undefined) { - bodyParams["Captions"] = serializeAws_restJson1_1Captions( - input.Captions, - context - ); - } - if (input.Composition !== undefined) { - bodyParams["Composition"] = serializeAws_restJson1_1Composition( - input.Composition, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.PresetId !== undefined) { - bodyParams["PresetId"] = input.PresetId; - } - if (input.Rotate !== undefined) { - bodyParams["Rotate"] = input.Rotate; - } - if (input.SegmentDuration !== undefined) { - bodyParams["SegmentDuration"] = input.SegmentDuration; - } - if (input.ThumbnailEncryption !== undefined) { - bodyParams["ThumbnailEncryption"] = serializeAws_restJson1_1Encryption( - input.ThumbnailEncryption, - context - ); - } - if (input.ThumbnailPattern !== undefined) { - bodyParams["ThumbnailPattern"] = input.ThumbnailPattern; - } - if (input.Watermarks !== undefined) { - bodyParams["Watermarks"] = serializeAws_restJson1_1JobWatermarks( - input.Watermarks, - context - ); - } - return bodyParams; + return { + ...(input.AlbumArt !== undefined && { + AlbumArt: serializeAws_restJson1_1JobAlbumArt(input.AlbumArt, context) + }), + ...(input.Captions !== undefined && { + Captions: serializeAws_restJson1_1Captions(input.Captions, context) + }), + ...(input.Composition !== undefined && { + Composition: serializeAws_restJson1_1Composition( + input.Composition, + context + ) + }), + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(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_restJson1_1Encryption( + input.ThumbnailEncryption, + context + ) + }), + ...(input.ThumbnailPattern !== undefined && { + ThumbnailPattern: input.ThumbnailPattern + }), + ...(input.Watermarks !== undefined && { + Watermarks: serializeAws_restJson1_1JobWatermarks( + input.Watermarks, + context + ) + }) + }; }; const serializeAws_restJson1_1CreateJobOutputs = ( @@ -3089,34 +3026,25 @@ const serializeAws_restJson1_1CreateJobPlaylist = ( input: CreateJobPlaylist, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.HlsContentProtection !== undefined) { - bodyParams[ - "HlsContentProtection" - ] = serializeAws_restJson1_1HlsContentProtection( - input.HlsContentProtection, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OutputKeys !== undefined) { - bodyParams["OutputKeys"] = serializeAws_restJson1_1OutputKeys( - input.OutputKeys, - context - ); - } - if (input.PlayReadyDrm !== undefined) { - bodyParams["PlayReadyDrm"] = serializeAws_restJson1_1PlayReadyDrm( - input.PlayReadyDrm, - context - ); - } - return bodyParams; + return { + ...(input.Format !== undefined && { Format: input.Format }), + ...(input.HlsContentProtection !== undefined && { + HlsContentProtection: serializeAws_restJson1_1HlsContentProtection( + input.HlsContentProtection, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.OutputKeys !== undefined && { + OutputKeys: serializeAws_restJson1_1OutputKeys(input.OutputKeys, context) + }), + ...(input.PlayReadyDrm !== undefined && { + PlayReadyDrm: serializeAws_restJson1_1PlayReadyDrm( + input.PlayReadyDrm, + context + ) + }) + }; }; const serializeAws_restJson1_1CreateJobPlaylists = ( @@ -3132,155 +3060,108 @@ const serializeAws_restJson1_1DetectedProperties = ( input: DetectedProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DurationMillis !== undefined) { - bodyParams["DurationMillis"] = input.DurationMillis; - } - if (input.FileSize !== undefined) { - bodyParams["FileSize"] = input.FileSize; - } - if (input.FrameRate !== undefined) { - bodyParams["FrameRate"] = input.FrameRate; - } - if (input.Height !== undefined) { - bodyParams["Height"] = input.Height; - } - if (input.Width !== undefined) { - bodyParams["Width"] = input.Width; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Encryption = ( input: Encryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InitializationVector !== undefined) { - bodyParams["InitializationVector"] = input.InitializationVector; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.KeyMd5 !== undefined) { - bodyParams["KeyMd5"] = input.KeyMd5; - } - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1HlsContentProtection = ( input: HlsContentProtection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InitializationVector !== undefined) { - bodyParams["InitializationVector"] = input.InitializationVector; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.KeyMd5 !== undefined) { - bodyParams["KeyMd5"] = input.KeyMd5; - } - if (input.KeyStoragePolicy !== undefined) { - bodyParams["KeyStoragePolicy"] = input.KeyStoragePolicy; - } - if (input.LicenseAcquisitionUrl !== undefined) { - bodyParams["LicenseAcquisitionUrl"] = input.LicenseAcquisitionUrl; - } - if (input.Method !== undefined) { - bodyParams["Method"] = input.Method; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1InputCaptions = ( input: InputCaptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionSources !== undefined) { - bodyParams["CaptionSources"] = serializeAws_restJson1_1CaptionSources( - input.CaptionSources, - context - ); - } - if (input.MergePolicy !== undefined) { - bodyParams["MergePolicy"] = input.MergePolicy; - } - return bodyParams; + return { + ...(input.CaptionSources !== undefined && { + CaptionSources: serializeAws_restJson1_1CaptionSources( + input.CaptionSources, + context + ) + }), + ...(input.MergePolicy !== undefined && { MergePolicy: input.MergePolicy }) + }; }; const serializeAws_restJson1_1JobAlbumArt = ( input: JobAlbumArt, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Artwork !== undefined) { - bodyParams["Artwork"] = serializeAws_restJson1_1Artworks( - input.Artwork, - context - ); - } - if (input.MergePolicy !== undefined) { - bodyParams["MergePolicy"] = input.MergePolicy; - } - return bodyParams; + return { + ...(input.Artwork !== undefined && { + Artwork: serializeAws_restJson1_1Artworks(input.Artwork, context) + }), + ...(input.MergePolicy !== undefined && { MergePolicy: input.MergePolicy }) + }; }; const serializeAws_restJson1_1JobInput = ( input: JobInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AspectRatio !== undefined) { - bodyParams["AspectRatio"] = input.AspectRatio; - } - if (input.Container !== undefined) { - bodyParams["Container"] = input.Container; - } - if (input.DetectedProperties !== undefined) { - bodyParams[ - "DetectedProperties" - ] = serializeAws_restJson1_1DetectedProperties( - input.DetectedProperties, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.FrameRate !== undefined) { - bodyParams["FrameRate"] = input.FrameRate; - } - if (input.InputCaptions !== undefined) { - bodyParams["InputCaptions"] = serializeAws_restJson1_1InputCaptions( - input.InputCaptions, - context - ); - } - if (input.Interlaced !== undefined) { - bodyParams["Interlaced"] = input.Interlaced; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Resolution !== undefined) { - bodyParams["Resolution"] = input.Resolution; - } - if (input.TimeSpan !== undefined) { - bodyParams["TimeSpan"] = serializeAws_restJson1_1TimeSpan( - input.TimeSpan, - context - ); - } - return bodyParams; + return { + ...(input.AspectRatio !== undefined && { AspectRatio: input.AspectRatio }), + ...(input.Container !== undefined && { Container: input.Container }), + ...(input.DetectedProperties !== undefined && { + DetectedProperties: serializeAws_restJson1_1DetectedProperties( + input.DetectedProperties, + context + ) + }), + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(input.Encryption, context) + }), + ...(input.FrameRate !== undefined && { FrameRate: input.FrameRate }), + ...(input.InputCaptions !== undefined && { + InputCaptions: serializeAws_restJson1_1InputCaptions( + 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_restJson1_1TimeSpan(input.TimeSpan, context) + }) + }; }; const serializeAws_restJson1_1JobInputs = ( @@ -3294,20 +3175,15 @@ const serializeAws_restJson1_1JobWatermark = ( input: JobWatermark, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.InputKey !== undefined) { - bodyParams["InputKey"] = input.InputKey; - } - if (input.PresetWatermarkId !== undefined) { - bodyParams["PresetWatermarkId"] = input.PresetWatermarkId; - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(input.Encryption, context) + }), + ...(input.InputKey !== undefined && { InputKey: input.InputKey }), + ...(input.PresetWatermarkId !== undefined && { + PresetWatermarkId: input.PresetWatermarkId + }) + }; }; const serializeAws_restJson1_1JobWatermarks = ( @@ -3323,20 +3199,12 @@ const serializeAws_restJson1_1Notifications = ( input: Notifications, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Completed !== undefined) { - bodyParams["Completed"] = input.Completed; - } - if (input.Error !== undefined) { - bodyParams["Error"] = input.Error; - } - if (input.Progressing !== undefined) { - bodyParams["Progressing"] = input.Progressing; - } - if (input.Warning !== undefined) { - bodyParams["Warning"] = input.Warning; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1OutputKeys = ( @@ -3350,20 +3218,13 @@ const serializeAws_restJson1_1Permission = ( input: Permission, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Access !== undefined) { - bodyParams["Access"] = serializeAws_restJson1_1AccessControls( - input.Access, - context - ); - } - if (input.Grantee !== undefined) { - bodyParams["Grantee"] = input.Grantee; - } - if (input.GranteeType !== undefined) { - bodyParams["GranteeType"] = input.GranteeType; - } - return bodyParams; + return { + ...(input.Access !== undefined && { + Access: serializeAws_restJson1_1AccessControls(input.Access, context) + }), + ...(input.Grantee !== undefined && { Grantee: input.Grantee }), + ...(input.GranteeType !== undefined && { GranteeType: input.GranteeType }) + }; }; const serializeAws_restJson1_1Permissions = ( @@ -3377,84 +3238,64 @@ const serializeAws_restJson1_1PipelineOutputConfig = ( input: PipelineOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = serializeAws_restJson1_1Permissions( - input.Permissions, - context - ); - } - if (input.StorageClass !== undefined) { - bodyParams["StorageClass"] = input.StorageClass; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Permissions !== undefined && { + Permissions: serializeAws_restJson1_1Permissions( + input.Permissions, + context + ) + }), + ...(input.StorageClass !== undefined && { + StorageClass: input.StorageClass + }) + }; }; const serializeAws_restJson1_1PlayReadyDrm = ( input: PlayReadyDrm, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.InitializationVector !== undefined) { - bodyParams["InitializationVector"] = input.InitializationVector; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.KeyMd5 !== undefined) { - bodyParams["KeyMd5"] = input.KeyMd5; - } - if (input.LicenseAcquisitionUrl !== undefined) { - bodyParams["LicenseAcquisitionUrl"] = input.LicenseAcquisitionUrl; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1PresetWatermark = ( input: PresetWatermark, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HorizontalAlign !== undefined) { - bodyParams["HorizontalAlign"] = input.HorizontalAlign; - } - if (input.HorizontalOffset !== undefined) { - bodyParams["HorizontalOffset"] = input.HorizontalOffset; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.MaxHeight !== undefined) { - bodyParams["MaxHeight"] = input.MaxHeight; - } - if (input.MaxWidth !== undefined) { - bodyParams["MaxWidth"] = input.MaxWidth; - } - if (input.Opacity !== undefined) { - bodyParams["Opacity"] = input.Opacity; - } - if (input.SizingPolicy !== undefined) { - bodyParams["SizingPolicy"] = input.SizingPolicy; - } - if (input.Target !== undefined) { - bodyParams["Target"] = input.Target; - } - if (input.VerticalAlign !== undefined) { - bodyParams["VerticalAlign"] = input.VerticalAlign; - } - if (input.VerticalOffset !== undefined) { - bodyParams["VerticalOffset"] = input.VerticalOffset; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1PresetWatermarks = ( @@ -3477,46 +3318,30 @@ const serializeAws_restJson1_1Thumbnails = ( input: Thumbnails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AspectRatio !== undefined) { - bodyParams["AspectRatio"] = input.AspectRatio; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.Interval !== undefined) { - bodyParams["Interval"] = input.Interval; - } - if (input.MaxHeight !== undefined) { - bodyParams["MaxHeight"] = input.MaxHeight; - } - if (input.MaxWidth !== undefined) { - bodyParams["MaxWidth"] = input.MaxWidth; - } - if (input.PaddingPolicy !== undefined) { - bodyParams["PaddingPolicy"] = input.PaddingPolicy; - } - if (input.Resolution !== undefined) { - bodyParams["Resolution"] = input.Resolution; - } - if (input.SizingPolicy !== undefined) { - bodyParams["SizingPolicy"] = input.SizingPolicy; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1TimeSpan = ( input: TimeSpan, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = input.StartTime; - } - return bodyParams; + return { + ...(input.Duration !== undefined && { Duration: input.Duration }), + ...(input.StartTime !== undefined && { StartTime: input.StartTime }) + }; }; const serializeAws_restJson1_1UserMetadata = ( @@ -3533,59 +3358,43 @@ const serializeAws_restJson1_1VideoParameters = ( input: VideoParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AspectRatio !== undefined) { - bodyParams["AspectRatio"] = input.AspectRatio; - } - if (input.BitRate !== undefined) { - bodyParams["BitRate"] = input.BitRate; - } - if (input.Codec !== undefined) { - bodyParams["Codec"] = input.Codec; - } - if (input.CodecOptions !== undefined) { - bodyParams["CodecOptions"] = serializeAws_restJson1_1CodecOptions( - input.CodecOptions, - context - ); - } - if (input.DisplayAspectRatio !== undefined) { - bodyParams["DisplayAspectRatio"] = input.DisplayAspectRatio; - } - if (input.FixedGOP !== undefined) { - bodyParams["FixedGOP"] = input.FixedGOP; - } - if (input.FrameRate !== undefined) { - bodyParams["FrameRate"] = input.FrameRate; - } - if (input.KeyframesMaxDist !== undefined) { - bodyParams["KeyframesMaxDist"] = input.KeyframesMaxDist; - } - if (input.MaxFrameRate !== undefined) { - bodyParams["MaxFrameRate"] = input.MaxFrameRate; - } - if (input.MaxHeight !== undefined) { - bodyParams["MaxHeight"] = input.MaxHeight; - } - if (input.MaxWidth !== undefined) { - bodyParams["MaxWidth"] = input.MaxWidth; - } - if (input.PaddingPolicy !== undefined) { - bodyParams["PaddingPolicy"] = input.PaddingPolicy; - } - if (input.Resolution !== undefined) { - bodyParams["Resolution"] = input.Resolution; - } - if (input.SizingPolicy !== undefined) { - bodyParams["SizingPolicy"] = input.SizingPolicy; - } - if (input.Watermarks !== undefined) { - bodyParams["Watermarks"] = serializeAws_restJson1_1PresetWatermarks( - input.Watermarks, - context - ); - } - return bodyParams; + return { + ...(input.AspectRatio !== undefined && { AspectRatio: input.AspectRatio }), + ...(input.BitRate !== undefined && { BitRate: input.BitRate }), + ...(input.Codec !== undefined && { Codec: input.Codec }), + ...(input.CodecOptions !== undefined && { + CodecOptions: serializeAws_restJson1_1CodecOptions( + 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_restJson1_1PresetWatermarks( + input.Watermarks, + context + ) + }) + }; }; const deserializeAws_restJson1_1AccessControls = ( diff --git a/clients/client-elasticsearch-service/protocols/Aws_restJson1_1.ts b/clients/client-elasticsearch-service/protocols/Aws_restJson1_1.ts index 54a2520907d9..c44019876c23 100644 --- a/clients/client-elasticsearch-service/protocols/Aws_restJson1_1.ts +++ b/clients/client-elasticsearch-service/protocols/Aws_restJson1_1.ts @@ -3541,34 +3541,28 @@ const serializeAws_restJson1_1CognitoOptions = ( input: CognitoOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.IdentityPoolId !== undefined) { - bodyParams["IdentityPoolId"] = input.IdentityPoolId; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.UserPoolId !== undefined) { - bodyParams["UserPoolId"] = input.UserPoolId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DomainEndpointOptions = ( input: DomainEndpointOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnforceHTTPS !== undefined) { - bodyParams["EnforceHTTPS"] = input.EnforceHTTPS; - } - if (input.TLSSecurityPolicy !== undefined) { - bodyParams["TLSSecurityPolicy"] = input.TLSSecurityPolicy; - } - return bodyParams; + return { + ...(input.EnforceHTTPS !== undefined && { + EnforceHTTPS: input.EnforceHTTPS + }), + ...(input.TLSSecurityPolicy !== undefined && { + TLSSecurityPolicy: input.TLSSecurityPolicy + }) + }; }; const serializeAws_restJson1_1DomainNameList = ( @@ -3582,91 +3576,69 @@ const serializeAws_restJson1_1EBSOptions = ( input: EBSOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EBSEnabled !== undefined) { - bodyParams["EBSEnabled"] = input.EBSEnabled; - } - if (input.Iops !== undefined) { - bodyParams["Iops"] = input.Iops; - } - if (input.VolumeSize !== undefined) { - bodyParams["VolumeSize"] = input.VolumeSize; - } - if (input.VolumeType !== undefined) { - bodyParams["VolumeType"] = input.VolumeType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1ElasticsearchClusterConfig = ( input: ElasticsearchClusterConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DedicatedMasterCount !== undefined) { - bodyParams["DedicatedMasterCount"] = input.DedicatedMasterCount; - } - if (input.DedicatedMasterEnabled !== undefined) { - bodyParams["DedicatedMasterEnabled"] = input.DedicatedMasterEnabled; - } - if (input.DedicatedMasterType !== undefined) { - bodyParams["DedicatedMasterType"] = input.DedicatedMasterType; - } - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.WarmCount !== undefined) { - bodyParams["WarmCount"] = input.WarmCount; - } - if (input.WarmEnabled !== undefined) { - bodyParams["WarmEnabled"] = input.WarmEnabled; - } - if (input.WarmType !== undefined) { - bodyParams["WarmType"] = input.WarmType; - } - if (input.ZoneAwarenessConfig !== undefined) { - bodyParams[ - "ZoneAwarenessConfig" - ] = serializeAws_restJson1_1ZoneAwarenessConfig( - input.ZoneAwarenessConfig, - context - ); - } - if (input.ZoneAwarenessEnabled !== undefined) { - bodyParams["ZoneAwarenessEnabled"] = input.ZoneAwarenessEnabled; - } - return bodyParams; + 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_restJson1_1ZoneAwarenessConfig( + input.ZoneAwarenessConfig, + context + ) + }), + ...(input.ZoneAwarenessEnabled !== undefined && { + ZoneAwarenessEnabled: input.ZoneAwarenessEnabled + }) + }; }; const serializeAws_restJson1_1EncryptionAtRestOptions = ( input: EncryptionAtRestOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }) + }; }; const serializeAws_restJson1_1LogPublishingOption = ( input: LogPublishingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogsLogGroupArn !== undefined) { - bodyParams["CloudWatchLogsLogGroupArn"] = input.CloudWatchLogsLogGroupArn; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.CloudWatchLogsLogGroupArn !== undefined && { + CloudWatchLogsLogGroupArn: input.CloudWatchLogsLogGroupArn + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_restJson1_1LogPublishingOptions = ( @@ -3683,22 +3655,20 @@ const serializeAws_restJson1_1NodeToNodeEncryptionOptions = ( input: NodeToNodeEncryptionOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_restJson1_1SnapshotOptions = ( input: SnapshotOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomatedSnapshotStartHour !== undefined) { - bodyParams["AutomatedSnapshotStartHour"] = input.AutomatedSnapshotStartHour; - } - return bodyParams; + return { + ...(input.AutomatedSnapshotStartHour !== undefined && { + AutomatedSnapshotStartHour: input.AutomatedSnapshotStartHour + }) + }; }; const serializeAws_restJson1_1StringList = ( @@ -3712,14 +3682,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagList = ( @@ -3733,31 +3699,28 @@ const serializeAws_restJson1_1VPCOptions = ( input: VPCOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_restJson1_1StringList( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_restJson1_1StringList( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_restJson1_1StringList( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_restJson1_1StringList(input.SubnetIds, context) + }) + }; }; const serializeAws_restJson1_1ZoneAwarenessConfig = ( input: ZoneAwarenessConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZoneCount !== undefined) { - bodyParams["AvailabilityZoneCount"] = input.AvailabilityZoneCount; - } - return bodyParams; + return { + ...(input.AvailabilityZoneCount !== undefined && { + AvailabilityZoneCount: input.AvailabilityZoneCount + }) + }; }; const deserializeAws_restJson1_1AccessPoliciesStatus = ( diff --git a/clients/client-emr/protocols/Aws_json1_1.ts b/clients/client-emr/protocols/Aws_json1_1.ts index 258844179b73..5d34053fa53f 100644 --- a/clients/client-emr/protocols/Aws_json1_1.ts +++ b/clients/client-emr/protocols/Aws_json1_1.ts @@ -2803,88 +2803,73 @@ const serializeAws_json1_1AddInstanceFleetInput = ( input: AddInstanceFleetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.InstanceFleet !== undefined) { - bodyParams["InstanceFleet"] = serializeAws_json1_1InstanceFleetConfig( - input.InstanceFleet, - context - ); - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.InstanceFleet !== undefined && { + InstanceFleet: serializeAws_json1_1InstanceFleetConfig( + input.InstanceFleet, + context + ) + }) + }; }; const serializeAws_json1_1AddInstanceGroupsInput = ( input: AddInstanceGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceGroups !== undefined) { - bodyParams["InstanceGroups"] = serializeAws_json1_1InstanceGroupConfigList( - input.InstanceGroups, - context - ); - } - if (input.JobFlowId !== undefined) { - bodyParams["JobFlowId"] = input.JobFlowId; - } - return bodyParams; + return { + ...(input.InstanceGroups !== undefined && { + InstanceGroups: serializeAws_json1_1InstanceGroupConfigList( + input.InstanceGroups, + context + ) + }), + ...(input.JobFlowId !== undefined && { JobFlowId: input.JobFlowId }) + }; }; const serializeAws_json1_1AddJobFlowStepsInput = ( input: AddJobFlowStepsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobFlowId !== undefined) { - bodyParams["JobFlowId"] = input.JobFlowId; - } - if (input.Steps !== undefined) { - bodyParams["Steps"] = serializeAws_json1_1StepConfigList( - input.Steps, - context - ); - } - return bodyParams; + return { + ...(input.JobFlowId !== undefined && { JobFlowId: input.JobFlowId }), + ...(input.Steps !== undefined && { + Steps: serializeAws_json1_1StepConfigList(input.Steps, context) + }) + }; }; const serializeAws_json1_1AddTagsInput = ( input: AddTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1Application = ( input: Application, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalInfo !== undefined) { - bodyParams["AdditionalInfo"] = serializeAws_json1_1StringMap( - input.AdditionalInfo, - context - ); - } - if (input.Args !== undefined) { - bodyParams["Args"] = serializeAws_json1_1StringList(input.Args, context); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ApplicationList = ( @@ -2898,74 +2883,61 @@ const serializeAws_json1_1AutoScalingPolicy = ( input: AutoScalingPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Constraints !== undefined) { - bodyParams["Constraints"] = serializeAws_json1_1ScalingConstraints( - input.Constraints, - context - ); - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1ScalingRuleList( - input.Rules, - context - ); - } - return bodyParams; + return { + ...(input.Constraints !== undefined && { + Constraints: serializeAws_json1_1ScalingConstraints( + input.Constraints, + context + ) + }), + ...(input.Rules !== undefined && { + Rules: serializeAws_json1_1ScalingRuleList(input.Rules, context) + }) + }; }; const serializeAws_json1_1BlockPublicAccessConfiguration = ( input: BlockPublicAccessConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockPublicSecurityGroupRules !== undefined) { - bodyParams["BlockPublicSecurityGroupRules"] = - input.BlockPublicSecurityGroupRules; - } - if (input.Classification !== undefined) { - bodyParams["Classification"] = input.Classification; - } - if (input.Configurations !== undefined) { - bodyParams["Configurations"] = serializeAws_json1_1ConfigurationList( - input.Configurations, - context - ); - } - if (input.PermittedPublicSecurityGroupRuleRanges !== undefined) { - bodyParams[ - "PermittedPublicSecurityGroupRuleRanges" - ] = serializeAws_json1_1PortRanges( - input.PermittedPublicSecurityGroupRuleRanges, - context - ); - } - if (input.Properties !== undefined) { - bodyParams["Properties"] = serializeAws_json1_1StringMap( - input.Properties, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1BootstrapActionConfig = ( input: BootstrapActionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ScriptBootstrapAction !== undefined) { - bodyParams[ - "ScriptBootstrapAction" - ] = serializeAws_json1_1ScriptBootstrapActionConfig( - input.ScriptBootstrapAction, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ScriptBootstrapAction !== undefined && { + ScriptBootstrapAction: serializeAws_json1_1ScriptBootstrapActionConfig( + input.ScriptBootstrapAction, + context + ) + }) + }; }; const serializeAws_json1_1BootstrapActionConfigList = ( @@ -2981,58 +2953,41 @@ const serializeAws_json1_1CancelStepsInput = ( input: CancelStepsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.StepCancellationOption !== undefined) { - bodyParams["StepCancellationOption"] = input.StepCancellationOption; - } - if (input.StepIds !== undefined) { - bodyParams["StepIds"] = serializeAws_json1_1StepIdsList( - input.StepIds, - context - ); - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.StepCancellationOption !== undefined && { + StepCancellationOption: input.StepCancellationOption + }), + ...(input.StepIds !== undefined && { + StepIds: serializeAws_json1_1StepIdsList(input.StepIds, context) + }) + }; }; const serializeAws_json1_1CloudWatchAlarmDefinition = ( input: CloudWatchAlarmDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_json1_1MetricDimensionList( - input.Dimensions, - context - ); - } - if (input.EvaluationPeriods !== undefined) { - bodyParams["EvaluationPeriods"] = input.EvaluationPeriods; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Namespace !== undefined) { - bodyParams["Namespace"] = input.Namespace; - } - if (input.Period !== undefined) { - bodyParams["Period"] = input.Period; - } - if (input.Statistic !== undefined) { - bodyParams["Statistic"] = input.Statistic; - } - if (input.Threshold !== undefined) { - bodyParams["Threshold"] = input.Threshold; - } - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ClusterStateList = ( @@ -3046,23 +3001,20 @@ const serializeAws_json1_1Configuration = ( input: Configuration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classification !== undefined) { - bodyParams["Classification"] = input.Classification; - } - if (input.Configurations !== undefined) { - bodyParams["Configurations"] = serializeAws_json1_1ConfigurationList( - input.Configurations, - context - ); - } - if (input.Properties !== undefined) { - bodyParams["Properties"] = serializeAws_json1_1StringMap( - input.Properties, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ConfigurationList = ( @@ -3076,91 +3028,72 @@ const serializeAws_json1_1CreateSecurityConfigurationInput = ( input: CreateSecurityConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SecurityConfiguration !== undefined && { + SecurityConfiguration: input.SecurityConfiguration + }) + }; }; const serializeAws_json1_1DeleteSecurityConfigurationInput = ( input: DeleteSecurityConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeClusterInput = ( input: DescribeClusterInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }) + }; }; const serializeAws_json1_1DescribeJobFlowsInput = ( input: DescribeJobFlowsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedAfter !== undefined) { - bodyParams["CreatedAfter"] = Math.round( - input.CreatedAfter.getTime() / 1000 - ); - } - if (input.CreatedBefore !== undefined) { - bodyParams["CreatedBefore"] = Math.round( - input.CreatedBefore.getTime() / 1000 - ); - } - if (input.JobFlowIds !== undefined) { - bodyParams["JobFlowIds"] = serializeAws_json1_1XmlStringList( - input.JobFlowIds, - context - ); - } - if (input.JobFlowStates !== undefined) { - bodyParams["JobFlowStates"] = serializeAws_json1_1JobFlowExecutionStateList( - input.JobFlowStates, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeSecurityConfigurationInput = ( input: DescribeSecurityConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeStepInput = ( input: DescribeStepInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.StepId !== undefined) { - bodyParams["StepId"] = input.StepId; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.StepId !== undefined && { StepId: input.StepId }) + }; }; const serializeAws_json1_1EC2InstanceIdsList = ( @@ -3181,17 +3114,17 @@ const serializeAws_json1_1EbsBlockDeviceConfig = ( input: EbsBlockDeviceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeSpecification !== undefined) { - bodyParams["VolumeSpecification"] = serializeAws_json1_1VolumeSpecification( - input.VolumeSpecification, - context - ); - } - if (input.VolumesPerInstance !== undefined) { - bodyParams["VolumesPerInstance"] = input.VolumesPerInstance; - } - return bodyParams; + return { + ...(input.VolumeSpecification !== undefined && { + VolumeSpecification: serializeAws_json1_1VolumeSpecification( + input.VolumeSpecification, + context + ) + }), + ...(input.VolumesPerInstance !== undefined && { + VolumesPerInstance: input.VolumesPerInstance + }) + }; }; const serializeAws_json1_1EbsBlockDeviceConfigList = ( @@ -3207,86 +3140,70 @@ const serializeAws_json1_1EbsConfiguration = ( input: EbsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EbsBlockDeviceConfigs !== undefined) { - bodyParams[ - "EbsBlockDeviceConfigs" - ] = serializeAws_json1_1EbsBlockDeviceConfigList( - input.EbsBlockDeviceConfigs, - context - ); - } - if (input.EbsOptimized !== undefined) { - bodyParams["EbsOptimized"] = input.EbsOptimized; - } - return bodyParams; + return { + ...(input.EbsBlockDeviceConfigs !== undefined && { + EbsBlockDeviceConfigs: serializeAws_json1_1EbsBlockDeviceConfigList( + input.EbsBlockDeviceConfigs, + context + ) + }), + ...(input.EbsOptimized !== undefined && { + EbsOptimized: input.EbsOptimized + }) + }; }; const serializeAws_json1_1GetBlockPublicAccessConfigurationInput = ( input: GetBlockPublicAccessConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1HadoopJarStepConfig = ( input: HadoopJarStepConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Args !== undefined) { - bodyParams["Args"] = serializeAws_json1_1XmlStringList(input.Args, context); - } - if (input.Jar !== undefined) { - bodyParams["Jar"] = input.Jar; - } - if (input.MainClass !== undefined) { - bodyParams["MainClass"] = input.MainClass; - } - if (input.Properties !== undefined) { - bodyParams["Properties"] = serializeAws_json1_1KeyValueList( - input.Properties, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1InstanceFleetConfig = ( input: InstanceFleetConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceFleetType !== undefined) { - bodyParams["InstanceFleetType"] = input.InstanceFleetType; - } - if (input.InstanceTypeConfigs !== undefined) { - bodyParams[ - "InstanceTypeConfigs" - ] = serializeAws_json1_1InstanceTypeConfigList( - input.InstanceTypeConfigs, - context - ); - } - if (input.LaunchSpecifications !== undefined) { - bodyParams[ - "LaunchSpecifications" - ] = serializeAws_json1_1InstanceFleetProvisioningSpecifications( - input.LaunchSpecifications, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.TargetOnDemandCapacity !== undefined) { - bodyParams["TargetOnDemandCapacity"] = input.TargetOnDemandCapacity; - } - if (input.TargetSpotCapacity !== undefined) { - bodyParams["TargetSpotCapacity"] = input.TargetSpotCapacity; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1InstanceFleetConfigList = ( @@ -3302,77 +3219,69 @@ const serializeAws_json1_1InstanceFleetModifyConfig = ( input: InstanceFleetModifyConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceFleetId !== undefined) { - bodyParams["InstanceFleetId"] = input.InstanceFleetId; - } - if (input.TargetOnDemandCapacity !== undefined) { - bodyParams["TargetOnDemandCapacity"] = input.TargetOnDemandCapacity; - } - if (input.TargetSpotCapacity !== undefined) { - bodyParams["TargetSpotCapacity"] = input.TargetSpotCapacity; - } - return bodyParams; + return { + ...(input.InstanceFleetId !== undefined && { + InstanceFleetId: input.InstanceFleetId + }), + ...(input.TargetOnDemandCapacity !== undefined && { + TargetOnDemandCapacity: input.TargetOnDemandCapacity + }), + ...(input.TargetSpotCapacity !== undefined && { + TargetSpotCapacity: input.TargetSpotCapacity + }) + }; }; const serializeAws_json1_1InstanceFleetProvisioningSpecifications = ( input: InstanceFleetProvisioningSpecifications, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpotSpecification !== undefined) { - bodyParams[ - "SpotSpecification" - ] = serializeAws_json1_1SpotProvisioningSpecification( - input.SpotSpecification, - context - ); - } - return bodyParams; + return { + ...(input.SpotSpecification !== undefined && { + SpotSpecification: serializeAws_json1_1SpotProvisioningSpecification( + input.SpotSpecification, + context + ) + }) + }; }; const serializeAws_json1_1InstanceGroupConfig = ( input: InstanceGroupConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoScalingPolicy !== undefined) { - bodyParams["AutoScalingPolicy"] = serializeAws_json1_1AutoScalingPolicy( - input.AutoScalingPolicy, - context - ); - } - if (input.BidPrice !== undefined) { - bodyParams["BidPrice"] = input.BidPrice; - } - if (input.Configurations !== undefined) { - bodyParams["Configurations"] = serializeAws_json1_1ConfigurationList( - input.Configurations, - context - ); - } - if (input.EbsConfiguration !== undefined) { - bodyParams["EbsConfiguration"] = serializeAws_json1_1EbsConfiguration( - input.EbsConfiguration, - context - ); - } - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceRole !== undefined) { - bodyParams["InstanceRole"] = input.InstanceRole; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.Market !== undefined) { - bodyParams["Market"] = input.Market; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1InstanceGroupConfigList = ( @@ -3388,34 +3297,32 @@ const serializeAws_json1_1InstanceGroupModifyConfig = ( input: InstanceGroupModifyConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configurations !== undefined) { - bodyParams["Configurations"] = serializeAws_json1_1ConfigurationList( - input.Configurations, - context - ); - } - if (input.EC2InstanceIdsToTerminate !== undefined) { - bodyParams[ - "EC2InstanceIdsToTerminate" - ] = serializeAws_json1_1EC2InstanceIdsToTerminateList( - input.EC2InstanceIdsToTerminate, - context - ); - } - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceGroupId !== undefined) { - bodyParams["InstanceGroupId"] = input.InstanceGroupId; - } - if (input.ShrinkPolicy !== undefined) { - bodyParams["ShrinkPolicy"] = serializeAws_json1_1ShrinkPolicy( - input.ShrinkPolicy, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1InstanceGroupModifyConfigList = ( @@ -3438,23 +3345,23 @@ const serializeAws_json1_1InstanceResizePolicy = ( input: InstanceResizePolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceTerminationTimeout !== undefined) { - bodyParams["InstanceTerminationTimeout"] = input.InstanceTerminationTimeout; - } - if (input.InstancesToProtect !== undefined) { - bodyParams["InstancesToProtect"] = serializeAws_json1_1EC2InstanceIdsList( - input.InstancesToProtect, - context - ); - } - if (input.InstancesToTerminate !== undefined) { - bodyParams["InstancesToTerminate"] = serializeAws_json1_1EC2InstanceIdsList( - input.InstancesToTerminate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1InstanceStateList = ( @@ -3468,33 +3375,31 @@ const serializeAws_json1_1InstanceTypeConfig = ( input: InstanceTypeConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BidPrice !== undefined) { - bodyParams["BidPrice"] = input.BidPrice; - } - if (input.BidPriceAsPercentageOfOnDemandPrice !== undefined) { - bodyParams["BidPriceAsPercentageOfOnDemandPrice"] = - input.BidPriceAsPercentageOfOnDemandPrice; - } - if (input.Configurations !== undefined) { - bodyParams["Configurations"] = serializeAws_json1_1ConfigurationList( - input.Configurations, - context - ); - } - if (input.EbsConfiguration !== undefined) { - bodyParams["EbsConfiguration"] = serializeAws_json1_1EbsConfiguration( - input.EbsConfiguration, - context - ); - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.WeightedCapacity !== undefined) { - bodyParams["WeightedCapacity"] = input.WeightedCapacity; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1InstanceTypeConfigList = ( @@ -3517,122 +3422,101 @@ const serializeAws_json1_1JobFlowInstancesConfig = ( input: JobFlowInstancesConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalMasterSecurityGroups !== undefined) { - bodyParams[ - "AdditionalMasterSecurityGroups" - ] = serializeAws_json1_1SecurityGroupsList( - input.AdditionalMasterSecurityGroups, - context - ); - } - if (input.AdditionalSlaveSecurityGroups !== undefined) { - bodyParams[ - "AdditionalSlaveSecurityGroups" - ] = serializeAws_json1_1SecurityGroupsList( - input.AdditionalSlaveSecurityGroups, - context - ); - } - if (input.Ec2KeyName !== undefined) { - bodyParams["Ec2KeyName"] = input.Ec2KeyName; - } - if (input.Ec2SubnetId !== undefined) { - bodyParams["Ec2SubnetId"] = input.Ec2SubnetId; - } - if (input.Ec2SubnetIds !== undefined) { - bodyParams["Ec2SubnetIds"] = serializeAws_json1_1XmlStringMaxLen256List( - input.Ec2SubnetIds, - context - ); - } - if (input.EmrManagedMasterSecurityGroup !== undefined) { - bodyParams["EmrManagedMasterSecurityGroup"] = - input.EmrManagedMasterSecurityGroup; - } - if (input.EmrManagedSlaveSecurityGroup !== undefined) { - bodyParams["EmrManagedSlaveSecurityGroup"] = - input.EmrManagedSlaveSecurityGroup; - } - if (input.HadoopVersion !== undefined) { - bodyParams["HadoopVersion"] = input.HadoopVersion; - } - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceFleets !== undefined) { - bodyParams["InstanceFleets"] = serializeAws_json1_1InstanceFleetConfigList( - input.InstanceFleets, - context - ); - } - if (input.InstanceGroups !== undefined) { - bodyParams["InstanceGroups"] = serializeAws_json1_1InstanceGroupConfigList( - input.InstanceGroups, - context - ); - } - if (input.KeepJobFlowAliveWhenNoSteps !== undefined) { - bodyParams["KeepJobFlowAliveWhenNoSteps"] = - input.KeepJobFlowAliveWhenNoSteps; - } - if (input.MasterInstanceType !== undefined) { - bodyParams["MasterInstanceType"] = input.MasterInstanceType; - } - if (input.Placement !== undefined) { - bodyParams["Placement"] = serializeAws_json1_1PlacementType( - input.Placement, - context - ); - } - if (input.ServiceAccessSecurityGroup !== undefined) { - bodyParams["ServiceAccessSecurityGroup"] = input.ServiceAccessSecurityGroup; - } - if (input.SlaveInstanceType !== undefined) { - bodyParams["SlaveInstanceType"] = input.SlaveInstanceType; - } - if (input.TerminationProtected !== undefined) { - bodyParams["TerminationProtected"] = input.TerminationProtected; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1KerberosAttributes = ( input: KerberosAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ADDomainJoinPassword !== undefined) { - bodyParams["ADDomainJoinPassword"] = input.ADDomainJoinPassword; - } - if (input.ADDomainJoinUser !== undefined) { - bodyParams["ADDomainJoinUser"] = input.ADDomainJoinUser; - } - if (input.CrossRealmTrustPrincipalPassword !== undefined) { - bodyParams["CrossRealmTrustPrincipalPassword"] = - input.CrossRealmTrustPrincipalPassword; - } - if (input.KdcAdminPassword !== undefined) { - bodyParams["KdcAdminPassword"] = input.KdcAdminPassword; - } - if (input.Realm !== undefined) { - bodyParams["Realm"] = input.Realm; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1KeyValue = ( input: KeyValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1KeyValueList = ( @@ -3646,157 +3530,117 @@ const serializeAws_json1_1ListBootstrapActionsInput = ( input: ListBootstrapActionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListClustersInput = ( input: ListClustersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterStates !== undefined) { - bodyParams["ClusterStates"] = serializeAws_json1_1ClusterStateList( - input.ClusterStates, - context - ); - } - if (input.CreatedAfter !== undefined) { - bodyParams["CreatedAfter"] = Math.round( - input.CreatedAfter.getTime() / 1000 - ); - } - if (input.CreatedBefore !== undefined) { - bodyParams["CreatedBefore"] = Math.round( - input.CreatedBefore.getTime() / 1000 - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListInstanceFleetsInput = ( input: ListInstanceFleetsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListInstanceGroupsInput = ( input: ListInstanceGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListInstancesInput = ( input: ListInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.InstanceFleetId !== undefined) { - bodyParams["InstanceFleetId"] = input.InstanceFleetId; - } - if (input.InstanceFleetType !== undefined) { - bodyParams["InstanceFleetType"] = input.InstanceFleetType; - } - if (input.InstanceGroupId !== undefined) { - bodyParams["InstanceGroupId"] = input.InstanceGroupId; - } - if (input.InstanceGroupTypes !== undefined) { - bodyParams[ - "InstanceGroupTypes" - ] = serializeAws_json1_1InstanceGroupTypeList( - input.InstanceGroupTypes, - context - ); - } - if (input.InstanceStates !== undefined) { - bodyParams["InstanceStates"] = serializeAws_json1_1InstanceStateList( - input.InstanceStates, - context - ); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListSecurityConfigurationsInput = ( input: ListSecurityConfigurationsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListStepsInput = ( input: ListStepsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.StepIds !== undefined) { - bodyParams["StepIds"] = serializeAws_json1_1XmlStringList( - input.StepIds, - context - ); - } - if (input.StepStates !== undefined) { - bodyParams["StepStates"] = serializeAws_json1_1StepStateList( - input.StepStates, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1MetricDimension = ( input: MetricDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1MetricDimensionList = ( @@ -3812,50 +3656,42 @@ const serializeAws_json1_1ModifyClusterInput = ( input: ModifyClusterInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.StepConcurrencyLevel !== undefined) { - bodyParams["StepConcurrencyLevel"] = input.StepConcurrencyLevel; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.StepConcurrencyLevel !== undefined && { + StepConcurrencyLevel: input.StepConcurrencyLevel + }) + }; }; const serializeAws_json1_1ModifyInstanceFleetInput = ( input: ModifyInstanceFleetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.InstanceFleet !== undefined) { - bodyParams["InstanceFleet"] = serializeAws_json1_1InstanceFleetModifyConfig( - input.InstanceFleet, - context - ); - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.InstanceFleet !== undefined && { + InstanceFleet: serializeAws_json1_1InstanceFleetModifyConfig( + input.InstanceFleet, + context + ) + }) + }; }; const serializeAws_json1_1ModifyInstanceGroupsInput = ( input: ModifyInstanceGroupsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.InstanceGroups !== undefined) { - bodyParams[ - "InstanceGroups" - ] = serializeAws_json1_1InstanceGroupModifyConfigList( - input.InstanceGroups, - context - ); - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.InstanceGroups !== undefined && { + InstanceGroups: serializeAws_json1_1InstanceGroupModifyConfigList( + input.InstanceGroups, + context + ) + }) + }; }; const serializeAws_json1_1NewSupportedProductsList = ( @@ -3871,33 +3707,27 @@ const serializeAws_json1_1PlacementType = ( input: PlacementType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.AvailabilityZones !== undefined) { - bodyParams[ - "AvailabilityZones" - ] = serializeAws_json1_1XmlStringMaxLen256List( - input.AvailabilityZones, - context - ); - } - return bodyParams; + return { + ...(input.AvailabilityZone !== undefined && { + AvailabilityZone: input.AvailabilityZone + }), + ...(input.AvailabilityZones !== undefined && { + AvailabilityZones: serializeAws_json1_1XmlStringMaxLen256List( + input.AvailabilityZones, + context + ) + }) + }; }; const serializeAws_json1_1PortRange = ( input: PortRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxRange !== undefined) { - bodyParams["MaxRange"] = input.MaxRange; - } - if (input.MinRange !== undefined) { - bodyParams["MinRange"] = input.MinRange; - } - return bodyParams; + return { + ...(input.MaxRange !== undefined && { MaxRange: input.MaxRange }), + ...(input.MinRange !== undefined && { MinRange: input.MinRange }) + }; }; const serializeAws_json1_1PortRanges = ( @@ -3911,234 +3741,186 @@ const serializeAws_json1_1PutAutoScalingPolicyInput = ( input: PutAutoScalingPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoScalingPolicy !== undefined) { - bodyParams["AutoScalingPolicy"] = serializeAws_json1_1AutoScalingPolicy( - input.AutoScalingPolicy, - context - ); - } - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.InstanceGroupId !== undefined) { - bodyParams["InstanceGroupId"] = input.InstanceGroupId; - } - return bodyParams; + return { + ...(input.AutoScalingPolicy !== undefined && { + AutoScalingPolicy: serializeAws_json1_1AutoScalingPolicy( + input.AutoScalingPolicy, + context + ) + }), + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.InstanceGroupId !== undefined && { + InstanceGroupId: input.InstanceGroupId + }) + }; }; const serializeAws_json1_1PutBlockPublicAccessConfigurationInput = ( input: PutBlockPublicAccessConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockPublicAccessConfiguration !== undefined) { - bodyParams[ - "BlockPublicAccessConfiguration" - ] = serializeAws_json1_1BlockPublicAccessConfiguration( - input.BlockPublicAccessConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.BlockPublicAccessConfiguration !== undefined && { + BlockPublicAccessConfiguration: serializeAws_json1_1BlockPublicAccessConfiguration( + input.BlockPublicAccessConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1RemoveAutoScalingPolicyInput = ( input: RemoveAutoScalingPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.InstanceGroupId !== undefined) { - bodyParams["InstanceGroupId"] = input.InstanceGroupId; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.InstanceGroupId !== undefined && { + InstanceGroupId: input.InstanceGroupId + }) + }; }; const serializeAws_json1_1RemoveTagsInput = ( input: RemoveTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1StringList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1StringList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1RunJobFlowInput = ( input: RunJobFlowInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalInfo !== undefined) { - bodyParams["AdditionalInfo"] = input.AdditionalInfo; - } - if (input.AmiVersion !== undefined) { - bodyParams["AmiVersion"] = input.AmiVersion; - } - if (input.Applications !== undefined) { - bodyParams["Applications"] = serializeAws_json1_1ApplicationList( - input.Applications, - context - ); - } - if (input.AutoScalingRole !== undefined) { - bodyParams["AutoScalingRole"] = input.AutoScalingRole; - } - if (input.BootstrapActions !== undefined) { - bodyParams[ - "BootstrapActions" - ] = serializeAws_json1_1BootstrapActionConfigList( - input.BootstrapActions, - context - ); - } - if (input.Configurations !== undefined) { - bodyParams["Configurations"] = serializeAws_json1_1ConfigurationList( - input.Configurations, - context - ); - } - if (input.CustomAmiId !== undefined) { - bodyParams["CustomAmiId"] = input.CustomAmiId; - } - if (input.EbsRootVolumeSize !== undefined) { - bodyParams["EbsRootVolumeSize"] = input.EbsRootVolumeSize; - } - if (input.Instances !== undefined) { - bodyParams["Instances"] = serializeAws_json1_1JobFlowInstancesConfig( - input.Instances, - context - ); - } - if (input.JobFlowRole !== undefined) { - bodyParams["JobFlowRole"] = input.JobFlowRole; - } - if (input.KerberosAttributes !== undefined) { - bodyParams["KerberosAttributes"] = serializeAws_json1_1KerberosAttributes( - input.KerberosAttributes, - context - ); - } - if (input.LogUri !== undefined) { - bodyParams["LogUri"] = input.LogUri; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NewSupportedProducts !== undefined) { - bodyParams[ - "NewSupportedProducts" - ] = serializeAws_json1_1NewSupportedProductsList( - input.NewSupportedProducts, - context - ); - } - if (input.ReleaseLabel !== undefined) { - bodyParams["ReleaseLabel"] = input.ReleaseLabel; - } - if (input.RepoUpgradeOnBoot !== undefined) { - bodyParams["RepoUpgradeOnBoot"] = input.RepoUpgradeOnBoot; - } - if (input.ScaleDownBehavior !== undefined) { - bodyParams["ScaleDownBehavior"] = input.ScaleDownBehavior; - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - if (input.ServiceRole !== undefined) { - bodyParams["ServiceRole"] = input.ServiceRole; - } - if (input.StepConcurrencyLevel !== undefined) { - bodyParams["StepConcurrencyLevel"] = input.StepConcurrencyLevel; - } - if (input.Steps !== undefined) { - bodyParams["Steps"] = serializeAws_json1_1StepConfigList( - input.Steps, - context - ); - } - if (input.SupportedProducts !== undefined) { - bodyParams["SupportedProducts"] = serializeAws_json1_1SupportedProductsList( - input.SupportedProducts, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VisibleToAllUsers !== undefined) { - bodyParams["VisibleToAllUsers"] = input.VisibleToAllUsers; - } - return bodyParams; + 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.LogUri !== undefined && { LogUri: input.LogUri }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.NewSupportedProducts !== undefined && { + NewSupportedProducts: serializeAws_json1_1NewSupportedProductsList( + input.NewSupportedProducts, + 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 + }) + }; }; const serializeAws_json1_1ScalingAction = ( input: ScalingAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Market !== undefined) { - bodyParams["Market"] = input.Market; - } - if (input.SimpleScalingPolicyConfiguration !== undefined) { - bodyParams[ - "SimpleScalingPolicyConfiguration" - ] = serializeAws_json1_1SimpleScalingPolicyConfiguration( - input.SimpleScalingPolicyConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.Market !== undefined && { Market: input.Market }), + ...(input.SimpleScalingPolicyConfiguration !== undefined && { + SimpleScalingPolicyConfiguration: serializeAws_json1_1SimpleScalingPolicyConfiguration( + input.SimpleScalingPolicyConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1ScalingConstraints = ( input: ScalingConstraints, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MinCapacity !== undefined) { - bodyParams["MinCapacity"] = input.MinCapacity; - } - return bodyParams; + return { + ...(input.MaxCapacity !== undefined && { MaxCapacity: input.MaxCapacity }), + ...(input.MinCapacity !== undefined && { MinCapacity: input.MinCapacity }) + }; }; const serializeAws_json1_1ScalingRule = ( input: ScalingRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = serializeAws_json1_1ScalingAction( - input.Action, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Trigger !== undefined) { - bodyParams["Trigger"] = serializeAws_json1_1ScalingTrigger( - input.Trigger, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ScalingRuleList = ( @@ -4152,30 +3934,26 @@ const serializeAws_json1_1ScalingTrigger = ( input: ScalingTrigger, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchAlarmDefinition !== undefined) { - bodyParams[ - "CloudWatchAlarmDefinition" - ] = serializeAws_json1_1CloudWatchAlarmDefinition( - input.CloudWatchAlarmDefinition, - context - ); - } - return bodyParams; + return { + ...(input.CloudWatchAlarmDefinition !== undefined && { + CloudWatchAlarmDefinition: serializeAws_json1_1CloudWatchAlarmDefinition( + input.CloudWatchAlarmDefinition, + context + ) + }) + }; }; const serializeAws_json1_1ScriptBootstrapActionConfig = ( input: ScriptBootstrapActionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Args !== undefined) { - bodyParams["Args"] = serializeAws_json1_1XmlStringList(input.Args, context); - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - return bodyParams; + return { + ...(input.Args !== undefined && { + Args: serializeAws_json1_1XmlStringList(input.Args, context) + }), + ...(input.Path !== undefined && { Path: input.Path }) + }; }; const serializeAws_json1_1SecurityGroupsList = ( @@ -4189,107 +3967,95 @@ const serializeAws_json1_1SetTerminationProtectionInput = ( input: SetTerminationProtectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobFlowIds !== undefined) { - bodyParams["JobFlowIds"] = serializeAws_json1_1XmlStringList( - input.JobFlowIds, - context - ); - } - if (input.TerminationProtected !== undefined) { - bodyParams["TerminationProtected"] = input.TerminationProtected; - } - return bodyParams; + return { + ...(input.JobFlowIds !== undefined && { + JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) + }), + ...(input.TerminationProtected !== undefined && { + TerminationProtected: input.TerminationProtected + }) + }; }; const serializeAws_json1_1SetVisibleToAllUsersInput = ( input: SetVisibleToAllUsersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobFlowIds !== undefined) { - bodyParams["JobFlowIds"] = serializeAws_json1_1XmlStringList( - input.JobFlowIds, - context - ); - } - if (input.VisibleToAllUsers !== undefined) { - bodyParams["VisibleToAllUsers"] = input.VisibleToAllUsers; - } - return bodyParams; + return { + ...(input.JobFlowIds !== undefined && { + JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) + }), + ...(input.VisibleToAllUsers !== undefined && { + VisibleToAllUsers: input.VisibleToAllUsers + }) + }; }; const serializeAws_json1_1ShrinkPolicy = ( input: ShrinkPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DecommissionTimeout !== undefined) { - bodyParams["DecommissionTimeout"] = input.DecommissionTimeout; - } - if (input.InstanceResizePolicy !== undefined) { - bodyParams[ - "InstanceResizePolicy" - ] = serializeAws_json1_1InstanceResizePolicy( - input.InstanceResizePolicy, - context - ); - } - return bodyParams; + return { + ...(input.DecommissionTimeout !== undefined && { + DecommissionTimeout: input.DecommissionTimeout + }), + ...(input.InstanceResizePolicy !== undefined && { + InstanceResizePolicy: serializeAws_json1_1InstanceResizePolicy( + input.InstanceResizePolicy, + context + ) + }) + }; }; const serializeAws_json1_1SimpleScalingPolicyConfiguration = ( input: SimpleScalingPolicyConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdjustmentType !== undefined) { - bodyParams["AdjustmentType"] = input.AdjustmentType; - } - if (input.CoolDown !== undefined) { - bodyParams["CoolDown"] = input.CoolDown; - } - if (input.ScalingAdjustment !== undefined) { - bodyParams["ScalingAdjustment"] = input.ScalingAdjustment; - } - return bodyParams; + return { + ...(input.AdjustmentType !== undefined && { + AdjustmentType: input.AdjustmentType + }), + ...(input.CoolDown !== undefined && { CoolDown: input.CoolDown }), + ...(input.ScalingAdjustment !== undefined && { + ScalingAdjustment: input.ScalingAdjustment + }) + }; }; const serializeAws_json1_1SpotProvisioningSpecification = ( input: SpotProvisioningSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockDurationMinutes !== undefined) { - bodyParams["BlockDurationMinutes"] = input.BlockDurationMinutes; - } - if (input.TimeoutAction !== undefined) { - bodyParams["TimeoutAction"] = input.TimeoutAction; - } - if (input.TimeoutDurationMinutes !== undefined) { - bodyParams["TimeoutDurationMinutes"] = input.TimeoutDurationMinutes; - } - return bodyParams; + return { + ...(input.BlockDurationMinutes !== undefined && { + BlockDurationMinutes: input.BlockDurationMinutes + }), + ...(input.TimeoutAction !== undefined && { + TimeoutAction: input.TimeoutAction + }), + ...(input.TimeoutDurationMinutes !== undefined && { + TimeoutDurationMinutes: input.TimeoutDurationMinutes + }) + }; }; const serializeAws_json1_1StepConfig = ( input: StepConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActionOnFailure !== undefined) { - bodyParams["ActionOnFailure"] = input.ActionOnFailure; - } - if (input.HadoopJarStep !== undefined) { - bodyParams["HadoopJarStep"] = serializeAws_json1_1HadoopJarStepConfig( - input.HadoopJarStep, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ActionOnFailure !== undefined && { + ActionOnFailure: input.ActionOnFailure + }), + ...(input.HadoopJarStep !== undefined && { + HadoopJarStep: serializeAws_json1_1HadoopJarStepConfig( + input.HadoopJarStep, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StepConfigList = ( @@ -4334,14 +4100,12 @@ const serializeAws_json1_1SupportedProductConfig = ( input: SupportedProductConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Args !== undefined) { - bodyParams["Args"] = serializeAws_json1_1XmlStringList(input.Args, context); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Args !== undefined && { + Args: serializeAws_json1_1XmlStringList(input.Args, context) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1SupportedProductsList = ( @@ -4352,14 +4116,10 @@ const serializeAws_json1_1SupportedProductsList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagList = ( @@ -4373,31 +4133,22 @@ const serializeAws_json1_1TerminateJobFlowsInput = ( input: TerminateJobFlowsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobFlowIds !== undefined) { - bodyParams["JobFlowIds"] = serializeAws_json1_1XmlStringList( - input.JobFlowIds, - context - ); - } - return bodyParams; + return { + ...(input.JobFlowIds !== undefined && { + JobFlowIds: serializeAws_json1_1XmlStringList(input.JobFlowIds, context) + }) + }; }; const serializeAws_json1_1VolumeSpecification = ( input: VolumeSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Iops !== undefined) { - bodyParams["Iops"] = input.Iops; - } - if (input.SizeInGB !== undefined) { - bodyParams["SizeInGB"] = input.SizeInGB; - } - if (input.VolumeType !== undefined) { - bodyParams["VolumeType"] = input.VolumeType; - } - return bodyParams; + return { + ...(input.Iops !== undefined && { Iops: input.Iops }), + ...(input.SizeInGB !== undefined && { SizeInGB: input.SizeInGB }), + ...(input.VolumeType !== undefined && { VolumeType: input.VolumeType }) + }; }; const serializeAws_json1_1XmlStringList = ( diff --git a/clients/client-eventbridge/protocols/Aws_json1_1.ts b/clients/client-eventbridge/protocols/Aws_json1_1.ts index a50c71250105..58f84eddf2c7 100644 --- a/clients/client-eventbridge/protocols/Aws_json1_1.ts +++ b/clients/client-eventbridge/protocols/Aws_json1_1.ts @@ -3299,286 +3299,231 @@ const serializeAws_json1_1ActivateEventSourceRequest = ( input: ActivateEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1AwsVpcConfiguration = ( input: AwsVpcConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignPublicIp !== undefined) { - bodyParams["AssignPublicIp"] = input.AssignPublicIp; - } - if (input.SecurityGroups !== undefined) { - bodyParams["SecurityGroups"] = serializeAws_json1_1StringList( - input.SecurityGroups, - context - ); - } - if (input.Subnets !== undefined) { - bodyParams["Subnets"] = serializeAws_json1_1StringList( - input.Subnets, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1BatchArrayProperties = ( input: BatchArrayProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - return bodyParams; + return { + ...(input.Size !== undefined && { Size: input.Size }) + }; }; const serializeAws_json1_1BatchParameters = ( input: BatchParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ArrayProperties !== undefined) { - bodyParams["ArrayProperties"] = serializeAws_json1_1BatchArrayProperties( - input.ArrayProperties, - context - ); - } - if (input.JobDefinition !== undefined) { - bodyParams["JobDefinition"] = input.JobDefinition; - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.RetryStrategy !== undefined) { - bodyParams["RetryStrategy"] = serializeAws_json1_1BatchRetryStrategy( - input.RetryStrategy, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1BatchRetryStrategy = ( input: BatchRetryStrategy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attempts !== undefined) { - bodyParams["Attempts"] = input.Attempts; - } - return bodyParams; + return { + ...(input.Attempts !== undefined && { Attempts: input.Attempts }) + }; }; const serializeAws_json1_1Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1CreateEventBusRequest = ( input: CreateEventBusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventSourceName !== undefined) { - bodyParams["EventSourceName"] = input.EventSourceName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventSourceName !== undefined && { + EventSourceName: input.EventSourceName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreatePartnerEventSourceRequest = ( input: CreatePartnerEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Account !== undefined) { - bodyParams["Account"] = input.Account; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Account !== undefined && { Account: input.Account }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeactivateEventSourceRequest = ( input: DeactivateEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteEventBusRequest = ( input: DeleteEventBusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeletePartnerEventSourceRequest = ( input: DeletePartnerEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Account !== undefined) { - bodyParams["Account"] = input.Account; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Account !== undefined && { Account: input.Account }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteRuleRequest = ( input: DeleteRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Force !== undefined) { - bodyParams["Force"] = input.Force; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Force !== undefined && { Force: input.Force }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeEventBusRequest = ( input: DescribeEventBusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeEventSourceRequest = ( input: DescribeEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribePartnerEventSourceRequest = ( input: DescribePartnerEventSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeRuleRequest = ( input: DescribeRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DisableRuleRequest = ( input: DisableRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1EcsParameters = ( input: EcsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Group !== undefined) { - bodyParams["Group"] = input.Group; - } - if (input.LaunchType !== undefined) { - bodyParams["LaunchType"] = input.LaunchType; - } - if (input.NetworkConfiguration !== undefined) { - bodyParams[ - "NetworkConfiguration" - ] = serializeAws_json1_1NetworkConfiguration( - input.NetworkConfiguration, - context - ); - } - if (input.PlatformVersion !== undefined) { - bodyParams["PlatformVersion"] = input.PlatformVersion; - } - if (input.TaskCount !== undefined) { - bodyParams["TaskCount"] = input.TaskCount; - } - if (input.TaskDefinitionArn !== undefined) { - bodyParams["TaskDefinitionArn"] = input.TaskDefinitionArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EnableRuleRequest = ( input: EnableRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1EventResourceList = ( @@ -3592,224 +3537,173 @@ const serializeAws_json1_1InputTransformer = ( input: InputTransformer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputPathsMap !== undefined) { - bodyParams["InputPathsMap"] = serializeAws_json1_1TransformerPaths( - input.InputPathsMap, - context - ); - } - if (input.InputTemplate !== undefined) { - bodyParams["InputTemplate"] = input.InputTemplate; - } - return bodyParams; + return { + ...(input.InputPathsMap !== undefined && { + InputPathsMap: serializeAws_json1_1TransformerPaths( + input.InputPathsMap, + context + ) + }), + ...(input.InputTemplate !== undefined && { + InputTemplate: input.InputTemplate + }) + }; }; const serializeAws_json1_1KinesisParameters = ( input: KinesisParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PartitionKeyPath !== undefined) { - bodyParams["PartitionKeyPath"] = input.PartitionKeyPath; - } - return bodyParams; + return { + ...(input.PartitionKeyPath !== undefined && { + PartitionKeyPath: input.PartitionKeyPath + }) + }; }; const serializeAws_json1_1ListEventBusesRequest = ( input: ListEventBusesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEventSourcesRequest = ( input: ListEventSourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPartnerEventSourceAccountsRequest = ( input: ListPartnerEventSourceAccountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventSourceName !== undefined) { - bodyParams["EventSourceName"] = input.EventSourceName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.EventSourceName !== undefined && { + EventSourceName: input.EventSourceName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPartnerEventSourcesRequest = ( input: ListPartnerEventSourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NamePrefix !== undefined && { NamePrefix: input.NamePrefix }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListRuleNamesByTargetRequest = ( input: ListRuleNamesByTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TargetArn !== undefined) { - bodyParams["TargetArn"] = input.TargetArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListRulesRequest = ( input: ListRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListTargetsByRuleRequest = ( input: ListTargetsByRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Rule !== undefined) { - bodyParams["Rule"] = input.Rule; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NetworkConfiguration = ( input: NetworkConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsvpcConfiguration !== undefined) { - bodyParams["awsvpcConfiguration"] = serializeAws_json1_1AwsVpcConfiguration( - input.awsvpcConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.awsvpcConfiguration !== undefined && { + awsvpcConfiguration: serializeAws_json1_1AwsVpcConfiguration( + input.awsvpcConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1PutEventsRequest = ( input: PutEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Entries !== undefined) { - bodyParams["Entries"] = serializeAws_json1_1PutEventsRequestEntryList( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1PutEventsRequestEntryList( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1PutEventsRequestEntry = ( input: PutEventsRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Detail !== undefined) { - bodyParams["Detail"] = input.Detail; - } - if (input.DetailType !== undefined) { - bodyParams["DetailType"] = input.DetailType; - } - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1EventResourceList( - input.Resources, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Time !== undefined) { - bodyParams["Time"] = Math.round(input.Time.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutEventsRequestEntryList = ( @@ -3825,42 +3719,31 @@ const serializeAws_json1_1PutPartnerEventsRequest = ( input: PutPartnerEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Entries !== undefined) { - bodyParams[ - "Entries" - ] = serializeAws_json1_1PutPartnerEventsRequestEntryList( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1PutPartnerEventsRequestEntryList( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1PutPartnerEventsRequestEntry = ( input: PutPartnerEventsRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Detail !== undefined) { - bodyParams["Detail"] = input.Detail; - } - if (input.DetailType !== undefined) { - bodyParams["DetailType"] = input.DetailType; - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1EventResourceList( - input.Resources, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Time !== undefined) { - bodyParams["Time"] = Math.round(input.Time.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutPartnerEventsRequestEntryList = ( @@ -3876,143 +3759,110 @@ const serializeAws_json1_1PutPermissionRequest = ( input: PutPermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Condition !== undefined) { - bodyParams["Condition"] = serializeAws_json1_1Condition( - input.Condition, - context - ); - } - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = input.Principal; - } - if (input.StatementId !== undefined) { - bodyParams["StatementId"] = input.StatementId; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Condition !== undefined && { + Condition: serializeAws_json1_1Condition(input.Condition, context) + }), + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Principal !== undefined && { Principal: input.Principal }), + ...(input.StatementId !== undefined && { StatementId: input.StatementId }) + }; }; const serializeAws_json1_1PutRuleRequest = ( input: PutRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.EventPattern !== undefined) { - bodyParams["EventPattern"] = input.EventPattern; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutTargetsRequest = ( input: PutTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Rule !== undefined) { - bodyParams["Rule"] = input.Rule; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1TargetList( - input.Targets, - context - ); - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.Rule !== undefined && { Rule: input.Rule }), + ...(input.Targets !== undefined && { + Targets: serializeAws_json1_1TargetList(input.Targets, context) + }) + }; }; const serializeAws_json1_1RemovePermissionRequest = ( input: RemovePermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.StatementId !== undefined) { - bodyParams["StatementId"] = input.StatementId; - } - return bodyParams; + return { + ...(input.EventBusName !== undefined && { + EventBusName: input.EventBusName + }), + ...(input.StatementId !== undefined && { StatementId: input.StatementId }) + }; }; const serializeAws_json1_1RemoveTargetsRequest = ( input: RemoveTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventBusName !== undefined) { - bodyParams["EventBusName"] = input.EventBusName; - } - if (input.Force !== undefined) { - bodyParams["Force"] = input.Force; - } - if (input.Ids !== undefined) { - bodyParams["Ids"] = serializeAws_json1_1TargetIdList(input.Ids, context); - } - if (input.Rule !== undefined) { - bodyParams["Rule"] = input.Rule; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RunCommandParameters = ( input: RunCommandParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RunCommandTargets !== undefined) { - bodyParams["RunCommandTargets"] = serializeAws_json1_1RunCommandTargets( - input.RunCommandTargets, - context - ); - } - return bodyParams; + return { + ...(input.RunCommandTargets !== undefined && { + RunCommandTargets: serializeAws_json1_1RunCommandTargets( + input.RunCommandTargets, + context + ) + }) + }; }; const serializeAws_json1_1RunCommandTarget = ( input: RunCommandTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1RunCommandTargetValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1RunCommandTargetValues(input.Values, context) + }) + }; }; const serializeAws_json1_1RunCommandTargetValues = ( @@ -4035,11 +3885,11 @@ const serializeAws_json1_1SqsParameters = ( input: SqsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageGroupId !== undefined) { - bodyParams["MessageGroupId"] = input.MessageGroupId; - } - return bodyParams; + return { + ...(input.MessageGroupId !== undefined && { + MessageGroupId: input.MessageGroupId + }) + }; }; const serializeAws_json1_1StringList = ( @@ -4050,14 +3900,10 @@ const serializeAws_json1_1StringList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -4078,75 +3924,61 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1Target = ( input: Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.BatchParameters !== undefined) { - bodyParams["BatchParameters"] = serializeAws_json1_1BatchParameters( - input.BatchParameters, - context - ); - } - if (input.EcsParameters !== undefined) { - bodyParams["EcsParameters"] = serializeAws_json1_1EcsParameters( - input.EcsParameters, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Input !== undefined) { - bodyParams["Input"] = input.Input; - } - if (input.InputPath !== undefined) { - bodyParams["InputPath"] = input.InputPath; - } - if (input.InputTransformer !== undefined) { - bodyParams["InputTransformer"] = serializeAws_json1_1InputTransformer( - input.InputTransformer, - context - ); - } - if (input.KinesisParameters !== undefined) { - bodyParams["KinesisParameters"] = serializeAws_json1_1KinesisParameters( - input.KinesisParameters, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.RunCommandParameters !== undefined) { - bodyParams[ - "RunCommandParameters" - ] = serializeAws_json1_1RunCommandParameters( - input.RunCommandParameters, - context - ); - } - if (input.SqsParameters !== undefined) { - bodyParams["SqsParameters"] = serializeAws_json1_1SqsParameters( - input.SqsParameters, - context - ); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.BatchParameters !== undefined && { + BatchParameters: serializeAws_json1_1BatchParameters( + input.BatchParameters, + context + ) + }), + ...(input.EcsParameters !== undefined && { + EcsParameters: serializeAws_json1_1EcsParameters( + input.EcsParameters, + 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.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 + ) + }) + }; }; const serializeAws_json1_1TargetIdList = ( @@ -4167,14 +3999,12 @@ const serializeAws_json1_1TestEventPatternRequest = ( input: TestEventPatternRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Event !== undefined) { - bodyParams["Event"] = input.Event; - } - if (input.EventPattern !== undefined) { - bodyParams["EventPattern"] = input.EventPattern; - } - return bodyParams; + return { + ...(input.Event !== undefined && { Event: input.Event }), + ...(input.EventPattern !== undefined && { + EventPattern: input.EventPattern + }) + }; }; const serializeAws_json1_1TransformerPaths = ( @@ -4191,17 +4021,12 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const deserializeAws_json1_1AwsVpcConfiguration = ( diff --git a/clients/client-firehose/protocols/Aws_json1_1.ts b/clients/client-firehose/protocols/Aws_json1_1.ts index a35797f91261..15b85c78c012 100644 --- a/clients/client-firehose/protocols/Aws_json1_1.ts +++ b/clients/client-firehose/protocols/Aws_json1_1.ts @@ -1498,31 +1498,27 @@ const serializeAws_json1_1BufferingHints = ( input: BufferingHints, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IntervalInSeconds !== undefined) { - bodyParams["IntervalInSeconds"] = input.IntervalInSeconds; - } - if (input.SizeInMBs !== undefined) { - bodyParams["SizeInMBs"] = input.SizeInMBs; - } - return bodyParams; + return { + ...(input.IntervalInSeconds !== undefined && { + IntervalInSeconds: input.IntervalInSeconds + }), + ...(input.SizeInMBs !== undefined && { SizeInMBs: input.SizeInMBs }) + }; }; const serializeAws_json1_1CloudWatchLoggingOptions = ( input: CloudWatchLoggingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.LogGroupName !== undefined) { - bodyParams["LogGroupName"] = input.LogGroupName; - } - if (input.LogStreamName !== undefined) { - bodyParams["LogStreamName"] = input.LogStreamName; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.LogGroupName !== undefined && { + LogGroupName: input.LogGroupName + }), + ...(input.LogStreamName !== undefined && { + LogStreamName: input.LogStreamName + }) + }; }; const serializeAws_json1_1ColumnToJsonKeyMappings = ( @@ -1539,576 +1535,477 @@ const serializeAws_json1_1CopyCommand = ( input: CopyCommand, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CopyOptions !== undefined) { - bodyParams["CopyOptions"] = input.CopyOptions; - } - if (input.DataTableColumns !== undefined) { - bodyParams["DataTableColumns"] = input.DataTableColumns; - } - if (input.DataTableName !== undefined) { - bodyParams["DataTableName"] = input.DataTableName; - } - return bodyParams; + return { + ...(input.CopyOptions !== undefined && { CopyOptions: input.CopyOptions }), + ...(input.DataTableColumns !== undefined && { + DataTableColumns: input.DataTableColumns + }), + ...(input.DataTableName !== undefined && { + DataTableName: input.DataTableName + }) + }; }; const serializeAws_json1_1CreateDeliveryStreamInput = ( input: CreateDeliveryStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamEncryptionConfigurationInput !== undefined) { - bodyParams[ - "DeliveryStreamEncryptionConfigurationInput" - ] = serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( - input.DeliveryStreamEncryptionConfigurationInput, - context - ); - } - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.DeliveryStreamType !== undefined) { - bodyParams["DeliveryStreamType"] = input.DeliveryStreamType; - } - if (input.ElasticsearchDestinationConfiguration !== undefined) { - bodyParams[ - "ElasticsearchDestinationConfiguration" - ] = serializeAws_json1_1ElasticsearchDestinationConfiguration( - input.ElasticsearchDestinationConfiguration, - context - ); - } - if (input.ExtendedS3DestinationConfiguration !== undefined) { - bodyParams[ - "ExtendedS3DestinationConfiguration" - ] = serializeAws_json1_1ExtendedS3DestinationConfiguration( - input.ExtendedS3DestinationConfiguration, - context - ); - } - if (input.KinesisStreamSourceConfiguration !== undefined) { - bodyParams[ - "KinesisStreamSourceConfiguration" - ] = serializeAws_json1_1KinesisStreamSourceConfiguration( - input.KinesisStreamSourceConfiguration, - context - ); - } - if (input.RedshiftDestinationConfiguration !== undefined) { - bodyParams[ - "RedshiftDestinationConfiguration" - ] = serializeAws_json1_1RedshiftDestinationConfiguration( - input.RedshiftDestinationConfiguration, - context - ); - } - if (input.S3DestinationConfiguration !== undefined) { - bodyParams[ - "S3DestinationConfiguration" - ] = serializeAws_json1_1S3DestinationConfiguration( - input.S3DestinationConfiguration, - context - ); - } - if (input.SplunkDestinationConfiguration !== undefined) { - bodyParams[ - "SplunkDestinationConfiguration" - ] = serializeAws_json1_1SplunkDestinationConfiguration( - input.SplunkDestinationConfiguration, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagDeliveryStreamInputTagList( - input.Tags, - context - ); - } - return bodyParams; + 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.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 + ) + }) + }; }; const serializeAws_json1_1DataFormatConversionConfiguration = ( input: DataFormatConversionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.InputFormatConfiguration !== undefined) { - bodyParams[ - "InputFormatConfiguration" - ] = serializeAws_json1_1InputFormatConfiguration( - input.InputFormatConfiguration, - context - ); - } - if (input.OutputFormatConfiguration !== undefined) { - bodyParams[ - "OutputFormatConfiguration" - ] = serializeAws_json1_1OutputFormatConfiguration( - input.OutputFormatConfiguration, - context - ); - } - if (input.SchemaConfiguration !== undefined) { - bodyParams["SchemaConfiguration"] = serializeAws_json1_1SchemaConfiguration( - input.SchemaConfiguration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DeleteDeliveryStreamInput = ( input: DeleteDeliveryStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowForceDelete !== undefined) { - bodyParams["AllowForceDelete"] = input.AllowForceDelete; - } - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - return bodyParams; + return { + ...(input.AllowForceDelete !== undefined && { + AllowForceDelete: input.AllowForceDelete + }), + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }) + }; }; const serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput = ( input: DeliveryStreamEncryptionConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyARN !== undefined) { - bodyParams["KeyARN"] = input.KeyARN; - } - if (input.KeyType !== undefined) { - bodyParams["KeyType"] = input.KeyType; - } - return bodyParams; + return { + ...(input.KeyARN !== undefined && { KeyARN: input.KeyARN }), + ...(input.KeyType !== undefined && { KeyType: input.KeyType }) + }; }; const serializeAws_json1_1DescribeDeliveryStreamInput = ( input: DescribeDeliveryStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.ExclusiveStartDestinationId !== undefined) { - bodyParams["ExclusiveStartDestinationId"] = - input.ExclusiveStartDestinationId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }), + ...(input.ExclusiveStartDestinationId !== undefined && { + ExclusiveStartDestinationId: input.ExclusiveStartDestinationId + }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_1Deserializer = ( input: Deserializer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HiveJsonSerDe !== undefined) { - bodyParams["HiveJsonSerDe"] = serializeAws_json1_1HiveJsonSerDe( - input.HiveJsonSerDe, - context - ); - } - if (input.OpenXJsonSerDe !== undefined) { - bodyParams["OpenXJsonSerDe"] = serializeAws_json1_1OpenXJsonSerDe( - input.OpenXJsonSerDe, - context - ); - } - return bodyParams; + return { + ...(input.HiveJsonSerDe !== undefined && { + HiveJsonSerDe: serializeAws_json1_1HiveJsonSerDe( + input.HiveJsonSerDe, + context + ) + }), + ...(input.OpenXJsonSerDe !== undefined && { + OpenXJsonSerDe: serializeAws_json1_1OpenXJsonSerDe( + input.OpenXJsonSerDe, + context + ) + }) + }; }; const serializeAws_json1_1ElasticsearchBufferingHints = ( input: ElasticsearchBufferingHints, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IntervalInSeconds !== undefined) { - bodyParams["IntervalInSeconds"] = input.IntervalInSeconds; - } - if (input.SizeInMBs !== undefined) { - bodyParams["SizeInMBs"] = input.SizeInMBs; - } - return bodyParams; + return { + ...(input.IntervalInSeconds !== undefined && { + IntervalInSeconds: input.IntervalInSeconds + }), + ...(input.SizeInMBs !== undefined && { SizeInMBs: input.SizeInMBs }) + }; }; const serializeAws_json1_1ElasticsearchDestinationConfiguration = ( input: ElasticsearchDestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BufferingHints !== undefined) { - bodyParams[ - "BufferingHints" - ] = serializeAws_json1_1ElasticsearchBufferingHints( - input.BufferingHints, - context - ); - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.ClusterEndpoint !== undefined) { - bodyParams["ClusterEndpoint"] = input.ClusterEndpoint; - } - if (input.DomainARN !== undefined) { - bodyParams["DomainARN"] = input.DomainARN; - } - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.IndexRotationPeriod !== undefined) { - bodyParams["IndexRotationPeriod"] = input.IndexRotationPeriod; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RetryOptions !== undefined) { - bodyParams["RetryOptions"] = serializeAws_json1_1ElasticsearchRetryOptions( - input.RetryOptions, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - if (input.S3Configuration !== undefined) { - bodyParams[ - "S3Configuration" - ] = serializeAws_json1_1S3DestinationConfiguration( - input.S3Configuration, - context - ); - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ElasticsearchDestinationUpdate = ( input: ElasticsearchDestinationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BufferingHints !== undefined) { - bodyParams[ - "BufferingHints" - ] = serializeAws_json1_1ElasticsearchBufferingHints( - input.BufferingHints, - context - ); - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.ClusterEndpoint !== undefined) { - bodyParams["ClusterEndpoint"] = input.ClusterEndpoint; - } - if (input.DomainARN !== undefined) { - bodyParams["DomainARN"] = input.DomainARN; - } - if (input.IndexName !== undefined) { - bodyParams["IndexName"] = input.IndexName; - } - if (input.IndexRotationPeriod !== undefined) { - bodyParams["IndexRotationPeriod"] = input.IndexRotationPeriod; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RetryOptions !== undefined) { - bodyParams["RetryOptions"] = serializeAws_json1_1ElasticsearchRetryOptions( - input.RetryOptions, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3Update !== undefined) { - bodyParams["S3Update"] = serializeAws_json1_1S3DestinationUpdate( - input.S3Update, - context - ); - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ElasticsearchRetryOptions = ( input: ElasticsearchRetryOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DurationInSeconds !== undefined) { - bodyParams["DurationInSeconds"] = input.DurationInSeconds; - } - return bodyParams; + return { + ...(input.DurationInSeconds !== undefined && { + DurationInSeconds: input.DurationInSeconds + }) + }; }; const serializeAws_json1_1EncryptionConfiguration = ( input: EncryptionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KMSEncryptionConfig !== undefined) { - bodyParams["KMSEncryptionConfig"] = serializeAws_json1_1KMSEncryptionConfig( - input.KMSEncryptionConfig, - context - ); - } - if (input.NoEncryptionConfig !== undefined) { - bodyParams["NoEncryptionConfig"] = input.NoEncryptionConfig; - } - return bodyParams; + return { + ...(input.KMSEncryptionConfig !== undefined && { + KMSEncryptionConfig: serializeAws_json1_1KMSEncryptionConfig( + input.KMSEncryptionConfig, + context + ) + }), + ...(input.NoEncryptionConfig !== undefined && { + NoEncryptionConfig: input.NoEncryptionConfig + }) + }; }; const serializeAws_json1_1ExtendedS3DestinationConfiguration = ( input: ExtendedS3DestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.BufferingHints !== undefined) { - bodyParams["BufferingHints"] = serializeAws_json1_1BufferingHints( - input.BufferingHints, - context - ); - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.CompressionFormat !== undefined) { - bodyParams["CompressionFormat"] = input.CompressionFormat; - } - if (input.DataFormatConversionConfiguration !== undefined) { - bodyParams[ - "DataFormatConversionConfiguration" - ] = serializeAws_json1_1DataFormatConversionConfiguration( - input.DataFormatConversionConfiguration, - context - ); - } - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.ErrorOutputPrefix !== undefined) { - bodyParams["ErrorOutputPrefix"] = input.ErrorOutputPrefix; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3BackupConfiguration !== undefined) { - bodyParams[ - "S3BackupConfiguration" - ] = serializeAws_json1_1S3DestinationConfiguration( - input.S3BackupConfiguration, - context - ); - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ExtendedS3DestinationUpdate = ( input: ExtendedS3DestinationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.BufferingHints !== undefined) { - bodyParams["BufferingHints"] = serializeAws_json1_1BufferingHints( - input.BufferingHints, - context - ); - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.CompressionFormat !== undefined) { - bodyParams["CompressionFormat"] = input.CompressionFormat; - } - if (input.DataFormatConversionConfiguration !== undefined) { - bodyParams[ - "DataFormatConversionConfiguration" - ] = serializeAws_json1_1DataFormatConversionConfiguration( - input.DataFormatConversionConfiguration, - context - ); - } - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.ErrorOutputPrefix !== undefined) { - bodyParams["ErrorOutputPrefix"] = input.ErrorOutputPrefix; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - if (input.S3BackupUpdate !== undefined) { - bodyParams["S3BackupUpdate"] = serializeAws_json1_1S3DestinationUpdate( - input.S3BackupUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1HiveJsonSerDe = ( input: HiveJsonSerDe, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TimestampFormats !== undefined) { - bodyParams["TimestampFormats"] = serializeAws_json1_1ListOfNonEmptyStrings( - input.TimestampFormats, - context - ); - } - return bodyParams; + return { + ...(input.TimestampFormats !== undefined && { + TimestampFormats: serializeAws_json1_1ListOfNonEmptyStrings( + input.TimestampFormats, + context + ) + }) + }; }; const serializeAws_json1_1InputFormatConfiguration = ( input: InputFormatConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Deserializer !== undefined) { - bodyParams["Deserializer"] = serializeAws_json1_1Deserializer( - input.Deserializer, - context - ); - } - return bodyParams; + return { + ...(input.Deserializer !== undefined && { + Deserializer: serializeAws_json1_1Deserializer( + input.Deserializer, + context + ) + }) + }; }; const serializeAws_json1_1KMSEncryptionConfig = ( input: KMSEncryptionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AWSKMSKeyARN !== undefined) { - bodyParams["AWSKMSKeyARN"] = input.AWSKMSKeyARN; - } - return bodyParams; + return { + ...(input.AWSKMSKeyARN !== undefined && { + AWSKMSKeyARN: input.AWSKMSKeyARN + }) + }; }; const serializeAws_json1_1KinesisStreamSourceConfiguration = ( input: KinesisStreamSourceConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KinesisStreamARN !== undefined) { - bodyParams["KinesisStreamARN"] = input.KinesisStreamARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.KinesisStreamARN !== undefined && { + KinesisStreamARN: input.KinesisStreamARN + }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1ListDeliveryStreamsInput = ( input: ListDeliveryStreamsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamType !== undefined) { - bodyParams["DeliveryStreamType"] = input.DeliveryStreamType; - } - if (input.ExclusiveStartDeliveryStreamName !== undefined) { - bodyParams["ExclusiveStartDeliveryStreamName"] = - input.ExclusiveStartDeliveryStreamName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.DeliveryStreamType !== undefined && { + DeliveryStreamType: input.DeliveryStreamType + }), + ...(input.ExclusiveStartDeliveryStreamName !== undefined && { + ExclusiveStartDeliveryStreamName: input.ExclusiveStartDeliveryStreamName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_1ListOfNonEmptyStrings = ( @@ -2129,159 +2026,138 @@ const serializeAws_json1_1ListTagsForDeliveryStreamInput = ( input: ListTagsForDeliveryStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.ExclusiveStartTagKey !== undefined) { - bodyParams["ExclusiveStartTagKey"] = input.ExclusiveStartTagKey; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }), + ...(input.ExclusiveStartTagKey !== undefined && { + ExclusiveStartTagKey: input.ExclusiveStartTagKey + }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_1OpenXJsonSerDe = ( input: OpenXJsonSerDe, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaseInsensitive !== undefined) { - bodyParams["CaseInsensitive"] = input.CaseInsensitive; - } - if (input.ColumnToJsonKeyMappings !== undefined) { - bodyParams[ - "ColumnToJsonKeyMappings" - ] = serializeAws_json1_1ColumnToJsonKeyMappings( - input.ColumnToJsonKeyMappings, - context - ); - } - if (input.ConvertDotsInJsonKeysToUnderscores !== undefined) { - bodyParams["ConvertDotsInJsonKeysToUnderscores"] = - input.ConvertDotsInJsonKeysToUnderscores; - } - return bodyParams; + return { + ...(input.CaseInsensitive !== undefined && { + CaseInsensitive: input.CaseInsensitive + }), + ...(input.ColumnToJsonKeyMappings !== undefined && { + ColumnToJsonKeyMappings: serializeAws_json1_1ColumnToJsonKeyMappings( + input.ColumnToJsonKeyMappings, + context + ) + }), + ...(input.ConvertDotsInJsonKeysToUnderscores !== undefined && { + ConvertDotsInJsonKeysToUnderscores: + input.ConvertDotsInJsonKeysToUnderscores + }) + }; }; const serializeAws_json1_1OrcSerDe = ( input: OrcSerDe, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockSizeBytes !== undefined) { - bodyParams["BlockSizeBytes"] = input.BlockSizeBytes; - } - if (input.BloomFilterColumns !== undefined) { - bodyParams[ - "BloomFilterColumns" - ] = serializeAws_json1_1ListOfNonEmptyStringsWithoutWhitespace( - input.BloomFilterColumns, - context - ); - } - if (input.BloomFilterFalsePositiveProbability !== undefined) { - bodyParams["BloomFilterFalsePositiveProbability"] = - input.BloomFilterFalsePositiveProbability; - } - if (input.Compression !== undefined) { - bodyParams["Compression"] = input.Compression; - } - if (input.DictionaryKeyThreshold !== undefined) { - bodyParams["DictionaryKeyThreshold"] = input.DictionaryKeyThreshold; - } - if (input.EnablePadding !== undefined) { - bodyParams["EnablePadding"] = input.EnablePadding; - } - if (input.FormatVersion !== undefined) { - bodyParams["FormatVersion"] = input.FormatVersion; - } - if (input.PaddingTolerance !== undefined) { - bodyParams["PaddingTolerance"] = input.PaddingTolerance; - } - if (input.RowIndexStride !== undefined) { - bodyParams["RowIndexStride"] = input.RowIndexStride; - } - if (input.StripeSizeBytes !== undefined) { - bodyParams["StripeSizeBytes"] = input.StripeSizeBytes; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1OutputFormatConfiguration = ( input: OutputFormatConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Serializer !== undefined) { - bodyParams["Serializer"] = serializeAws_json1_1Serializer( - input.Serializer, - context - ); - } - return bodyParams; + return { + ...(input.Serializer !== undefined && { + Serializer: serializeAws_json1_1Serializer(input.Serializer, context) + }) + }; }; const serializeAws_json1_1ParquetSerDe = ( input: ParquetSerDe, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlockSizeBytes !== undefined) { - bodyParams["BlockSizeBytes"] = input.BlockSizeBytes; - } - if (input.Compression !== undefined) { - bodyParams["Compression"] = input.Compression; - } - if (input.EnableDictionaryCompression !== undefined) { - bodyParams["EnableDictionaryCompression"] = - input.EnableDictionaryCompression; - } - if (input.MaxPaddingBytes !== undefined) { - bodyParams["MaxPaddingBytes"] = input.MaxPaddingBytes; - } - if (input.PageSizeBytes !== undefined) { - bodyParams["PageSizeBytes"] = input.PageSizeBytes; - } - if (input.WriterVersion !== undefined) { - bodyParams["WriterVersion"] = input.WriterVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ProcessingConfiguration = ( input: ProcessingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.Processors !== undefined) { - bodyParams["Processors"] = serializeAws_json1_1ProcessorList( - input.Processors, - context - ); - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.Processors !== undefined && { + Processors: serializeAws_json1_1ProcessorList(input.Processors, context) + }) + }; }; const serializeAws_json1_1Processor = ( input: Processor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ProcessorParameterList( - input.Parameters, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_1ProcessorParameterList( + input.Parameters, + context + ) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1ProcessorList = ( @@ -2295,14 +2171,14 @@ const serializeAws_json1_1ProcessorParameter = ( input: ProcessorParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterName !== undefined) { - bodyParams["ParameterName"] = input.ParameterName; - } - if (input.ParameterValue !== undefined) { - bodyParams["ParameterValue"] = input.ParameterValue; - } - return bodyParams; + return { + ...(input.ParameterName !== undefined && { + ParameterName: input.ParameterName + }), + ...(input.ParameterValue !== undefined && { + ParameterValue: input.ParameterValue + }) + }; }; const serializeAws_json1_1ProcessorParameterList = ( @@ -2318,17 +2194,17 @@ const serializeAws_json1_1PutRecordBatchInput = ( input: PutRecordBatchInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.Records !== undefined) { - bodyParams["Records"] = serializeAws_json1_1PutRecordBatchRequestEntryList( - input.Records, - context - ); - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }), + ...(input.Records !== undefined && { + Records: serializeAws_json1_1PutRecordBatchRequestEntryList( + input.Records, + context + ) + }) + }; }; const serializeAws_json1_1PutRecordBatchRequestEntryList = ( @@ -2342,477 +2218,380 @@ const serializeAws_json1_1PutRecordInput = ( input: PutRecordInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.Record !== undefined) { - bodyParams["Record"] = serializeAws_json1_1_Record(input.Record, context); - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }), + ...(input.Record !== undefined && { + Record: serializeAws_json1_1_Record(input.Record, context) + }) + }; }; const serializeAws_json1_1_Record = ( input: _Record, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = context.base64Encoder(input.Data); - } - return bodyParams; + return { + ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }) + }; }; const serializeAws_json1_1RedshiftDestinationConfiguration = ( input: RedshiftDestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.ClusterJDBCURL !== undefined) { - bodyParams["ClusterJDBCURL"] = input.ClusterJDBCURL; - } - if (input.CopyCommand !== undefined) { - bodyParams["CopyCommand"] = serializeAws_json1_1CopyCommand( - input.CopyCommand, - context - ); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RetryOptions !== undefined) { - bodyParams["RetryOptions"] = serializeAws_json1_1RedshiftRetryOptions( - input.RetryOptions, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3BackupConfiguration !== undefined) { - bodyParams[ - "S3BackupConfiguration" - ] = serializeAws_json1_1S3DestinationConfiguration( - input.S3BackupConfiguration, - context - ); - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - if (input.S3Configuration !== undefined) { - bodyParams[ - "S3Configuration" - ] = serializeAws_json1_1S3DestinationConfiguration( - input.S3Configuration, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RedshiftDestinationUpdate = ( input: RedshiftDestinationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.ClusterJDBCURL !== undefined) { - bodyParams["ClusterJDBCURL"] = input.ClusterJDBCURL; - } - if (input.CopyCommand !== undefined) { - bodyParams["CopyCommand"] = serializeAws_json1_1CopyCommand( - input.CopyCommand, - context - ); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RetryOptions !== undefined) { - bodyParams["RetryOptions"] = serializeAws_json1_1RedshiftRetryOptions( - input.RetryOptions, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - if (input.S3BackupUpdate !== undefined) { - bodyParams["S3BackupUpdate"] = serializeAws_json1_1S3DestinationUpdate( - input.S3BackupUpdate, - context - ); - } - if (input.S3Update !== undefined) { - bodyParams["S3Update"] = serializeAws_json1_1S3DestinationUpdate( - input.S3Update, - context - ); - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RedshiftRetryOptions = ( input: RedshiftRetryOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DurationInSeconds !== undefined) { - bodyParams["DurationInSeconds"] = input.DurationInSeconds; - } - return bodyParams; + return { + ...(input.DurationInSeconds !== undefined && { + DurationInSeconds: input.DurationInSeconds + }) + }; }; const serializeAws_json1_1S3DestinationConfiguration = ( input: S3DestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.BufferingHints !== undefined) { - bodyParams["BufferingHints"] = serializeAws_json1_1BufferingHints( - input.BufferingHints, - context - ); - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.CompressionFormat !== undefined) { - bodyParams["CompressionFormat"] = input.CompressionFormat; - } - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.ErrorOutputPrefix !== undefined) { - bodyParams["ErrorOutputPrefix"] = input.ErrorOutputPrefix; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1S3DestinationUpdate = ( input: S3DestinationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.BufferingHints !== undefined) { - bodyParams["BufferingHints"] = serializeAws_json1_1BufferingHints( - input.BufferingHints, - context - ); - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.CompressionFormat !== undefined) { - bodyParams["CompressionFormat"] = input.CompressionFormat; - } - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.ErrorOutputPrefix !== undefined) { - bodyParams["ErrorOutputPrefix"] = input.ErrorOutputPrefix; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SchemaConfiguration = ( input: SchemaConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.VersionId !== undefined) { - bodyParams["VersionId"] = input.VersionId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Serializer = ( input: Serializer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrcSerDe !== undefined) { - bodyParams["OrcSerDe"] = serializeAws_json1_1OrcSerDe( - input.OrcSerDe, - context - ); - } - if (input.ParquetSerDe !== undefined) { - bodyParams["ParquetSerDe"] = serializeAws_json1_1ParquetSerDe( - input.ParquetSerDe, - context - ); - } - return bodyParams; + return { + ...(input.OrcSerDe !== undefined && { + OrcSerDe: serializeAws_json1_1OrcSerDe(input.OrcSerDe, context) + }), + ...(input.ParquetSerDe !== undefined && { + ParquetSerDe: serializeAws_json1_1ParquetSerDe( + input.ParquetSerDe, + context + ) + }) + }; }; const serializeAws_json1_1SplunkDestinationConfiguration = ( input: SplunkDestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.HECAcknowledgmentTimeoutInSeconds !== undefined) { - bodyParams["HECAcknowledgmentTimeoutInSeconds"] = - input.HECAcknowledgmentTimeoutInSeconds; - } - if (input.HECEndpoint !== undefined) { - bodyParams["HECEndpoint"] = input.HECEndpoint; - } - if (input.HECEndpointType !== undefined) { - bodyParams["HECEndpointType"] = input.HECEndpointType; - } - if (input.HECToken !== undefined) { - bodyParams["HECToken"] = input.HECToken; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RetryOptions !== undefined) { - bodyParams["RetryOptions"] = serializeAws_json1_1SplunkRetryOptions( - input.RetryOptions, - context - ); - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - if (input.S3Configuration !== undefined) { - bodyParams[ - "S3Configuration" - ] = serializeAws_json1_1S3DestinationConfiguration( - input.S3Configuration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SplunkDestinationUpdate = ( input: SplunkDestinationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.HECAcknowledgmentTimeoutInSeconds !== undefined) { - bodyParams["HECAcknowledgmentTimeoutInSeconds"] = - input.HECAcknowledgmentTimeoutInSeconds; - } - if (input.HECEndpoint !== undefined) { - bodyParams["HECEndpoint"] = input.HECEndpoint; - } - if (input.HECEndpointType !== undefined) { - bodyParams["HECEndpointType"] = input.HECEndpointType; - } - if (input.HECToken !== undefined) { - bodyParams["HECToken"] = input.HECToken; - } - if (input.ProcessingConfiguration !== undefined) { - bodyParams[ - "ProcessingConfiguration" - ] = serializeAws_json1_1ProcessingConfiguration( - input.ProcessingConfiguration, - context - ); - } - if (input.RetryOptions !== undefined) { - bodyParams["RetryOptions"] = serializeAws_json1_1SplunkRetryOptions( - input.RetryOptions, - context - ); - } - if (input.S3BackupMode !== undefined) { - bodyParams["S3BackupMode"] = input.S3BackupMode; - } - if (input.S3Update !== undefined) { - bodyParams["S3Update"] = serializeAws_json1_1S3DestinationUpdate( - input.S3Update, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1SplunkRetryOptions = ( input: SplunkRetryOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DurationInSeconds !== undefined) { - bodyParams["DurationInSeconds"] = input.DurationInSeconds; - } - return bodyParams; + return { + ...(input.DurationInSeconds !== undefined && { + DurationInSeconds: input.DurationInSeconds + }) + }; }; const serializeAws_json1_1StartDeliveryStreamEncryptionInput = ( input: StartDeliveryStreamEncryptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamEncryptionConfigurationInput !== undefined) { - bodyParams[ - "DeliveryStreamEncryptionConfigurationInput" - ] = serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( - input.DeliveryStreamEncryptionConfigurationInput, - context - ); - } - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - return bodyParams; + return { + ...(input.DeliveryStreamEncryptionConfigurationInput !== undefined && { + DeliveryStreamEncryptionConfigurationInput: serializeAws_json1_1DeliveryStreamEncryptionConfigurationInput( + input.DeliveryStreamEncryptionConfigurationInput, + context + ) + }), + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }) + }; }; const serializeAws_json1_1StopDeliveryStreamEncryptionInput = ( input: StopDeliveryStreamEncryptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagDeliveryStreamInput = ( input: TagDeliveryStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagDeliveryStreamInputTagList( - input.Tags, - context - ); - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagDeliveryStreamInputTagList( + input.Tags, + context + ) + }) + }; }; const serializeAws_json1_1TagDeliveryStreamInputTagList = ( @@ -2833,73 +2612,61 @@ const serializeAws_json1_1UntagDeliveryStreamInput = ( input: UntagDeliveryStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.DeliveryStreamName !== undefined && { + DeliveryStreamName: input.DeliveryStreamName + }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateDestinationInput = ( input: UpdateDestinationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CurrentDeliveryStreamVersionId !== undefined) { - bodyParams["CurrentDeliveryStreamVersionId"] = - input.CurrentDeliveryStreamVersionId; - } - if (input.DeliveryStreamName !== undefined) { - bodyParams["DeliveryStreamName"] = input.DeliveryStreamName; - } - if (input.DestinationId !== undefined) { - bodyParams["DestinationId"] = input.DestinationId; - } - if (input.ElasticsearchDestinationUpdate !== undefined) { - bodyParams[ - "ElasticsearchDestinationUpdate" - ] = serializeAws_json1_1ElasticsearchDestinationUpdate( - input.ElasticsearchDestinationUpdate, - context - ); - } - if (input.ExtendedS3DestinationUpdate !== undefined) { - bodyParams[ - "ExtendedS3DestinationUpdate" - ] = serializeAws_json1_1ExtendedS3DestinationUpdate( - input.ExtendedS3DestinationUpdate, - context - ); - } - if (input.RedshiftDestinationUpdate !== undefined) { - bodyParams[ - "RedshiftDestinationUpdate" - ] = serializeAws_json1_1RedshiftDestinationUpdate( - input.RedshiftDestinationUpdate, - context - ); - } - if (input.S3DestinationUpdate !== undefined) { - bodyParams["S3DestinationUpdate"] = serializeAws_json1_1S3DestinationUpdate( - input.S3DestinationUpdate, - context - ); - } - if (input.SplunkDestinationUpdate !== undefined) { - bodyParams[ - "SplunkDestinationUpdate" - ] = serializeAws_json1_1SplunkDestinationUpdate( - input.SplunkDestinationUpdate, - context - ); - } - return bodyParams; + 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.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 + ) + }) + }; }; const deserializeAws_json1_1BufferingHints = ( diff --git a/clients/client-fms/protocols/Aws_json1_1.ts b/clients/client-fms/protocols/Aws_json1_1.ts index 9adeb01950d8..4702849b00e6 100644 --- a/clients/client-fms/protocols/Aws_json1_1.ts +++ b/clients/client-fms/protocols/Aws_json1_1.ts @@ -1970,11 +1970,11 @@ const serializeAws_json1_1AssociateAdminAccountRequest = ( input: AssociateAdminAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminAccount !== undefined) { - bodyParams["AdminAccount"] = input.AdminAccount; - } - return bodyParams; + return { + ...(input.AdminAccount !== undefined && { + AdminAccount: input.AdminAccount + }) + }; }; const serializeAws_json1_1CustomerPolicyScopeIdList = ( @@ -2001,253 +2001,207 @@ const serializeAws_json1_1DeleteNotificationChannelRequest = ( input: DeleteNotificationChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DeletePolicyRequest = ( input: DeletePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteAllPolicyResources !== undefined) { - bodyParams["DeleteAllPolicyResources"] = input.DeleteAllPolicyResources; - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.DeleteAllPolicyResources !== undefined && { + DeleteAllPolicyResources: input.DeleteAllPolicyResources + }), + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1DisassociateAdminAccountRequest = ( input: DisassociateAdminAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetAdminAccountRequest = ( input: GetAdminAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetComplianceDetailRequest = ( input: GetComplianceDetailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MemberAccount !== undefined) { - bodyParams["MemberAccount"] = input.MemberAccount; - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.MemberAccount !== undefined && { + MemberAccount: input.MemberAccount + }), + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1GetNotificationChannelRequest = ( input: GetNotificationChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetPolicyRequest = ( input: GetPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1GetProtectionStatusRequest = ( input: GetProtectionStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MemberAccountId !== undefined) { - bodyParams["MemberAccountId"] = input.MemberAccountId; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListComplianceStatusRequest = ( input: ListComplianceStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1ListMemberAccountsRequest = ( input: ListMemberAccountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPoliciesRequest = ( input: ListPoliciesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1Policy = ( input: Policy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludeMap !== undefined) { - bodyParams["ExcludeMap"] = serializeAws_json1_1CustomerPolicyScopeMap( - input.ExcludeMap, - context - ); - } - if (input.ExcludeResourceTags !== undefined) { - bodyParams["ExcludeResourceTags"] = input.ExcludeResourceTags; - } - if (input.IncludeMap !== undefined) { - bodyParams["IncludeMap"] = serializeAws_json1_1CustomerPolicyScopeMap( - input.IncludeMap, - context - ); - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - if (input.PolicyUpdateToken !== undefined) { - bodyParams["PolicyUpdateToken"] = input.PolicyUpdateToken; - } - if (input.RemediationEnabled !== undefined) { - bodyParams["RemediationEnabled"] = input.RemediationEnabled; - } - if (input.ResourceTags !== undefined) { - bodyParams["ResourceTags"] = serializeAws_json1_1ResourceTags( - input.ResourceTags, - context - ); - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.ResourceTypeList !== undefined) { - bodyParams["ResourceTypeList"] = serializeAws_json1_1ResourceTypeList( - input.ResourceTypeList, - context - ); - } - if (input.SecurityServicePolicyData !== undefined) { - bodyParams[ - "SecurityServicePolicyData" - ] = serializeAws_json1_1SecurityServicePolicyData( - input.SecurityServicePolicyData, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1PutNotificationChannelRequest = ( input: PutNotificationChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnsRoleName !== undefined) { - bodyParams["SnsRoleName"] = input.SnsRoleName; - } - if (input.SnsTopicArn !== undefined) { - bodyParams["SnsTopicArn"] = input.SnsTopicArn; - } - return bodyParams; + return { + ...(input.SnsRoleName !== undefined && { SnsRoleName: input.SnsRoleName }), + ...(input.SnsTopicArn !== undefined && { SnsTopicArn: input.SnsTopicArn }) + }; }; const serializeAws_json1_1PutPolicyRequest = ( input: PutPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Policy !== undefined) { - bodyParams["Policy"] = serializeAws_json1_1Policy(input.Policy, context); - } - if (input.TagList !== undefined) { - bodyParams["TagList"] = serializeAws_json1_1TagList(input.TagList, context); - } - return bodyParams; + return { + ...(input.Policy !== undefined && { + Policy: serializeAws_json1_1Policy(input.Policy, context) + }), + ...(input.TagList !== undefined && { + TagList: serializeAws_json1_1TagList(input.TagList, context) + }) + }; }; const serializeAws_json1_1ResourceTag = ( input: ResourceTag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ResourceTags = ( @@ -2268,25 +2222,19 @@ const serializeAws_json1_1SecurityServicePolicyData = ( input: SecurityServicePolicyData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManagedServiceData !== undefined) { - bodyParams["ManagedServiceData"] = input.ManagedServiceData; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.ManagedServiceData !== undefined && { + ManagedServiceData: input.ManagedServiceData + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -2307,31 +2255,24 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagList !== undefined) { - bodyParams["TagList"] = serializeAws_json1_1TagList(input.TagList, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagList !== undefined && { + TagList: serializeAws_json1_1TagList(input.TagList, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const deserializeAws_json1_1ComplianceViolator = ( diff --git a/clients/client-forecast/protocols/Aws_json1_1.ts b/clients/client-forecast/protocols/Aws_json1_1.ts index 72a6509c404c..96b04c626afd 100644 --- a/clients/client-forecast/protocols/Aws_json1_1.ts +++ b/clients/client-forecast/protocols/Aws_json1_1.ts @@ -2828,14 +2828,12 @@ const serializeAws_json1_1CategoricalParameterRange = ( input: CategoricalParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1Values(input.Values, context); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1Values(input.Values, context) + }) + }; }; const serializeAws_json1_1CategoricalParameterRanges = ( @@ -2851,20 +2849,12 @@ const serializeAws_json1_1ContinuousParameterRange = ( input: ContinuousParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ScalingType !== undefined) { - bodyParams["ScalingType"] = input.ScalingType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ContinuousParameterRanges = ( @@ -2880,422 +2870,378 @@ const serializeAws_json1_1CreateDatasetGroupRequest = ( input: CreateDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetArns !== undefined) { - bodyParams["DatasetArns"] = serializeAws_json1_1ArnList( - input.DatasetArns, - context - ); - } - if (input.DatasetGroupName !== undefined) { - bodyParams["DatasetGroupName"] = input.DatasetGroupName; - } - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - return bodyParams; + return { + ...(input.DatasetArns !== undefined && { + DatasetArns: serializeAws_json1_1ArnList(input.DatasetArns, context) + }), + ...(input.DatasetGroupName !== undefined && { + DatasetGroupName: input.DatasetGroupName + }), + ...(input.Domain !== undefined && { Domain: input.Domain }) + }; }; const serializeAws_json1_1CreateDatasetImportJobRequest = ( input: CreateDatasetImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSource !== undefined) { - bodyParams["DataSource"] = serializeAws_json1_1DataSource( - input.DataSource, - context - ); - } - if (input.DatasetArn !== undefined) { - bodyParams["DatasetArn"] = input.DatasetArn; - } - if (input.DatasetImportJobName !== undefined) { - bodyParams["DatasetImportJobName"] = input.DatasetImportJobName; - } - if (input.TimestampFormat !== undefined) { - bodyParams["TimestampFormat"] = input.TimestampFormat; - } - return bodyParams; + return { + ...(input.DataSource !== undefined && { + DataSource: serializeAws_json1_1DataSource(input.DataSource, context) + }), + ...(input.DatasetArn !== undefined && { DatasetArn: input.DatasetArn }), + ...(input.DatasetImportJobName !== undefined && { + DatasetImportJobName: input.DatasetImportJobName + }), + ...(input.TimestampFormat !== undefined && { + TimestampFormat: input.TimestampFormat + }) + }; }; const serializeAws_json1_1CreateDatasetRequest = ( input: CreateDatasetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataFrequency !== undefined) { - bodyParams["DataFrequency"] = input.DataFrequency; - } - if (input.DatasetName !== undefined) { - bodyParams["DatasetName"] = input.DatasetName; - } - if (input.DatasetType !== undefined) { - bodyParams["DatasetType"] = input.DatasetType; - } - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.EncryptionConfig !== undefined) { - bodyParams["EncryptionConfig"] = serializeAws_json1_1EncryptionConfig( - input.EncryptionConfig, - context - ); - } - if (input.Schema !== undefined) { - bodyParams["Schema"] = serializeAws_json1_1Schema(input.Schema, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateForecastExportJobRequest = ( input: CreateForecastExportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["Destination"] = serializeAws_json1_1DataDestination( - input.Destination, - context - ); - } - if (input.ForecastArn !== undefined) { - bodyParams["ForecastArn"] = input.ForecastArn; - } - if (input.ForecastExportJobName !== undefined) { - bodyParams["ForecastExportJobName"] = input.ForecastExportJobName; - } - return bodyParams; + return { + ...(input.Destination !== undefined && { + Destination: serializeAws_json1_1DataDestination( + input.Destination, + context + ) + }), + ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }), + ...(input.ForecastExportJobName !== undefined && { + ForecastExportJobName: input.ForecastExportJobName + }) + }; }; const serializeAws_json1_1CreateForecastRequest = ( input: CreateForecastRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForecastName !== undefined) { - bodyParams["ForecastName"] = input.ForecastName; - } - if (input.ForecastTypes !== undefined) { - bodyParams["ForecastTypes"] = serializeAws_json1_1ForecastTypes( - input.ForecastTypes, - context - ); - } - if (input.PredictorArn !== undefined) { - bodyParams["PredictorArn"] = input.PredictorArn; - } - return bodyParams; + return { + ...(input.ForecastName !== undefined && { + ForecastName: input.ForecastName + }), + ...(input.ForecastTypes !== undefined && { + ForecastTypes: serializeAws_json1_1ForecastTypes( + input.ForecastTypes, + context + ) + }), + ...(input.PredictorArn !== undefined && { + PredictorArn: input.PredictorArn + }) + }; }; const serializeAws_json1_1CreatePredictorRequest = ( input: CreatePredictorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmArn !== undefined) { - bodyParams["AlgorithmArn"] = input.AlgorithmArn; - } - if (input.EncryptionConfig !== undefined) { - bodyParams["EncryptionConfig"] = serializeAws_json1_1EncryptionConfig( - input.EncryptionConfig, - context - ); - } - if (input.EvaluationParameters !== undefined) { - bodyParams[ - "EvaluationParameters" - ] = serializeAws_json1_1EvaluationParameters( - input.EvaluationParameters, - context - ); - } - if (input.FeaturizationConfig !== undefined) { - bodyParams["FeaturizationConfig"] = serializeAws_json1_1FeaturizationConfig( - input.FeaturizationConfig, - context - ); - } - if (input.ForecastHorizon !== undefined) { - bodyParams["ForecastHorizon"] = input.ForecastHorizon; - } - if (input.HPOConfig !== undefined) { - bodyParams["HPOConfig"] = serializeAws_json1_1HyperParameterTuningJobConfig( - input.HPOConfig, - context - ); - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.PerformAutoML !== undefined) { - bodyParams["PerformAutoML"] = input.PerformAutoML; - } - if (input.PerformHPO !== undefined) { - bodyParams["PerformHPO"] = input.PerformHPO; - } - if (input.PredictorName !== undefined) { - bodyParams["PredictorName"] = input.PredictorName; - } - if (input.TrainingParameters !== undefined) { - bodyParams["TrainingParameters"] = serializeAws_json1_1TrainingParameters( - input.TrainingParameters, - context - ); - } - return bodyParams; + 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.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.TrainingParameters !== undefined && { + TrainingParameters: serializeAws_json1_1TrainingParameters( + input.TrainingParameters, + context + ) + }) + }; }; const serializeAws_json1_1DataDestination = ( input: DataDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Config !== undefined) { - bodyParams["S3Config"] = serializeAws_json1_1S3Config( - input.S3Config, - context - ); - } - return bodyParams; + return { + ...(input.S3Config !== undefined && { + S3Config: serializeAws_json1_1S3Config(input.S3Config, context) + }) + }; }; const serializeAws_json1_1DataSource = ( input: DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Config !== undefined) { - bodyParams["S3Config"] = serializeAws_json1_1S3Config( - input.S3Config, - context - ); - } - return bodyParams; + return { + ...(input.S3Config !== undefined && { + S3Config: serializeAws_json1_1S3Config(input.S3Config, context) + }) + }; }; const serializeAws_json1_1DeleteDatasetGroupRequest = ( input: DeleteDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetGroupArn !== undefined) { - bodyParams["DatasetGroupArn"] = input.DatasetGroupArn; - } - return bodyParams; + return { + ...(input.DatasetGroupArn !== undefined && { + DatasetGroupArn: input.DatasetGroupArn + }) + }; }; const serializeAws_json1_1DeleteDatasetImportJobRequest = ( input: DeleteDatasetImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetImportJobArn !== undefined) { - bodyParams["DatasetImportJobArn"] = input.DatasetImportJobArn; - } - return bodyParams; + return { + ...(input.DatasetImportJobArn !== undefined && { + DatasetImportJobArn: input.DatasetImportJobArn + }) + }; }; const serializeAws_json1_1DeleteDatasetRequest = ( input: DeleteDatasetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetArn !== undefined) { - bodyParams["DatasetArn"] = input.DatasetArn; - } - return bodyParams; + return { + ...(input.DatasetArn !== undefined && { DatasetArn: input.DatasetArn }) + }; }; const serializeAws_json1_1DeleteForecastExportJobRequest = ( input: DeleteForecastExportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForecastExportJobArn !== undefined) { - bodyParams["ForecastExportJobArn"] = input.ForecastExportJobArn; - } - return bodyParams; + return { + ...(input.ForecastExportJobArn !== undefined && { + ForecastExportJobArn: input.ForecastExportJobArn + }) + }; }; const serializeAws_json1_1DeleteForecastRequest = ( input: DeleteForecastRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForecastArn !== undefined) { - bodyParams["ForecastArn"] = input.ForecastArn; - } - return bodyParams; + return { + ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }) + }; }; const serializeAws_json1_1DeletePredictorRequest = ( input: DeletePredictorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PredictorArn !== undefined) { - bodyParams["PredictorArn"] = input.PredictorArn; - } - return bodyParams; + return { + ...(input.PredictorArn !== undefined && { + PredictorArn: input.PredictorArn + }) + }; }; const serializeAws_json1_1DescribeDatasetGroupRequest = ( input: DescribeDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetGroupArn !== undefined) { - bodyParams["DatasetGroupArn"] = input.DatasetGroupArn; - } - return bodyParams; + return { + ...(input.DatasetGroupArn !== undefined && { + DatasetGroupArn: input.DatasetGroupArn + }) + }; }; const serializeAws_json1_1DescribeDatasetImportJobRequest = ( input: DescribeDatasetImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetImportJobArn !== undefined) { - bodyParams["DatasetImportJobArn"] = input.DatasetImportJobArn; - } - return bodyParams; + return { + ...(input.DatasetImportJobArn !== undefined && { + DatasetImportJobArn: input.DatasetImportJobArn + }) + }; }; const serializeAws_json1_1DescribeDatasetRequest = ( input: DescribeDatasetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetArn !== undefined) { - bodyParams["DatasetArn"] = input.DatasetArn; - } - return bodyParams; + return { + ...(input.DatasetArn !== undefined && { DatasetArn: input.DatasetArn }) + }; }; const serializeAws_json1_1DescribeForecastExportJobRequest = ( input: DescribeForecastExportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForecastExportJobArn !== undefined) { - bodyParams["ForecastExportJobArn"] = input.ForecastExportJobArn; - } - return bodyParams; + return { + ...(input.ForecastExportJobArn !== undefined && { + ForecastExportJobArn: input.ForecastExportJobArn + }) + }; }; const serializeAws_json1_1DescribeForecastRequest = ( input: DescribeForecastRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForecastArn !== undefined) { - bodyParams["ForecastArn"] = input.ForecastArn; - } - return bodyParams; + return { + ...(input.ForecastArn !== undefined && { ForecastArn: input.ForecastArn }) + }; }; const serializeAws_json1_1DescribePredictorRequest = ( input: DescribePredictorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PredictorArn !== undefined) { - bodyParams["PredictorArn"] = input.PredictorArn; - } - return bodyParams; + return { + ...(input.PredictorArn !== undefined && { + PredictorArn: input.PredictorArn + }) + }; }; const serializeAws_json1_1EncryptionConfig = ( input: EncryptionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KMSKeyArn !== undefined) { - bodyParams["KMSKeyArn"] = input.KMSKeyArn; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.KMSKeyArn !== undefined && { KMSKeyArn: input.KMSKeyArn }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_json1_1EvaluationParameters = ( input: EvaluationParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackTestWindowOffset !== undefined) { - bodyParams["BackTestWindowOffset"] = input.BackTestWindowOffset; - } - if (input.NumberOfBacktestWindows !== undefined) { - bodyParams["NumberOfBacktestWindows"] = input.NumberOfBacktestWindows; - } - return bodyParams; + return { + ...(input.BackTestWindowOffset !== undefined && { + BackTestWindowOffset: input.BackTestWindowOffset + }), + ...(input.NumberOfBacktestWindows !== undefined && { + NumberOfBacktestWindows: input.NumberOfBacktestWindows + }) + }; }; const serializeAws_json1_1Featurization = ( input: Featurization, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.FeaturizationPipeline !== undefined) { - bodyParams[ - "FeaturizationPipeline" - ] = serializeAws_json1_1FeaturizationPipeline( - input.FeaturizationPipeline, - context - ); - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.FeaturizationPipeline !== undefined && { + FeaturizationPipeline: serializeAws_json1_1FeaturizationPipeline( + input.FeaturizationPipeline, + context + ) + }) + }; }; const serializeAws_json1_1FeaturizationConfig = ( input: FeaturizationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Featurizations !== undefined) { - bodyParams["Featurizations"] = serializeAws_json1_1Featurizations( - input.Featurizations, - context - ); - } - if (input.ForecastDimensions !== undefined) { - bodyParams["ForecastDimensions"] = serializeAws_json1_1ForecastDimensions( - input.ForecastDimensions, - context - ); - } - if (input.ForecastFrequency !== undefined) { - bodyParams["ForecastFrequency"] = input.ForecastFrequency; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1FeaturizationMethod = ( input: FeaturizationMethod, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FeaturizationMethodName !== undefined) { - bodyParams["FeaturizationMethodName"] = input.FeaturizationMethodName; - } - if (input.FeaturizationMethodParameters !== undefined) { - bodyParams[ - "FeaturizationMethodParameters" - ] = serializeAws_json1_1FeaturizationMethodParameters( - input.FeaturizationMethodParameters, - context - ); - } - return bodyParams; + return { + ...(input.FeaturizationMethodName !== undefined && { + FeaturizationMethodName: input.FeaturizationMethodName + }), + ...(input.FeaturizationMethodParameters !== undefined && { + FeaturizationMethodParameters: serializeAws_json1_1FeaturizationMethodParameters( + input.FeaturizationMethodParameters, + context + ) + }) + }; }; const serializeAws_json1_1FeaturizationMethodParameters = ( @@ -3328,17 +3274,11 @@ const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = input.Condition; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Condition !== undefined && { Condition: input.Condition }), + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1Filters = ( @@ -3366,64 +3306,54 @@ const serializeAws_json1_1GetAccuracyMetricsRequest = ( input: GetAccuracyMetricsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PredictorArn !== undefined) { - bodyParams["PredictorArn"] = input.PredictorArn; - } - return bodyParams; + return { + ...(input.PredictorArn !== undefined && { + PredictorArn: input.PredictorArn + }) + }; }; const serializeAws_json1_1HyperParameterTuningJobConfig = ( input: HyperParameterTuningJobConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParameterRanges !== undefined) { - bodyParams["ParameterRanges"] = serializeAws_json1_1ParameterRanges( - input.ParameterRanges, - context - ); - } - return bodyParams; + return { + ...(input.ParameterRanges !== undefined && { + ParameterRanges: serializeAws_json1_1ParameterRanges( + input.ParameterRanges, + context + ) + }) + }; }; const serializeAws_json1_1InputDataConfig = ( input: InputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetGroupArn !== undefined) { - bodyParams["DatasetGroupArn"] = input.DatasetGroupArn; - } - if (input.SupplementaryFeatures !== undefined) { - bodyParams[ - "SupplementaryFeatures" - ] = serializeAws_json1_1SupplementaryFeatures( - input.SupplementaryFeatures, - context - ); - } - return bodyParams; + return { + ...(input.DatasetGroupArn !== undefined && { + DatasetGroupArn: input.DatasetGroupArn + }), + ...(input.SupplementaryFeatures !== undefined && { + SupplementaryFeatures: serializeAws_json1_1SupplementaryFeatures( + input.SupplementaryFeatures, + context + ) + }) + }; }; const serializeAws_json1_1IntegerParameterRange = ( input: IntegerParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ScalingType !== undefined) { - bodyParams["ScalingType"] = input.ScalingType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1IntegerParameterRanges = ( @@ -3439,173 +3369,137 @@ const serializeAws_json1_1ListDatasetGroupsRequest = ( input: ListDatasetGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDatasetImportJobsRequest = ( input: ListDatasetImportJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDatasetsRequest = ( input: ListDatasetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListForecastExportJobsRequest = ( input: ListForecastExportJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListForecastsRequest = ( input: ListForecastsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPredictorsRequest = ( input: ListPredictorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ParameterRanges = ( input: ParameterRanges, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CategoricalParameterRanges !== undefined) { - bodyParams[ - "CategoricalParameterRanges" - ] = serializeAws_json1_1CategoricalParameterRanges( - input.CategoricalParameterRanges, - context - ); - } - if (input.ContinuousParameterRanges !== undefined) { - bodyParams[ - "ContinuousParameterRanges" - ] = serializeAws_json1_1ContinuousParameterRanges( - input.ContinuousParameterRanges, - context - ); - } - if (input.IntegerParameterRanges !== undefined) { - bodyParams[ - "IntegerParameterRanges" - ] = serializeAws_json1_1IntegerParameterRanges( - input.IntegerParameterRanges, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1S3Config = ( input: S3Config, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KMSKeyArn !== undefined) { - bodyParams["KMSKeyArn"] = input.KMSKeyArn; - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.KMSKeyArn !== undefined && { KMSKeyArn: input.KMSKeyArn }), + ...(input.Path !== undefined && { Path: input.Path }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_json1_1Schema = ( input: Schema, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1SchemaAttributes( - input.Attributes, - context - ); - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_json1_1SchemaAttributes( + input.Attributes, + context + ) + }) + }; }; const serializeAws_json1_1SchemaAttribute = ( input: SchemaAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.AttributeType !== undefined) { - bodyParams["AttributeType"] = input.AttributeType; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.AttributeType !== undefined && { + AttributeType: input.AttributeType + }) + }; }; const serializeAws_json1_1SchemaAttributes = ( @@ -3621,14 +3515,10 @@ const serializeAws_json1_1SupplementaryFeature = ( input: SupplementaryFeature, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1SupplementaryFeatures = ( @@ -3654,17 +3544,14 @@ const serializeAws_json1_1UpdateDatasetGroupRequest = ( input: UpdateDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatasetArns !== undefined) { - bodyParams["DatasetArns"] = serializeAws_json1_1ArnList( - input.DatasetArns, - context - ); - } - if (input.DatasetGroupArn !== undefined) { - bodyParams["DatasetGroupArn"] = input.DatasetGroupArn; - } - return bodyParams; + return { + ...(input.DatasetArns !== undefined && { + DatasetArns: serializeAws_json1_1ArnList(input.DatasetArns, context) + }), + ...(input.DatasetGroupArn !== undefined && { + DatasetGroupArn: input.DatasetGroupArn + }) + }; }; const serializeAws_json1_1Values = ( diff --git a/clients/client-forecastquery/protocols/Aws_json1_1.ts b/clients/client-forecastquery/protocols/Aws_json1_1.ts index 39b31bbd0029..3792531e75cb 100644 --- a/clients/client-forecastquery/protocols/Aws_json1_1.ts +++ b/clients/client-forecastquery/protocols/Aws_json1_1.ts @@ -249,23 +249,15 @@ const serializeAws_json1_1QueryForecastRequest = ( input: QueryForecastRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndDate !== undefined) { - bodyParams["EndDate"] = input.EndDate; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.ForecastArn !== undefined) { - bodyParams["ForecastArn"] = input.ForecastArn; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StartDate !== undefined) { - bodyParams["StartDate"] = input.StartDate; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1DataPoint = ( diff --git a/clients/client-frauddetector/protocols/Aws_json1_1.ts b/clients/client-frauddetector/protocols/Aws_json1_1.ts index e674a0851118..1ca9dd1b52c2 100644 --- a/clients/client-frauddetector/protocols/Aws_json1_1.ts +++ b/clients/client-frauddetector/protocols/Aws_json1_1.ts @@ -3425,126 +3425,98 @@ const serializeAws_json1_1BatchCreateVariableRequest = ( input: BatchCreateVariableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.variableEntries !== undefined) { - bodyParams["variableEntries"] = serializeAws_json1_1VariableEntryList( - input.variableEntries, - context - ); - } - return bodyParams; + return { + ...(input.variableEntries !== undefined && { + variableEntries: serializeAws_json1_1VariableEntryList( + input.variableEntries, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetVariableRequest = ( input: BatchGetVariableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.names !== undefined) { - bodyParams["names"] = serializeAws_json1_1NameList(input.names, context); - } - return bodyParams; + return { + ...(input.names !== undefined && { + names: serializeAws_json1_1NameList(input.names, context) + }) + }; }; const serializeAws_json1_1CreateDetectorVersionRequest = ( input: CreateDetectorVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.externalModelEndpoints !== undefined) { - bodyParams["externalModelEndpoints"] = serializeAws_json1_1ListOfStrings( - input.externalModelEndpoints, - context - ); - } - if (input.modelVersions !== undefined) { - bodyParams["modelVersions"] = serializeAws_json1_1ListOfModelVersions( - input.modelVersions, - context - ); - } - if (input.rules !== undefined) { - bodyParams["rules"] = serializeAws_json1_1RuleList(input.rules, context); - } - return bodyParams; + 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.rules !== undefined && { + rules: serializeAws_json1_1RuleList(input.rules, context) + }) + }; }; const serializeAws_json1_1CreateModelVersionRequest = ( input: CreateModelVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.modelId !== undefined && { modelId: input.modelId }), + ...(input.modelType !== undefined && { modelType: input.modelType }) + }; }; const serializeAws_json1_1CreateRuleRequest = ( input: CreateRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.expression !== undefined) { - bodyParams["expression"] = input.expression; - } - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - if (input.outcomes !== undefined) { - bodyParams["outcomes"] = serializeAws_json1_1NonEmptyListOfStrings( - input.outcomes, - context - ); - } - if (input.ruleId !== undefined) { - bodyParams["ruleId"] = input.ruleId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateVariableRequest = ( input: CreateVariableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataSource !== undefined) { - bodyParams["dataSource"] = input.dataSource; - } - if (input.dataType !== undefined) { - bodyParams["dataType"] = input.dataType; - } - if (input.defaultValue !== undefined) { - bodyParams["defaultValue"] = input.defaultValue; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.variableType !== undefined) { - bodyParams["variableType"] = input.variableType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CsvIndexToVariableMap = ( @@ -3561,65 +3533,47 @@ const serializeAws_json1_1DeleteDetectorVersionRequest = ( input: DeleteDetectorVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.detectorVersionId !== undefined) { - bodyParams["detectorVersionId"] = input.detectorVersionId; - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && { + detectorVersionId: input.detectorVersionId + }) + }; }; const serializeAws_json1_1DeleteEventRequest = ( input: DeleteEventRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventId !== undefined) { - bodyParams["eventId"] = input.eventId; - } - return bodyParams; + return { + ...(input.eventId !== undefined && { eventId: input.eventId }) + }; }; const serializeAws_json1_1DescribeDetectorRequest = ( input: DescribeDetectorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeModelVersionsRequest = ( input: DescribeModelVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - if (input.modelVersionNumber !== undefined) { - bodyParams["modelVersionNumber"] = input.modelVersionNumber; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EventAttributeMap = ( @@ -3646,173 +3600,121 @@ const serializeAws_json1_1GetDetectorVersionRequest = ( input: GetDetectorVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.detectorVersionId !== undefined) { - bodyParams["detectorVersionId"] = input.detectorVersionId; - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && { + detectorVersionId: input.detectorVersionId + }) + }; }; const serializeAws_json1_1GetDetectorsRequest = ( input: GetDetectorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetExternalModelsRequest = ( input: GetExternalModelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.modelEndpoint !== undefined) { - bodyParams["modelEndpoint"] = input.modelEndpoint; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.modelEndpoint !== undefined && { + modelEndpoint: input.modelEndpoint + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetModelVersionRequest = ( input: GetModelVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - if (input.modelVersionNumber !== undefined) { - bodyParams["modelVersionNumber"] = input.modelVersionNumber; - } - return bodyParams; + return { + ...(input.modelId !== undefined && { modelId: input.modelId }), + ...(input.modelType !== undefined && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && { + modelVersionNumber: input.modelVersionNumber + }) + }; }; const serializeAws_json1_1GetModelsRequest = ( input: GetModelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetOutcomesRequest = ( input: GetOutcomesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.name !== undefined && { name: input.name }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetPredictionRequest = ( input: GetPredictionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.detectorVersionId !== undefined) { - bodyParams["detectorVersionId"] = input.detectorVersionId; - } - if (input.eventAttributes !== undefined) { - bodyParams["eventAttributes"] = serializeAws_json1_1EventAttributeMap( - input.eventAttributes, - context - ); - } - if (input.eventId !== undefined) { - bodyParams["eventId"] = input.eventId; - } - if (input.externalModelEndpointDataBlobs !== undefined) { - bodyParams[ - "externalModelEndpointDataBlobs" - ] = serializeAws_json1_1ExternalModelEndpointDataBlobMap( - input.externalModelEndpointDataBlobs, - context - ); - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && { + detectorVersionId: input.detectorVersionId + }), + ...(input.eventAttributes !== undefined && { + eventAttributes: serializeAws_json1_1EventAttributeMap( + input.eventAttributes, + context + ) + }), + ...(input.eventId !== undefined && { eventId: input.eventId }), + ...(input.externalModelEndpointDataBlobs !== undefined && { + externalModelEndpointDataBlobs: serializeAws_json1_1ExternalModelEndpointDataBlobMap( + input.externalModelEndpointDataBlobs, + context + ) + }) + }; }; const serializeAws_json1_1GetRulesRequest = ( input: GetRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.ruleId !== undefined) { - bodyParams["ruleId"] = input.ruleId; - } - if (input.ruleVersion !== undefined) { - bodyParams["ruleVersion"] = input.ruleVersion; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetVariablesRequest = ( input: GetVariablesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.name !== undefined && { name: input.name }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1JsonKeyToVariableMap = ( @@ -3839,17 +3741,12 @@ const serializeAws_json1_1LabelSchema = ( input: LabelSchema, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.labelKey !== undefined) { - bodyParams["labelKey"] = input.labelKey; - } - if (input.labelMapper !== undefined) { - bodyParams["labelMapper"] = serializeAws_json1_1LabelMapper( - input.labelMapper, - context - ); - } - return bodyParams; + return { + ...(input.labelKey !== undefined && { labelKey: input.labelKey }), + ...(input.labelMapper !== undefined && { + labelMapper: serializeAws_json1_1LabelMapper(input.labelMapper, context) + }) + }; }; const serializeAws_json1_1ListOfModelVersions = ( @@ -3870,75 +3767,59 @@ const serializeAws_json1_1ModelEndpointDataBlob = ( input: ModelEndpointDataBlob, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.byteBuffer !== undefined) { - bodyParams["byteBuffer"] = context.base64Encoder(input.byteBuffer); - } - if (input.contentType !== undefined) { - bodyParams["contentType"] = input.contentType; - } - return bodyParams; + return { + ...(input.byteBuffer !== undefined && { + byteBuffer: context.base64Encoder(input.byteBuffer) + }), + ...(input.contentType !== undefined && { contentType: input.contentType }) + }; }; const serializeAws_json1_1ModelInputConfiguration = ( input: ModelInputConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.csvInputTemplate !== undefined) { - bodyParams["csvInputTemplate"] = input.csvInputTemplate; - } - if (input.format !== undefined) { - bodyParams["format"] = input.format; - } - if (input.isOpaque !== undefined) { - bodyParams["isOpaque"] = input.isOpaque; - } - if (input.jsonInputTemplate !== undefined) { - bodyParams["jsonInputTemplate"] = input.jsonInputTemplate; - } - return bodyParams; + return { + ...(input.csvInputTemplate !== undefined && { + csvInputTemplate: input.csvInputTemplate + }), + ...(input.format !== undefined && { format: input.format }), + ...(input.isOpaque !== undefined && { isOpaque: input.isOpaque }), + ...(input.jsonInputTemplate !== undefined && { + jsonInputTemplate: input.jsonInputTemplate + }) + }; }; const serializeAws_json1_1ModelOutputConfiguration = ( input: ModelOutputConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.csvIndexToVariableMap !== undefined) { - bodyParams[ - "csvIndexToVariableMap" - ] = serializeAws_json1_1CsvIndexToVariableMap( - input.csvIndexToVariableMap, - context - ); - } - if (input.format !== undefined) { - bodyParams["format"] = input.format; - } - if (input.jsonKeyToVariableMap !== undefined) { - bodyParams[ - "jsonKeyToVariableMap" - ] = serializeAws_json1_1JsonKeyToVariableMap( - input.jsonKeyToVariableMap, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ModelVariable = ( input: ModelVariable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.index !== undefined) { - bodyParams["index"] = input.index; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.index !== undefined && { index: input.index }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1ModelVariablesList = ( @@ -3952,17 +3833,13 @@ const serializeAws_json1_1ModelVersion = ( input: ModelVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - if (input.modelVersionNumber !== undefined) { - bodyParams["modelVersionNumber"] = input.modelVersionNumber; - } - return bodyParams; + return { + ...(input.modelId !== undefined && { modelId: input.modelId }), + ...(input.modelType !== undefined && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && { + modelVersionNumber: input.modelVersionNumber + }) + }; }; const serializeAws_json1_1NameList = ( @@ -3983,130 +3860,97 @@ const serializeAws_json1_1PutDetectorRequest = ( input: PutDetectorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.detectorId !== undefined && { detectorId: input.detectorId }) + }; }; const serializeAws_json1_1PutExternalModelRequest = ( input: PutExternalModelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inputConfiguration !== undefined) { - bodyParams[ - "inputConfiguration" - ] = serializeAws_json1_1ModelInputConfiguration( - input.inputConfiguration, - context - ); - } - if (input.modelEndpoint !== undefined) { - bodyParams["modelEndpoint"] = input.modelEndpoint; - } - if (input.modelEndpointStatus !== undefined) { - bodyParams["modelEndpointStatus"] = input.modelEndpointStatus; - } - if (input.modelSource !== undefined) { - bodyParams["modelSource"] = input.modelSource; - } - if (input.outputConfiguration !== undefined) { - bodyParams[ - "outputConfiguration" - ] = serializeAws_json1_1ModelOutputConfiguration( - input.outputConfiguration, - context - ); - } - if (input.role !== undefined) { - bodyParams["role"] = serializeAws_json1_1Role(input.role, context); - } - return bodyParams; + return { + ...(input.inputConfiguration !== undefined && { + inputConfiguration: serializeAws_json1_1ModelInputConfiguration( + input.inputConfiguration, + context + ) + }), + ...(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.role !== undefined && { + role: serializeAws_json1_1Role(input.role, context) + }) + }; }; const serializeAws_json1_1PutModelRequest = ( input: PutModelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.labelSchema !== undefined) { - bodyParams["labelSchema"] = serializeAws_json1_1LabelSchema( - input.labelSchema, - context - ); - } - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - if (input.modelVariables !== undefined) { - bodyParams["modelVariables"] = serializeAws_json1_1ModelVariablesList( - input.modelVariables, - context - ); - } - if (input.trainingDataSource !== undefined) { - bodyParams["trainingDataSource"] = serializeAws_json1_1TrainingDataSource( - input.trainingDataSource, - context - ); - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.labelSchema !== undefined && { + labelSchema: serializeAws_json1_1LabelSchema(input.labelSchema, context) + }), + ...(input.modelId !== undefined && { modelId: input.modelId }), + ...(input.modelType !== undefined && { modelType: input.modelType }), + ...(input.modelVariables !== undefined && { + modelVariables: serializeAws_json1_1ModelVariablesList( + input.modelVariables, + context + ) + }), + ...(input.trainingDataSource !== undefined && { + trainingDataSource: serializeAws_json1_1TrainingDataSource( + input.trainingDataSource, + context + ) + }) + }; }; const serializeAws_json1_1PutOutcomeRequest = ( input: PutOutcomeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1Role = ( input: Role, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.arn !== undefined) { - bodyParams["arn"] = input.arn; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.arn !== undefined && { arn: input.arn }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1Rule = ( input: Rule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.ruleId !== undefined) { - bodyParams["ruleId"] = input.ruleId; - } - if (input.ruleVersion !== undefined) { - bodyParams["ruleVersion"] = input.ruleVersion; - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.ruleId !== undefined && { ruleId: input.ruleId }), + ...(input.ruleVersion !== undefined && { ruleVersion: input.ruleVersion }) + }; }; const serializeAws_json1_1RuleList = ( @@ -4120,189 +3964,149 @@ const serializeAws_json1_1TrainingDataSource = ( input: TrainingDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataAccessRoleArn !== undefined) { - bodyParams["dataAccessRoleArn"] = input.dataAccessRoleArn; - } - if (input.dataLocation !== undefined) { - bodyParams["dataLocation"] = input.dataLocation; - } - return bodyParams; + return { + ...(input.dataAccessRoleArn !== undefined && { + dataAccessRoleArn: input.dataAccessRoleArn + }), + ...(input.dataLocation !== undefined && { + dataLocation: input.dataLocation + }) + }; }; const serializeAws_json1_1UpdateDetectorVersionMetadataRequest = ( input: UpdateDetectorVersionMetadataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.detectorVersionId !== undefined) { - bodyParams["detectorVersionId"] = input.detectorVersionId; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && { + detectorVersionId: input.detectorVersionId + }) + }; }; const serializeAws_json1_1UpdateDetectorVersionRequest = ( input: UpdateDetectorVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.detectorVersionId !== undefined) { - bodyParams["detectorVersionId"] = input.detectorVersionId; - } - if (input.externalModelEndpoints !== undefined) { - bodyParams["externalModelEndpoints"] = serializeAws_json1_1ListOfStrings( - input.externalModelEndpoints, - context - ); - } - if (input.modelVersions !== undefined) { - bodyParams["modelVersions"] = serializeAws_json1_1ListOfModelVersions( - input.modelVersions, - context - ); - } - if (input.rules !== undefined) { - bodyParams["rules"] = serializeAws_json1_1RuleList(input.rules, context); - } - return bodyParams; + 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.rules !== undefined && { + rules: serializeAws_json1_1RuleList(input.rules, context) + }) + }; }; const serializeAws_json1_1UpdateDetectorVersionStatusRequest = ( input: UpdateDetectorVersionStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorId !== undefined) { - bodyParams["detectorId"] = input.detectorId; - } - if (input.detectorVersionId !== undefined) { - bodyParams["detectorVersionId"] = input.detectorVersionId; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.detectorId !== undefined && { detectorId: input.detectorId }), + ...(input.detectorVersionId !== undefined && { + detectorVersionId: input.detectorVersionId + }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1UpdateModelVersionRequest = ( input: UpdateModelVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.modelId !== undefined) { - bodyParams["modelId"] = input.modelId; - } - if (input.modelType !== undefined) { - bodyParams["modelType"] = input.modelType; - } - if (input.modelVersionNumber !== undefined) { - bodyParams["modelVersionNumber"] = input.modelVersionNumber; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.modelId !== undefined && { modelId: input.modelId }), + ...(input.modelType !== undefined && { modelType: input.modelType }), + ...(input.modelVersionNumber !== undefined && { + modelVersionNumber: input.modelVersionNumber + }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_1UpdateRuleMetadataRequest = ( input: UpdateRuleMetadataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.rule !== undefined) { - bodyParams["rule"] = serializeAws_json1_1Rule(input.rule, context); - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.rule !== undefined && { + rule: serializeAws_json1_1Rule(input.rule, context) + }) + }; }; const serializeAws_json1_1UpdateRuleVersionRequest = ( input: UpdateRuleVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.expression !== undefined) { - bodyParams["expression"] = input.expression; - } - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - if (input.outcomes !== undefined) { - bodyParams["outcomes"] = serializeAws_json1_1NonEmptyListOfStrings( - input.outcomes, - context - ); - } - if (input.rule !== undefined) { - bodyParams["rule"] = serializeAws_json1_1Rule(input.rule, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateVariableRequest = ( input: UpdateVariableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultValue !== undefined) { - bodyParams["defaultValue"] = input.defaultValue; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.variableType !== undefined) { - bodyParams["variableType"] = input.variableType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1VariableEntry = ( input: VariableEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataSource !== undefined) { - bodyParams["dataSource"] = input.dataSource; - } - if (input.dataType !== undefined) { - bodyParams["dataType"] = input.dataType; - } - if (input.defaultValue !== undefined) { - bodyParams["defaultValue"] = input.defaultValue; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.variableType !== undefined) { - bodyParams["variableType"] = input.variableType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1VariableEntryList = ( diff --git a/clients/client-fsx/protocols/Aws_json1_1.ts b/clients/client-fsx/protocols/Aws_json1_1.ts index 7ff7613e1018..6df390568169 100644 --- a/clients/client-fsx/protocols/Aws_json1_1.ts +++ b/clients/client-fsx/protocols/Aws_json1_1.ts @@ -2301,259 +2301,195 @@ const serializeAws_json1_1CancelDataRepositoryTaskRequest = ( input: CancelDataRepositoryTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskId !== undefined) { - bodyParams["TaskId"] = input.TaskId; - } - return bodyParams; + return { + ...(input.TaskId !== undefined && { TaskId: input.TaskId }) + }; }; const serializeAws_json1_1CompletionReport = ( input: CompletionReport, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateBackupRequest = ( input: CreateBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.FileSystemId !== undefined) { - bodyParams["FileSystemId"] = input.FileSystemId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.FileSystemId !== undefined && { + FileSystemId: input.FileSystemId + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateDataRepositoryTaskRequest = ( input: CreateDataRepositoryTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.FileSystemId !== undefined) { - bodyParams["FileSystemId"] = input.FileSystemId; - } - if (input.Paths !== undefined) { - bodyParams["Paths"] = serializeAws_json1_1DataRepositoryTaskPaths( - input.Paths, - context - ); - } - if (input.Report !== undefined) { - bodyParams["Report"] = serializeAws_json1_1CompletionReport( - input.Report, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateFileSystemFromBackupRequest = ( input: CreateFileSystemFromBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.WindowsConfiguration !== undefined) { - bodyParams[ - "WindowsConfiguration" - ] = serializeAws_json1_1CreateFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds( + input.SecurityGroupIds, + context + ) + }), + ...(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 + ) + }) + }; }; const serializeAws_json1_1CreateFileSystemLustreConfiguration = ( input: CreateFileSystemLustreConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExportPath !== undefined) { - bodyParams["ExportPath"] = input.ExportPath; - } - if (input.ImportPath !== undefined) { - bodyParams["ImportPath"] = input.ImportPath; - } - if (input.ImportedFileChunkSize !== undefined) { - bodyParams["ImportedFileChunkSize"] = input.ImportedFileChunkSize; - } - if (input.WeeklyMaintenanceStartTime !== undefined) { - bodyParams["WeeklyMaintenanceStartTime"] = input.WeeklyMaintenanceStartTime; - } - return bodyParams; + return { + ...(input.ExportPath !== undefined && { ExportPath: input.ExportPath }), + ...(input.ImportPath !== undefined && { ImportPath: input.ImportPath }), + ...(input.ImportedFileChunkSize !== undefined && { + ImportedFileChunkSize: input.ImportedFileChunkSize + }), + ...(input.WeeklyMaintenanceStartTime !== undefined && { + WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime + }) + }; }; const serializeAws_json1_1CreateFileSystemRequest = ( input: CreateFileSystemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.FileSystemType !== undefined) { - bodyParams["FileSystemType"] = input.FileSystemType; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.LustreConfiguration !== undefined) { - bodyParams[ - "LustreConfiguration" - ] = serializeAws_json1_1CreateFileSystemLustreConfiguration( - input.LustreConfiguration, - context - ); - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.StorageCapacity !== undefined) { - bodyParams["StorageCapacity"] = input.StorageCapacity; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.WindowsConfiguration !== undefined) { - bodyParams[ - "WindowsConfiguration" - ] = serializeAws_json1_1CreateFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ); - } - return bodyParams; + 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.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 + ) + }) + }; }; const serializeAws_json1_1CreateFileSystemWindowsConfiguration = ( input: CreateFileSystemWindowsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActiveDirectoryId !== undefined) { - bodyParams["ActiveDirectoryId"] = input.ActiveDirectoryId; - } - if (input.AutomaticBackupRetentionDays !== undefined) { - bodyParams["AutomaticBackupRetentionDays"] = - input.AutomaticBackupRetentionDays; - } - if (input.CopyTagsToBackups !== undefined) { - bodyParams["CopyTagsToBackups"] = input.CopyTagsToBackups; - } - if (input.DailyAutomaticBackupStartTime !== undefined) { - bodyParams["DailyAutomaticBackupStartTime"] = - input.DailyAutomaticBackupStartTime; - } - if (input.DeploymentType !== undefined) { - bodyParams["DeploymentType"] = input.DeploymentType; - } - if (input.PreferredSubnetId !== undefined) { - bodyParams["PreferredSubnetId"] = input.PreferredSubnetId; - } - if (input.SelfManagedActiveDirectoryConfiguration !== undefined) { - bodyParams[ - "SelfManagedActiveDirectoryConfiguration" - ] = serializeAws_json1_1SelfManagedActiveDirectoryConfiguration( - input.SelfManagedActiveDirectoryConfiguration, - context - ); - } - if (input.ThroughputCapacity !== undefined) { - bodyParams["ThroughputCapacity"] = input.ThroughputCapacity; - } - if (input.WeeklyMaintenanceStartTime !== undefined) { - bodyParams["WeeklyMaintenanceStartTime"] = input.WeeklyMaintenanceStartTime; - } - return bodyParams; + return { + ...(input.ActiveDirectoryId !== undefined && { + ActiveDirectoryId: input.ActiveDirectoryId + }), + ...(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 + }) + }; }; const serializeAws_json1_1DataRepositoryTaskFilter = ( input: DataRepositoryTaskFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1DataRepositoryTaskFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1DataRepositoryTaskFilterValues( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1DataRepositoryTaskFilterValues = ( @@ -2583,125 +2519,93 @@ const serializeAws_json1_1DeleteBackupRequest = ( input: DeleteBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - return bodyParams; + return { + ...(input.BackupId !== undefined && { BackupId: input.BackupId }), + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken() + }; }; const serializeAws_json1_1DeleteFileSystemRequest = ( input: DeleteFileSystemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.FileSystemId !== undefined) { - bodyParams["FileSystemId"] = input.FileSystemId; - } - if (input.WindowsConfiguration !== undefined) { - bodyParams[ - "WindowsConfiguration" - ] = serializeAws_json1_1DeleteFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ); - } - return bodyParams; + return { + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.FileSystemId !== undefined && { + FileSystemId: input.FileSystemId + }), + ...(input.WindowsConfiguration !== undefined && { + WindowsConfiguration: serializeAws_json1_1DeleteFileSystemWindowsConfiguration( + input.WindowsConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1DeleteFileSystemWindowsConfiguration = ( input: DeleteFileSystemWindowsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FinalBackupTags !== undefined) { - bodyParams["FinalBackupTags"] = serializeAws_json1_1Tags( - input.FinalBackupTags, - context - ); - } - if (input.SkipFinalBackup !== undefined) { - bodyParams["SkipFinalBackup"] = input.SkipFinalBackup; - } - return bodyParams; + return { + ...(input.FinalBackupTags !== undefined && { + FinalBackupTags: serializeAws_json1_1Tags(input.FinalBackupTags, context) + }), + ...(input.SkipFinalBackup !== undefined && { + SkipFinalBackup: input.SkipFinalBackup + }) + }; }; const serializeAws_json1_1DescribeBackupsRequest = ( input: DescribeBackupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupIds !== undefined) { - bodyParams["BackupIds"] = serializeAws_json1_1BackupIds( - input.BackupIds, - context - ); - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeDataRepositoryTasksRequest = ( input: DescribeDataRepositoryTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1DataRepositoryTaskFilters( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TaskIds !== undefined) { - bodyParams["TaskIds"] = serializeAws_json1_1TaskIds(input.TaskIds, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeFileSystemsRequest = ( input: DescribeFileSystemsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileSystemIds !== undefined) { - bodyParams["FileSystemIds"] = serializeAws_json1_1FileSystemIds( - input.FileSystemIds, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.FileSystemIds !== undefined && { + FileSystemIds: serializeAws_json1_1FileSystemIds( + input.FileSystemIds, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DnsIps = ( @@ -2722,17 +2626,12 @@ const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1FilterValues = ( @@ -2753,17 +2652,11 @@ const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1SecurityGroupIds = ( @@ -2777,45 +2670,34 @@ const serializeAws_json1_1SelfManagedActiveDirectoryConfiguration = ( input: SelfManagedActiveDirectoryConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DnsIps !== undefined) { - bodyParams["DnsIps"] = serializeAws_json1_1DnsIps(input.DnsIps, context); - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.FileSystemAdministratorsGroup !== undefined) { - bodyParams["FileSystemAdministratorsGroup"] = - input.FileSystemAdministratorsGroup; - } - if (input.OrganizationalUnitDistinguishedName !== undefined) { - bodyParams["OrganizationalUnitDistinguishedName"] = - input.OrganizationalUnitDistinguishedName; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SelfManagedActiveDirectoryConfigurationUpdates = ( input: SelfManagedActiveDirectoryConfigurationUpdates, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DnsIps !== undefined) { - bodyParams["DnsIps"] = serializeAws_json1_1DnsIps(input.DnsIps, context); - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.DnsIps !== undefined && { + DnsIps: serializeAws_json1_1DnsIps(input.DnsIps, context) + }), + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1SubnetIds = ( @@ -2826,14 +2708,10 @@ const serializeAws_json1_1SubnetIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -2847,14 +2725,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -2875,85 +2751,70 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateFileSystemLustreConfiguration = ( input: UpdateFileSystemLustreConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WeeklyMaintenanceStartTime !== undefined) { - bodyParams["WeeklyMaintenanceStartTime"] = input.WeeklyMaintenanceStartTime; - } - return bodyParams; + return { + ...(input.WeeklyMaintenanceStartTime !== undefined && { + WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime + }) + }; }; const serializeAws_json1_1UpdateFileSystemRequest = ( input: UpdateFileSystemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.FileSystemId !== undefined) { - bodyParams["FileSystemId"] = input.FileSystemId; - } - if (input.LustreConfiguration !== undefined) { - bodyParams[ - "LustreConfiguration" - ] = serializeAws_json1_1UpdateFileSystemLustreConfiguration( - input.LustreConfiguration, - context - ); - } - if (input.WindowsConfiguration !== undefined) { - bodyParams[ - "WindowsConfiguration" - ] = serializeAws_json1_1UpdateFileSystemWindowsConfiguration( - input.WindowsConfiguration, - context - ); - } - return bodyParams; + return { + ClientRequestToken: input.ClientRequestToken ?? generateIdempotencyToken(), + ...(input.FileSystemId !== undefined && { + FileSystemId: input.FileSystemId + }), + ...(input.LustreConfiguration !== undefined && { + LustreConfiguration: serializeAws_json1_1UpdateFileSystemLustreConfiguration( + input.LustreConfiguration, + context + ) + }), + ...(input.WindowsConfiguration !== undefined && { + WindowsConfiguration: serializeAws_json1_1UpdateFileSystemWindowsConfiguration( + input.WindowsConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1UpdateFileSystemWindowsConfiguration = ( input: UpdateFileSystemWindowsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomaticBackupRetentionDays !== undefined) { - bodyParams["AutomaticBackupRetentionDays"] = - input.AutomaticBackupRetentionDays; - } - if (input.DailyAutomaticBackupStartTime !== undefined) { - bodyParams["DailyAutomaticBackupStartTime"] = - input.DailyAutomaticBackupStartTime; - } - if (input.SelfManagedActiveDirectoryConfiguration !== undefined) { - bodyParams[ - "SelfManagedActiveDirectoryConfiguration" - ] = serializeAws_json1_1SelfManagedActiveDirectoryConfigurationUpdates( - input.SelfManagedActiveDirectoryConfiguration, - context - ); - } - if (input.WeeklyMaintenanceStartTime !== undefined) { - bodyParams["WeeklyMaintenanceStartTime"] = input.WeeklyMaintenanceStartTime; - } - return bodyParams; + return { + ...(input.AutomaticBackupRetentionDays !== undefined && { + AutomaticBackupRetentionDays: input.AutomaticBackupRetentionDays + }), + ...(input.DailyAutomaticBackupStartTime !== undefined && { + DailyAutomaticBackupStartTime: input.DailyAutomaticBackupStartTime + }), + ...(input.SelfManagedActiveDirectoryConfiguration !== undefined && { + SelfManagedActiveDirectoryConfiguration: serializeAws_json1_1SelfManagedActiveDirectoryConfigurationUpdates( + input.SelfManagedActiveDirectoryConfiguration, + context + ) + }), + ...(input.WeeklyMaintenanceStartTime !== undefined && { + WeeklyMaintenanceStartTime: input.WeeklyMaintenanceStartTime + }) + }; }; const deserializeAws_json1_1ActiveDirectoryBackupAttributes = ( diff --git a/clients/client-gamelift/protocols/Aws_json1_1.ts b/clients/client-gamelift/protocols/Aws_json1_1.ts index 28e8b2b2fd9d..1be565fe5aca 100644 --- a/clients/client-gamelift/protocols/Aws_json1_1.ts +++ b/clients/client-gamelift/protocols/Aws_json1_1.ts @@ -9555,938 +9555,734 @@ const serializeAws_json1_1AcceptMatchInput = ( input: AcceptMatchInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptanceType !== undefined) { - bodyParams["AcceptanceType"] = input.AcceptanceType; - } - if (input.PlayerIds !== undefined) { - bodyParams["PlayerIds"] = serializeAws_json1_1StringList( - input.PlayerIds, - context - ); - } - if (input.TicketId !== undefined) { - bodyParams["TicketId"] = input.TicketId; - } - return bodyParams; + return { + ...(input.AcceptanceType !== undefined && { + AcceptanceType: input.AcceptanceType + }), + ...(input.PlayerIds !== undefined && { + PlayerIds: serializeAws_json1_1StringList(input.PlayerIds, context) + }), + ...(input.TicketId !== undefined && { TicketId: input.TicketId }) + }; }; const serializeAws_json1_1AttributeValue = ( input: AttributeValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.N !== undefined) { - bodyParams["N"] = input.N; - } - if (input.S !== undefined) { - bodyParams["S"] = input.S; - } - if (input.SDM !== undefined) { - bodyParams["SDM"] = serializeAws_json1_1StringDoubleMap(input.SDM, context); - } - if (input.SL !== undefined) { - bodyParams["SL"] = serializeAws_json1_1StringList(input.SL, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CertificateConfiguration = ( input: CertificateConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateType !== undefined) { - bodyParams["CertificateType"] = input.CertificateType; - } - return bodyParams; + return { + ...(input.CertificateType !== undefined && { + CertificateType: input.CertificateType + }) + }; }; const serializeAws_json1_1CreateAliasInput = ( input: CreateAliasInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoutingStrategy !== undefined) { - bodyParams["RoutingStrategy"] = serializeAws_json1_1RoutingStrategy( - input.RoutingStrategy, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateBuildInput = ( input: CreateBuildInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OperatingSystem !== undefined) { - bodyParams["OperatingSystem"] = input.OperatingSystem; - } - if (input.StorageLocation !== undefined) { - bodyParams["StorageLocation"] = serializeAws_json1_1S3Location( - input.StorageLocation, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateFleetInput = ( input: CreateFleetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BuildId !== undefined) { - bodyParams["BuildId"] = input.BuildId; - } - if (input.CertificateConfiguration !== undefined) { - bodyParams[ - "CertificateConfiguration" - ] = serializeAws_json1_1CertificateConfiguration( - input.CertificateConfiguration, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.EC2InboundPermissions !== undefined) { - bodyParams["EC2InboundPermissions"] = serializeAws_json1_1IpPermissionsList( - input.EC2InboundPermissions, - context - ); - } - if (input.EC2InstanceType !== undefined) { - bodyParams["EC2InstanceType"] = input.EC2InstanceType; - } - if (input.FleetType !== undefined) { - bodyParams["FleetType"] = input.FleetType; - } - if (input.InstanceRoleArn !== undefined) { - bodyParams["InstanceRoleArn"] = input.InstanceRoleArn; - } - if (input.LogPaths !== undefined) { - bodyParams["LogPaths"] = serializeAws_json1_1StringList( - input.LogPaths, - context - ); - } - if (input.MetricGroups !== undefined) { - bodyParams["MetricGroups"] = serializeAws_json1_1MetricGroupList( - input.MetricGroups, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NewGameSessionProtectionPolicy !== undefined) { - bodyParams["NewGameSessionProtectionPolicy"] = - input.NewGameSessionProtectionPolicy; - } - if (input.PeerVpcAwsAccountId !== undefined) { - bodyParams["PeerVpcAwsAccountId"] = input.PeerVpcAwsAccountId; - } - if (input.PeerVpcId !== undefined) { - bodyParams["PeerVpcId"] = input.PeerVpcId; - } - if (input.ResourceCreationLimitPolicy !== undefined) { - bodyParams[ - "ResourceCreationLimitPolicy" - ] = serializeAws_json1_1ResourceCreationLimitPolicy( - input.ResourceCreationLimitPolicy, - context - ); - } - if (input.RuntimeConfiguration !== undefined) { - bodyParams[ - "RuntimeConfiguration" - ] = serializeAws_json1_1RuntimeConfiguration( - input.RuntimeConfiguration, - context - ); - } - if (input.ScriptId !== undefined) { - bodyParams["ScriptId"] = input.ScriptId; - } - if (input.ServerLaunchParameters !== undefined) { - bodyParams["ServerLaunchParameters"] = input.ServerLaunchParameters; - } - if (input.ServerLaunchPath !== undefined) { - bodyParams["ServerLaunchPath"] = input.ServerLaunchPath; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateGameSessionInput = ( input: CreateGameSessionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - if (input.CreatorId !== undefined) { - bodyParams["CreatorId"] = input.CreatorId; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.GameProperties !== undefined) { - bodyParams["GameProperties"] = serializeAws_json1_1GamePropertyList( - input.GameProperties, - context - ); - } - if (input.GameSessionData !== undefined) { - bodyParams["GameSessionData"] = input.GameSessionData; - } - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.MaximumPlayerSessionCount !== undefined) { - bodyParams["MaximumPlayerSessionCount"] = input.MaximumPlayerSessionCount; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateGameSessionQueueInput = ( input: CreateGameSessionQueueInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destinations !== undefined) { - bodyParams[ - "Destinations" - ] = serializeAws_json1_1GameSessionQueueDestinationList( - input.Destinations, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PlayerLatencyPolicies !== undefined) { - bodyParams[ - "PlayerLatencyPolicies" - ] = serializeAws_json1_1PlayerLatencyPolicyList( - input.PlayerLatencyPolicies, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TimeoutInSeconds !== undefined) { - bodyParams["TimeoutInSeconds"] = input.TimeoutInSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateMatchmakingConfigurationInput = ( input: CreateMatchmakingConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptanceRequired !== undefined) { - bodyParams["AcceptanceRequired"] = input.AcceptanceRequired; - } - if (input.AcceptanceTimeoutSeconds !== undefined) { - bodyParams["AcceptanceTimeoutSeconds"] = input.AcceptanceTimeoutSeconds; - } - if (input.AdditionalPlayerCount !== undefined) { - bodyParams["AdditionalPlayerCount"] = input.AdditionalPlayerCount; - } - if (input.BackfillMode !== undefined) { - bodyParams["BackfillMode"] = input.BackfillMode; - } - if (input.CustomEventData !== undefined) { - bodyParams["CustomEventData"] = input.CustomEventData; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GameProperties !== undefined) { - bodyParams["GameProperties"] = serializeAws_json1_1GamePropertyList( - input.GameProperties, - context - ); - } - if (input.GameSessionData !== undefined) { - bodyParams["GameSessionData"] = input.GameSessionData; - } - if (input.GameSessionQueueArns !== undefined) { - bodyParams["GameSessionQueueArns"] = serializeAws_json1_1QueueArnsList( - input.GameSessionQueueArns, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NotificationTarget !== undefined) { - bodyParams["NotificationTarget"] = input.NotificationTarget; - } - if (input.RequestTimeoutSeconds !== undefined) { - bodyParams["RequestTimeoutSeconds"] = input.RequestTimeoutSeconds; - } - if (input.RuleSetName !== undefined) { - bodyParams["RuleSetName"] = input.RuleSetName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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.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) + }) + }; }; const serializeAws_json1_1CreateMatchmakingRuleSetInput = ( input: CreateMatchmakingRuleSetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RuleSetBody !== undefined) { - bodyParams["RuleSetBody"] = input.RuleSetBody; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RuleSetBody !== undefined && { RuleSetBody: input.RuleSetBody }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreatePlayerSessionInput = ( input: CreatePlayerSessionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.PlayerData !== undefined) { - bodyParams["PlayerData"] = input.PlayerData; - } - if (input.PlayerId !== undefined) { - bodyParams["PlayerId"] = input.PlayerId; - } - return bodyParams; + return { + ...(input.GameSessionId !== undefined && { + GameSessionId: input.GameSessionId + }), + ...(input.PlayerData !== undefined && { PlayerData: input.PlayerData }), + ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }) + }; }; const serializeAws_json1_1CreatePlayerSessionsInput = ( input: CreatePlayerSessionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.PlayerDataMap !== undefined) { - bodyParams["PlayerDataMap"] = serializeAws_json1_1PlayerDataMap( - input.PlayerDataMap, - context - ); - } - if (input.PlayerIds !== undefined) { - bodyParams["PlayerIds"] = serializeAws_json1_1PlayerIdList( - input.PlayerIds, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateScriptInput = ( input: CreateScriptInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.StorageLocation !== undefined) { - bodyParams["StorageLocation"] = serializeAws_json1_1S3Location( - input.StorageLocation, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - if (input.ZipFile !== undefined) { - bodyParams["ZipFile"] = context.base64Encoder(input.ZipFile); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateVpcPeeringAuthorizationInput = ( input: CreateVpcPeeringAuthorizationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameLiftAwsAccountId !== undefined) { - bodyParams["GameLiftAwsAccountId"] = input.GameLiftAwsAccountId; - } - if (input.PeerVpcId !== undefined) { - bodyParams["PeerVpcId"] = input.PeerVpcId; - } - return bodyParams; + return { + ...(input.GameLiftAwsAccountId !== undefined && { + GameLiftAwsAccountId: input.GameLiftAwsAccountId + }), + ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }) + }; }; const serializeAws_json1_1CreateVpcPeeringConnectionInput = ( input: CreateVpcPeeringConnectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.PeerVpcAwsAccountId !== undefined) { - bodyParams["PeerVpcAwsAccountId"] = input.PeerVpcAwsAccountId; - } - if (input.PeerVpcId !== undefined) { - bodyParams["PeerVpcId"] = input.PeerVpcId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.PeerVpcAwsAccountId !== undefined && { + PeerVpcAwsAccountId: input.PeerVpcAwsAccountId + }), + ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }) + }; }; const serializeAws_json1_1DeleteAliasInput = ( input: DeleteAliasInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - return bodyParams; + return { + ...(input.AliasId !== undefined && { AliasId: input.AliasId }) + }; }; const serializeAws_json1_1DeleteBuildInput = ( input: DeleteBuildInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BuildId !== undefined) { - bodyParams["BuildId"] = input.BuildId; - } - return bodyParams; + return { + ...(input.BuildId !== undefined && { BuildId: input.BuildId }) + }; }; const serializeAws_json1_1DeleteFleetInput = ( input: DeleteFleetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }) + }; }; const serializeAws_json1_1DeleteGameSessionQueueInput = ( input: DeleteGameSessionQueueInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteMatchmakingConfigurationInput = ( input: DeleteMatchmakingConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteMatchmakingRuleSetInput = ( input: DeleteMatchmakingRuleSetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteScalingPolicyInput = ( input: DeleteScalingPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteScriptInput = ( input: DeleteScriptInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScriptId !== undefined) { - bodyParams["ScriptId"] = input.ScriptId; - } - return bodyParams; + return { + ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }) + }; }; const serializeAws_json1_1DeleteVpcPeeringAuthorizationInput = ( input: DeleteVpcPeeringAuthorizationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameLiftAwsAccountId !== undefined) { - bodyParams["GameLiftAwsAccountId"] = input.GameLiftAwsAccountId; - } - if (input.PeerVpcId !== undefined) { - bodyParams["PeerVpcId"] = input.PeerVpcId; - } - return bodyParams; + return { + ...(input.GameLiftAwsAccountId !== undefined && { + GameLiftAwsAccountId: input.GameLiftAwsAccountId + }), + ...(input.PeerVpcId !== undefined && { PeerVpcId: input.PeerVpcId }) + }; }; const serializeAws_json1_1DeleteVpcPeeringConnectionInput = ( input: DeleteVpcPeeringConnectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.VpcPeeringConnectionId !== undefined) { - bodyParams["VpcPeeringConnectionId"] = input.VpcPeeringConnectionId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.VpcPeeringConnectionId !== undefined && { + VpcPeeringConnectionId: input.VpcPeeringConnectionId + }) + }; }; const serializeAws_json1_1DescribeAliasInput = ( input: DescribeAliasInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - return bodyParams; + return { + ...(input.AliasId !== undefined && { AliasId: input.AliasId }) + }; }; const serializeAws_json1_1DescribeBuildInput = ( input: DescribeBuildInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BuildId !== undefined) { - bodyParams["BuildId"] = input.BuildId; - } - return bodyParams; + return { + ...(input.BuildId !== undefined && { BuildId: input.BuildId }) + }; }; const serializeAws_json1_1DescribeEC2InstanceLimitsInput = ( input: DescribeEC2InstanceLimitsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EC2InstanceType !== undefined) { - bodyParams["EC2InstanceType"] = input.EC2InstanceType; - } - return bodyParams; + return { + ...(input.EC2InstanceType !== undefined && { + EC2InstanceType: input.EC2InstanceType + }) + }; }; const serializeAws_json1_1DescribeFleetAttributesInput = ( input: DescribeFleetAttributesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetIds !== undefined) { - bodyParams["FleetIds"] = serializeAws_json1_1FleetIdList( - input.FleetIds, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.FleetIds !== undefined && { + FleetIds: serializeAws_json1_1FleetIdList(input.FleetIds, context) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeFleetCapacityInput = ( input: DescribeFleetCapacityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetIds !== undefined) { - bodyParams["FleetIds"] = serializeAws_json1_1FleetIdList( - input.FleetIds, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.FleetIds !== undefined && { + FleetIds: serializeAws_json1_1FleetIdList(input.FleetIds, context) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeFleetEventsInput = ( input: DescribeFleetEventsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeFleetPortSettingsInput = ( input: DescribeFleetPortSettingsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }) + }; }; const serializeAws_json1_1DescribeFleetUtilizationInput = ( input: DescribeFleetUtilizationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetIds !== undefined) { - bodyParams["FleetIds"] = serializeAws_json1_1FleetIdList( - input.FleetIds, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.FleetIds !== undefined && { + FleetIds: serializeAws_json1_1FleetIdList(input.FleetIds, context) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeGameSessionDetailsInput = ( input: DescribeGameSessionDetailsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StatusFilter !== undefined) { - bodyParams["StatusFilter"] = input.StatusFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeGameSessionPlacementInput = ( input: DescribeGameSessionPlacementInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PlacementId !== undefined) { - bodyParams["PlacementId"] = input.PlacementId; - } - return bodyParams; + return { + ...(input.PlacementId !== undefined && { PlacementId: input.PlacementId }) + }; }; const serializeAws_json1_1DescribeGameSessionQueuesInput = ( input: DescribeGameSessionQueuesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1GameSessionQueueNameList( - input.Names, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Names !== undefined && { + Names: serializeAws_json1_1GameSessionQueueNameList(input.Names, context) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeGameSessionsInput = ( input: DescribeGameSessionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StatusFilter !== undefined) { - bodyParams["StatusFilter"] = input.StatusFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeInstancesInput = ( input: DescribeInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMatchmakingConfigurationsInput = ( input: DescribeMatchmakingConfigurationsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1MatchmakingConfigurationNameList( - input.Names, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.RuleSetName !== undefined) { - bodyParams["RuleSetName"] = input.RuleSetName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMatchmakingInput = ( input: DescribeMatchmakingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TicketIds !== undefined) { - bodyParams["TicketIds"] = serializeAws_json1_1MatchmakingIdList( - input.TicketIds, - context - ); - } - return bodyParams; + return { + ...(input.TicketIds !== undefined && { + TicketIds: serializeAws_json1_1MatchmakingIdList(input.TicketIds, context) + }) + }; }; const serializeAws_json1_1DescribeMatchmakingRuleSetsInput = ( input: DescribeMatchmakingRuleSetsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1MatchmakingRuleSetNameList( - input.Names, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Names !== undefined && { + Names: serializeAws_json1_1MatchmakingRuleSetNameList( + input.Names, + context + ) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribePlayerSessionsInput = ( input: DescribePlayerSessionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PlayerId !== undefined) { - bodyParams["PlayerId"] = input.PlayerId; - } - if (input.PlayerSessionId !== undefined) { - bodyParams["PlayerSessionId"] = input.PlayerSessionId; - } - if (input.PlayerSessionStatusFilter !== undefined) { - bodyParams["PlayerSessionStatusFilter"] = input.PlayerSessionStatusFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeRuntimeConfigurationInput = ( input: DescribeRuntimeConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }) + }; }; const serializeAws_json1_1DescribeScalingPoliciesInput = ( input: DescribeScalingPoliciesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StatusFilter !== undefined) { - bodyParams["StatusFilter"] = input.StatusFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeScriptInput = ( input: DescribeScriptInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScriptId !== undefined) { - bodyParams["ScriptId"] = input.ScriptId; - } - return bodyParams; + return { + ...(input.ScriptId !== undefined && { ScriptId: input.ScriptId }) + }; }; const serializeAws_json1_1DescribeVpcPeeringAuthorizationsInput = ( input: DescribeVpcPeeringAuthorizationsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeVpcPeeringConnectionsInput = ( input: DescribeVpcPeeringConnectionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }) + }; }; const serializeAws_json1_1DesiredPlayerSession = ( input: DesiredPlayerSession, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PlayerData !== undefined) { - bodyParams["PlayerData"] = input.PlayerData; - } - if (input.PlayerId !== undefined) { - bodyParams["PlayerId"] = input.PlayerId; - } - return bodyParams; + return { + ...(input.PlayerData !== undefined && { PlayerData: input.PlayerData }), + ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }) + }; }; const serializeAws_json1_1DesiredPlayerSessionList = ( @@ -10516,14 +10312,10 @@ const serializeAws_json1_1GameProperty = ( input: GameProperty, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1GamePropertyList = ( @@ -10537,11 +10329,11 @@ const serializeAws_json1_1GameSessionQueueDestination = ( input: GameSessionQueueDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationArn !== undefined) { - bodyParams["DestinationArn"] = input.DestinationArn; - } - return bodyParams; + return { + ...(input.DestinationArn !== undefined && { + DestinationArn: input.DestinationArn + }) + }; }; const serializeAws_json1_1GameSessionQueueDestinationList = ( @@ -10564,45 +10356,33 @@ const serializeAws_json1_1GetGameSessionLogUrlInput = ( input: GetGameSessionLogUrlInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - return bodyParams; + return { + ...(input.GameSessionId !== undefined && { + GameSessionId: input.GameSessionId + }) + }; }; const serializeAws_json1_1GetInstanceAccessInput = ( input: GetInstanceAccessInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1IpPermission = ( input: IpPermission, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FromPort !== undefined) { - bodyParams["FromPort"] = input.FromPort; - } - if (input.IpRange !== undefined) { - bodyParams["IpRange"] = input.IpRange; - } - if (input.Protocol !== undefined) { - bodyParams["Protocol"] = input.Protocol; - } - if (input.ToPort !== undefined) { - bodyParams["ToPort"] = input.ToPort; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1IpPermissionsList = ( @@ -10626,82 +10406,56 @@ const serializeAws_json1_1ListAliasesInput = ( input: ListAliasesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.RoutingStrategyType !== undefined) { - bodyParams["RoutingStrategyType"] = input.RoutingStrategyType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListBuildsInput = ( input: ListBuildsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Status !== undefined && { Status: input.Status }) + }; }; const serializeAws_json1_1ListFleetsInput = ( input: ListFleetsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BuildId !== undefined) { - bodyParams["BuildId"] = input.BuildId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ScriptId !== undefined) { - bodyParams["ScriptId"] = input.ScriptId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListScriptsInput = ( input: ListScriptsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1MatchmakingConfigurationNameList = ( @@ -10736,26 +10490,19 @@ const serializeAws_json1_1Player = ( input: Player, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LatencyInMs !== undefined) { - bodyParams["LatencyInMs"] = serializeAws_json1_1LatencyMap( - input.LatencyInMs, - context - ); - } - if (input.PlayerAttributes !== undefined) { - bodyParams["PlayerAttributes"] = serializeAws_json1_1PlayerAttributeMap( - input.PlayerAttributes, - context - ); - } - if (input.PlayerId !== undefined) { - bodyParams["PlayerId"] = input.PlayerId; - } - if (input.Team !== undefined) { - bodyParams["Team"] = input.Team; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1PlayerAttributeMap = ( @@ -10789,17 +10536,15 @@ const serializeAws_json1_1PlayerLatency = ( input: PlayerLatency, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LatencyInMilliseconds !== undefined) { - bodyParams["LatencyInMilliseconds"] = input.LatencyInMilliseconds; - } - if (input.PlayerId !== undefined) { - bodyParams["PlayerId"] = input.PlayerId; - } - if (input.RegionIdentifier !== undefined) { - bodyParams["RegionIdentifier"] = input.RegionIdentifier; - } - return bodyParams; + return { + ...(input.LatencyInMilliseconds !== undefined && { + LatencyInMilliseconds: input.LatencyInMilliseconds + }), + ...(input.PlayerId !== undefined && { PlayerId: input.PlayerId }), + ...(input.RegionIdentifier !== undefined && { + RegionIdentifier: input.RegionIdentifier + }) + }; }; const serializeAws_json1_1PlayerLatencyList = ( @@ -10813,15 +10558,15 @@ const serializeAws_json1_1PlayerLatencyPolicy = ( input: PlayerLatencyPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaximumIndividualPlayerLatencyMilliseconds !== undefined) { - bodyParams["MaximumIndividualPlayerLatencyMilliseconds"] = - input.MaximumIndividualPlayerLatencyMilliseconds; - } - if (input.PolicyDurationSeconds !== undefined) { - bodyParams["PolicyDurationSeconds"] = input.PolicyDurationSeconds; - } - return bodyParams; + return { + ...(input.MaximumIndividualPlayerLatencyMilliseconds !== undefined && { + MaximumIndividualPlayerLatencyMilliseconds: + input.MaximumIndividualPlayerLatencyMilliseconds + }), + ...(input.PolicyDurationSeconds !== undefined && { + PolicyDurationSeconds: input.PolicyDurationSeconds + }) + }; }; const serializeAws_json1_1PlayerLatencyPolicyList = ( @@ -10844,41 +10589,31 @@ const serializeAws_json1_1PutScalingPolicyInput = ( input: PutScalingPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.EvaluationPeriods !== undefined) { - bodyParams["EvaluationPeriods"] = input.EvaluationPeriods; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PolicyType !== undefined) { - bodyParams["PolicyType"] = input.PolicyType; - } - if (input.ScalingAdjustment !== undefined) { - bodyParams["ScalingAdjustment"] = input.ScalingAdjustment; - } - if (input.ScalingAdjustmentType !== undefined) { - bodyParams["ScalingAdjustmentType"] = input.ScalingAdjustmentType; - } - if (input.TargetConfiguration !== undefined) { - bodyParams["TargetConfiguration"] = serializeAws_json1_1TargetConfiguration( - input.TargetConfiguration, - context - ); - } - if (input.Threshold !== undefined) { - bodyParams["Threshold"] = input.Threshold; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1QueueArnsList = ( @@ -10892,138 +10627,110 @@ const serializeAws_json1_1RequestUploadCredentialsInput = ( input: RequestUploadCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BuildId !== undefined) { - bodyParams["BuildId"] = input.BuildId; - } - return bodyParams; + return { + ...(input.BuildId !== undefined && { BuildId: input.BuildId }) + }; }; const serializeAws_json1_1ResolveAliasInput = ( input: ResolveAliasInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - return bodyParams; + return { + ...(input.AliasId !== undefined && { AliasId: input.AliasId }) + }; }; const serializeAws_json1_1ResourceCreationLimitPolicy = ( input: ResourceCreationLimitPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NewGameSessionsPerCreator !== undefined) { - bodyParams["NewGameSessionsPerCreator"] = input.NewGameSessionsPerCreator; - } - if (input.PolicyPeriodInMinutes !== undefined) { - bodyParams["PolicyPeriodInMinutes"] = input.PolicyPeriodInMinutes; - } - return bodyParams; + return { + ...(input.NewGameSessionsPerCreator !== undefined && { + NewGameSessionsPerCreator: input.NewGameSessionsPerCreator + }), + ...(input.PolicyPeriodInMinutes !== undefined && { + PolicyPeriodInMinutes: input.PolicyPeriodInMinutes + }) + }; }; const serializeAws_json1_1RoutingStrategy = ( input: RoutingStrategy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.Message !== undefined) { - bodyParams["Message"] = input.Message; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.Message !== undefined && { Message: input.Message }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1RuntimeConfiguration = ( input: RuntimeConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameSessionActivationTimeoutSeconds !== undefined) { - bodyParams["GameSessionActivationTimeoutSeconds"] = - input.GameSessionActivationTimeoutSeconds; - } - if (input.MaxConcurrentGameSessionActivations !== undefined) { - bodyParams["MaxConcurrentGameSessionActivations"] = - input.MaxConcurrentGameSessionActivations; - } - if (input.ServerProcesses !== undefined) { - bodyParams["ServerProcesses"] = serializeAws_json1_1ServerProcessList( - input.ServerProcesses, - context - ); - } - return bodyParams; + return { + ...(input.GameSessionActivationTimeoutSeconds !== undefined && { + GameSessionActivationTimeoutSeconds: + input.GameSessionActivationTimeoutSeconds + }), + ...(input.MaxConcurrentGameSessionActivations !== undefined && { + MaxConcurrentGameSessionActivations: + input.MaxConcurrentGameSessionActivations + }), + ...(input.ServerProcesses !== undefined && { + ServerProcesses: serializeAws_json1_1ServerProcessList( + input.ServerProcesses, + context + ) + }) + }; }; const serializeAws_json1_1S3Location = ( input: S3Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.ObjectVersion !== undefined) { - bodyParams["ObjectVersion"] = input.ObjectVersion; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SearchGameSessionsInput = ( input: SearchGameSessionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - if (input.FilterExpression !== undefined) { - bodyParams["FilterExpression"] = input.FilterExpression; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortExpression !== undefined) { - bodyParams["SortExpression"] = input.SortExpression; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ServerProcess = ( input: ServerProcess, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConcurrentExecutions !== undefined) { - bodyParams["ConcurrentExecutions"] = input.ConcurrentExecutions; - } - if (input.LaunchPath !== undefined) { - bodyParams["LaunchPath"] = input.LaunchPath; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = input.Parameters; - } - return bodyParams; + return { + ...(input.ConcurrentExecutions !== undefined && { + ConcurrentExecutions: input.ConcurrentExecutions + }), + ...(input.LaunchPath !== undefined && { LaunchPath: input.LaunchPath }), + ...(input.Parameters !== undefined && { Parameters: input.Parameters }) + }; }; const serializeAws_json1_1ServerProcessList = ( @@ -11037,142 +10744,114 @@ const serializeAws_json1_1StartFleetActionsInput = ( input: StartFleetActionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_json1_1FleetActionList( - input.Actions, - context - ); - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - return bodyParams; + return { + ...(input.Actions !== undefined && { + Actions: serializeAws_json1_1FleetActionList(input.Actions, context) + }), + ...(input.FleetId !== undefined && { FleetId: input.FleetId }) + }; }; const serializeAws_json1_1StartGameSessionPlacementInput = ( input: StartGameSessionPlacementInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredPlayerSessions !== undefined) { - bodyParams[ - "DesiredPlayerSessions" - ] = serializeAws_json1_1DesiredPlayerSessionList( - input.DesiredPlayerSessions, - context - ); - } - if (input.GameProperties !== undefined) { - bodyParams["GameProperties"] = serializeAws_json1_1GamePropertyList( - input.GameProperties, - context - ); - } - if (input.GameSessionData !== undefined) { - bodyParams["GameSessionData"] = input.GameSessionData; - } - if (input.GameSessionName !== undefined) { - bodyParams["GameSessionName"] = input.GameSessionName; - } - if (input.GameSessionQueueName !== undefined) { - bodyParams["GameSessionQueueName"] = input.GameSessionQueueName; - } - if (input.MaximumPlayerSessionCount !== undefined) { - bodyParams["MaximumPlayerSessionCount"] = input.MaximumPlayerSessionCount; - } - if (input.PlacementId !== undefined) { - bodyParams["PlacementId"] = input.PlacementId; - } - if (input.PlayerLatencies !== undefined) { - bodyParams["PlayerLatencies"] = serializeAws_json1_1PlayerLatencyList( - input.PlayerLatencies, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1StartMatchBackfillInput = ( input: StartMatchBackfillInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationName !== undefined) { - bodyParams["ConfigurationName"] = input.ConfigurationName; - } - if (input.GameSessionArn !== undefined) { - bodyParams["GameSessionArn"] = input.GameSessionArn; - } - if (input.Players !== undefined) { - bodyParams["Players"] = serializeAws_json1_1PlayerList( - input.Players, - context - ); - } - if (input.TicketId !== undefined) { - bodyParams["TicketId"] = input.TicketId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartMatchmakingInput = ( input: StartMatchmakingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationName !== undefined) { - bodyParams["ConfigurationName"] = input.ConfigurationName; - } - if (input.Players !== undefined) { - bodyParams["Players"] = serializeAws_json1_1PlayerList( - input.Players, - context - ); - } - if (input.TicketId !== undefined) { - bodyParams["TicketId"] = input.TicketId; - } - return bodyParams; + return { + ...(input.ConfigurationName !== undefined && { + ConfigurationName: input.ConfigurationName + }), + ...(input.Players !== undefined && { + Players: serializeAws_json1_1PlayerList(input.Players, context) + }), + ...(input.TicketId !== undefined && { TicketId: input.TicketId }) + }; }; const serializeAws_json1_1StopFleetActionsInput = ( input: StopFleetActionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_json1_1FleetActionList( - input.Actions, - context - ); - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - return bodyParams; + return { + ...(input.Actions !== undefined && { + Actions: serializeAws_json1_1FleetActionList(input.Actions, context) + }), + ...(input.FleetId !== undefined && { FleetId: input.FleetId }) + }; }; const serializeAws_json1_1StopGameSessionPlacementInput = ( input: StopGameSessionPlacementInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PlacementId !== undefined) { - bodyParams["PlacementId"] = input.PlacementId; - } - return bodyParams; + return { + ...(input.PlacementId !== undefined && { PlacementId: input.PlacementId }) + }; }; const serializeAws_json1_1StopMatchmakingInput = ( input: StopMatchmakingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TicketId !== undefined) { - bodyParams["TicketId"] = input.TicketId; - } - return bodyParams; + return { + ...(input.TicketId !== undefined && { TicketId: input.TicketId }) + }; }; const serializeAws_json1_1StringDoubleMap = ( @@ -11193,14 +10872,10 @@ const serializeAws_json1_1StringList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -11221,327 +10896,258 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TargetConfiguration = ( input: TargetConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetValue !== undefined) { - bodyParams["TargetValue"] = input.TargetValue; - } - return bodyParams; + return { + ...(input.TargetValue !== undefined && { TargetValue: input.TargetValue }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateAliasInput = ( input: UpdateAliasInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasId !== undefined) { - bodyParams["AliasId"] = input.AliasId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoutingStrategy !== undefined) { - bodyParams["RoutingStrategy"] = serializeAws_json1_1RoutingStrategy( - input.RoutingStrategy, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateBuildInput = ( input: UpdateBuildInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BuildId !== undefined) { - bodyParams["BuildId"] = input.BuildId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.BuildId !== undefined && { BuildId: input.BuildId }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1UpdateFleetAttributesInput = ( input: UpdateFleetAttributesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.MetricGroups !== undefined) { - bodyParams["MetricGroups"] = serializeAws_json1_1MetricGroupList( - input.MetricGroups, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NewGameSessionProtectionPolicy !== undefined) { - bodyParams["NewGameSessionProtectionPolicy"] = - input.NewGameSessionProtectionPolicy; - } - if (input.ResourceCreationLimitPolicy !== undefined) { - bodyParams[ - "ResourceCreationLimitPolicy" - ] = serializeAws_json1_1ResourceCreationLimitPolicy( - input.ResourceCreationLimitPolicy, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateFleetCapacityInput = ( input: UpdateFleetCapacityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredInstances !== undefined) { - bodyParams["DesiredInstances"] = input.DesiredInstances; - } - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.MaxSize !== undefined) { - bodyParams["MaxSize"] = input.MaxSize; - } - if (input.MinSize !== undefined) { - bodyParams["MinSize"] = input.MinSize; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateFleetPortSettingsInput = ( input: UpdateFleetPortSettingsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.InboundPermissionAuthorizations !== undefined) { - bodyParams[ - "InboundPermissionAuthorizations" - ] = serializeAws_json1_1IpPermissionsList( - input.InboundPermissionAuthorizations, - context - ); - } - if (input.InboundPermissionRevocations !== undefined) { - bodyParams[ - "InboundPermissionRevocations" - ] = serializeAws_json1_1IpPermissionsList( - input.InboundPermissionRevocations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateGameSessionInput = ( input: UpdateGameSessionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GameSessionId !== undefined) { - bodyParams["GameSessionId"] = input.GameSessionId; - } - if (input.MaximumPlayerSessionCount !== undefined) { - bodyParams["MaximumPlayerSessionCount"] = input.MaximumPlayerSessionCount; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PlayerSessionCreationPolicy !== undefined) { - bodyParams["PlayerSessionCreationPolicy"] = - input.PlayerSessionCreationPolicy; - } - if (input.ProtectionPolicy !== undefined) { - bodyParams["ProtectionPolicy"] = input.ProtectionPolicy; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateGameSessionQueueInput = ( input: UpdateGameSessionQueueInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destinations !== undefined) { - bodyParams[ - "Destinations" - ] = serializeAws_json1_1GameSessionQueueDestinationList( - input.Destinations, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PlayerLatencyPolicies !== undefined) { - bodyParams[ - "PlayerLatencyPolicies" - ] = serializeAws_json1_1PlayerLatencyPolicyList( - input.PlayerLatencyPolicies, - context - ); - } - if (input.TimeoutInSeconds !== undefined) { - bodyParams["TimeoutInSeconds"] = input.TimeoutInSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateMatchmakingConfigurationInput = ( input: UpdateMatchmakingConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptanceRequired !== undefined) { - bodyParams["AcceptanceRequired"] = input.AcceptanceRequired; - } - if (input.AcceptanceTimeoutSeconds !== undefined) { - bodyParams["AcceptanceTimeoutSeconds"] = input.AcceptanceTimeoutSeconds; - } - if (input.AdditionalPlayerCount !== undefined) { - bodyParams["AdditionalPlayerCount"] = input.AdditionalPlayerCount; - } - if (input.BackfillMode !== undefined) { - bodyParams["BackfillMode"] = input.BackfillMode; - } - if (input.CustomEventData !== undefined) { - bodyParams["CustomEventData"] = input.CustomEventData; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GameProperties !== undefined) { - bodyParams["GameProperties"] = serializeAws_json1_1GamePropertyList( - input.GameProperties, - context - ); - } - if (input.GameSessionData !== undefined) { - bodyParams["GameSessionData"] = input.GameSessionData; - } - if (input.GameSessionQueueArns !== undefined) { - bodyParams["GameSessionQueueArns"] = serializeAws_json1_1QueueArnsList( - input.GameSessionQueueArns, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NotificationTarget !== undefined) { - bodyParams["NotificationTarget"] = input.NotificationTarget; - } - if (input.RequestTimeoutSeconds !== undefined) { - bodyParams["RequestTimeoutSeconds"] = input.RequestTimeoutSeconds; - } - if (input.RuleSetName !== undefined) { - bodyParams["RuleSetName"] = input.RuleSetName; - } - return bodyParams; + 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.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 }) + }; }; const serializeAws_json1_1UpdateRuntimeConfigurationInput = ( input: UpdateRuntimeConfigurationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FleetId !== undefined) { - bodyParams["FleetId"] = input.FleetId; - } - if (input.RuntimeConfiguration !== undefined) { - bodyParams[ - "RuntimeConfiguration" - ] = serializeAws_json1_1RuntimeConfiguration( - input.RuntimeConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.FleetId !== undefined && { FleetId: input.FleetId }), + ...(input.RuntimeConfiguration !== undefined && { + RuntimeConfiguration: serializeAws_json1_1RuntimeConfiguration( + input.RuntimeConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1UpdateScriptInput = ( input: UpdateScriptInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ScriptId !== undefined) { - bodyParams["ScriptId"] = input.ScriptId; - } - if (input.StorageLocation !== undefined) { - bodyParams["StorageLocation"] = serializeAws_json1_1S3Location( - input.StorageLocation, - context - ); - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - if (input.ZipFile !== undefined) { - bodyParams["ZipFile"] = context.base64Encoder(input.ZipFile); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ValidateMatchmakingRuleSetInput = ( input: ValidateMatchmakingRuleSetInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleSetBody !== undefined) { - bodyParams["RuleSetBody"] = input.RuleSetBody; - } - return bodyParams; + return { + ...(input.RuleSetBody !== undefined && { RuleSetBody: input.RuleSetBody }) + }; }; const deserializeAws_json1_1AcceptMatchOutput = ( diff --git a/clients/client-glacier/protocols/Aws_restJson1_1.ts b/clients/client-glacier/protocols/Aws_restJson1_1.ts index 3197eed53ba6..e63c51ca8292 100644 --- a/clients/client-glacier/protocols/Aws_restJson1_1.ts +++ b/clients/client-glacier/protocols/Aws_restJson1_1.ts @@ -5326,215 +5326,171 @@ const serializeAws_restJson1_1CSVInput = ( input: CSVInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Comments !== undefined) { - bodyParams["Comments"] = input.Comments; - } - if (input.FieldDelimiter !== undefined) { - bodyParams["FieldDelimiter"] = input.FieldDelimiter; - } - if (input.FileHeaderInfo !== undefined) { - bodyParams["FileHeaderInfo"] = input.FileHeaderInfo; - } - if (input.QuoteCharacter !== undefined) { - bodyParams["QuoteCharacter"] = input.QuoteCharacter; - } - if (input.QuoteEscapeCharacter !== undefined) { - bodyParams["QuoteEscapeCharacter"] = input.QuoteEscapeCharacter; - } - if (input.RecordDelimiter !== undefined) { - bodyParams["RecordDelimiter"] = input.RecordDelimiter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1CSVOutput = ( input: CSVOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldDelimiter !== undefined) { - bodyParams["FieldDelimiter"] = input.FieldDelimiter; - } - if (input.QuoteCharacter !== undefined) { - bodyParams["QuoteCharacter"] = input.QuoteCharacter; - } - if (input.QuoteEscapeCharacter !== undefined) { - bodyParams["QuoteEscapeCharacter"] = input.QuoteEscapeCharacter; - } - if (input.QuoteFields !== undefined) { - bodyParams["QuoteFields"] = input.QuoteFields; - } - if (input.RecordDelimiter !== undefined) { - bodyParams["RecordDelimiter"] = input.RecordDelimiter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1Encryption = ( input: Encryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionType !== undefined) { - bodyParams["EncryptionType"] = input.EncryptionType; - } - if (input.KMSContext !== undefined) { - bodyParams["KMSContext"] = input.KMSContext; - } - if (input.KMSKeyId !== undefined) { - bodyParams["KMSKeyId"] = input.KMSKeyId; - } - return bodyParams; + return { + ...(input.EncryptionType !== undefined && { + EncryptionType: input.EncryptionType + }), + ...(input.KMSContext !== undefined && { KMSContext: input.KMSContext }), + ...(input.KMSKeyId !== undefined && { KMSKeyId: input.KMSKeyId }) + }; }; const serializeAws_restJson1_1Grant = ( input: Grant, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Grantee !== undefined) { - bodyParams["Grantee"] = serializeAws_restJson1_1Grantee( - input.Grantee, - context - ); - } - if (input.Permission !== undefined) { - bodyParams["Permission"] = input.Permission; - } - return bodyParams; + return { + ...(input.Grantee !== undefined && { + Grantee: serializeAws_restJson1_1Grantee(input.Grantee, context) + }), + ...(input.Permission !== undefined && { Permission: input.Permission }) + }; }; const serializeAws_restJson1_1Grantee = ( input: Grantee, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.EmailAddress !== undefined) { - bodyParams["EmailAddress"] = input.EmailAddress; - } - if (input.ID !== undefined) { - bodyParams["ID"] = input.ID; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.URI !== undefined) { - bodyParams["URI"] = input.URI; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1InputSerialization = ( input: InputSerialization, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.csv !== undefined) { - bodyParams["csv"] = serializeAws_restJson1_1CSVInput(input.csv, context); - } - return bodyParams; + return { + ...(input.csv !== undefined && { + csv: serializeAws_restJson1_1CSVInput(input.csv, context) + }) + }; }; const serializeAws_restJson1_1OutputLocation = ( input: OutputLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3 !== undefined) { - bodyParams["S3"] = serializeAws_restJson1_1S3Location(input.S3, context); - } - return bodyParams; + return { + ...(input.S3 !== undefined && { + S3: serializeAws_restJson1_1S3Location(input.S3, context) + }) + }; }; const serializeAws_restJson1_1OutputSerialization = ( input: OutputSerialization, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.csv !== undefined) { - bodyParams["csv"] = serializeAws_restJson1_1CSVOutput(input.csv, context); - } - return bodyParams; + return { + ...(input.csv !== undefined && { + csv: serializeAws_restJson1_1CSVOutput(input.csv, context) + }) + }; }; const serializeAws_restJson1_1S3Location = ( input: S3Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessControlList !== undefined) { - bodyParams[ - "AccessControlList" - ] = serializeAws_restJson1_1AccessControlPolicyList( - input.AccessControlList, - context - ); - } - if (input.BucketName !== undefined) { - bodyParams["BucketName"] = input.BucketName; - } - if (input.CannedACL !== undefined) { - bodyParams["CannedACL"] = input.CannedACL; - } - if (input.Encryption !== undefined) { - bodyParams["Encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.StorageClass !== undefined) { - bodyParams["StorageClass"] = input.StorageClass; - } - if (input.Tagging !== undefined) { - bodyParams["Tagging"] = serializeAws_restJson1_1hashmap( - input.Tagging, - context - ); - } - if (input.UserMetadata !== undefined) { - bodyParams["UserMetadata"] = serializeAws_restJson1_1hashmap( - input.UserMetadata, - context - ); - } - return bodyParams; + return { + ...(input.AccessControlList !== undefined && { + AccessControlList: serializeAws_restJson1_1AccessControlPolicyList( + input.AccessControlList, + context + ) + }), + ...(input.BucketName !== undefined && { BucketName: input.BucketName }), + ...(input.CannedACL !== undefined && { CannedACL: input.CannedACL }), + ...(input.Encryption !== undefined && { + Encryption: serializeAws_restJson1_1Encryption(input.Encryption, context) + }), + ...(input.Prefix !== undefined && { Prefix: input.Prefix }), + ...(input.StorageClass !== undefined && { + StorageClass: input.StorageClass + }), + ...(input.Tagging !== undefined && { + Tagging: serializeAws_restJson1_1hashmap(input.Tagging, context) + }), + ...(input.UserMetadata !== undefined && { + UserMetadata: serializeAws_restJson1_1hashmap(input.UserMetadata, context) + }) + }; }; const serializeAws_restJson1_1SelectParameters = ( input: SelectParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Expression !== undefined) { - bodyParams["Expression"] = input.Expression; - } - if (input.ExpressionType !== undefined) { - bodyParams["ExpressionType"] = input.ExpressionType; - } - if (input.InputSerialization !== undefined) { - bodyParams[ - "InputSerialization" - ] = serializeAws_restJson1_1InputSerialization( - input.InputSerialization, - context - ); - } - if (input.OutputSerialization !== undefined) { - bodyParams[ - "OutputSerialization" - ] = serializeAws_restJson1_1OutputSerialization( - input.OutputSerialization, - context - ); - } - return bodyParams; + return { + ...(input.Expression !== undefined && { Expression: input.Expression }), + ...(input.ExpressionType !== undefined && { + ExpressionType: input.ExpressionType + }), + ...(input.InputSerialization !== undefined && { + InputSerialization: serializeAws_restJson1_1InputSerialization( + input.InputSerialization, + context + ) + }), + ...(input.OutputSerialization !== undefined && { + OutputSerialization: serializeAws_restJson1_1OutputSerialization( + input.OutputSerialization, + context + ) + }) + }; }; const serializeAws_restJson1_1hashmap = ( @@ -5551,28 +5507,26 @@ const serializeAws_restJson1_1DataRetrievalPolicy = ( input: DataRetrievalPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_restJson1_1DataRetrievalRulesList( - input.Rules, - context - ); - } - return bodyParams; + return { + ...(input.Rules !== undefined && { + Rules: serializeAws_restJson1_1DataRetrievalRulesList( + input.Rules, + context + ) + }) + }; }; const serializeAws_restJson1_1DataRetrievalRule = ( input: DataRetrievalRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BytesPerHour !== undefined) { - bodyParams["BytesPerHour"] = input.BytesPerHour; - } - if (input.Strategy !== undefined) { - bodyParams["Strategy"] = input.Strategy; - } - return bodyParams; + return { + ...(input.BytesPerHour !== undefined && { + BytesPerHour: input.BytesPerHour + }), + ...(input.Strategy !== undefined && { Strategy: input.Strategy }) + }; }; const serializeAws_restJson1_1DataRetrievalRulesList = ( @@ -5588,69 +5542,47 @@ const serializeAws_restJson1_1InventoryRetrievalJobInput = ( input: InventoryRetrievalJobInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndDate !== undefined) { - bodyParams["EndDate"] = input.EndDate; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.StartDate !== undefined) { - bodyParams["StartDate"] = input.StartDate; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1JobParameters = ( input: JobParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ArchiveId !== undefined) { - bodyParams["ArchiveId"] = input.ArchiveId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.InventoryRetrievalParameters !== undefined) { - bodyParams[ - "InventoryRetrievalParameters" - ] = serializeAws_restJson1_1InventoryRetrievalJobInput( - input.InventoryRetrievalParameters, - context - ); - } - if (input.OutputLocation !== undefined) { - bodyParams["OutputLocation"] = serializeAws_restJson1_1OutputLocation( - input.OutputLocation, - context - ); - } - if (input.RetrievalByteRange !== undefined) { - bodyParams["RetrievalByteRange"] = input.RetrievalByteRange; - } - if (input.SNSTopic !== undefined) { - bodyParams["SNSTopic"] = input.SNSTopic; - } - if (input.SelectParameters !== undefined) { - bodyParams["SelectParameters"] = serializeAws_restJson1_1SelectParameters( - input.SelectParameters, - context - ); - } - if (input.Tier !== undefined) { - bodyParams["Tier"] = input.Tier; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.ArchiveId !== undefined && { ArchiveId: input.ArchiveId }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Format !== undefined && { Format: input.Format }), + ...(input.InventoryRetrievalParameters !== undefined && { + InventoryRetrievalParameters: serializeAws_restJson1_1InventoryRetrievalJobInput( + input.InventoryRetrievalParameters, + context + ) + }), + ...(input.OutputLocation !== undefined && { + OutputLocation: serializeAws_restJson1_1OutputLocation( + input.OutputLocation, + context + ) + }), + ...(input.RetrievalByteRange !== undefined && { + RetrievalByteRange: input.RetrievalByteRange + }), + ...(input.SNSTopic !== undefined && { SNSTopic: input.SNSTopic }), + ...(input.SelectParameters !== undefined && { + SelectParameters: serializeAws_restJson1_1SelectParameters( + input.SelectParameters, + context + ) + }), + ...(input.Tier !== undefined && { Tier: input.Tier }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1NotificationEventList = ( @@ -5681,39 +5613,33 @@ const serializeAws_restJson1_1VaultAccessPolicy = ( input: VaultAccessPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - return bodyParams; + return { + ...(input.Policy !== undefined && { Policy: input.Policy }) + }; }; const serializeAws_restJson1_1VaultLockPolicy = ( input: VaultLockPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - return bodyParams; + return { + ...(input.Policy !== undefined && { Policy: input.Policy }) + }; }; const serializeAws_restJson1_1VaultNotificationConfig = ( input: VaultNotificationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Events !== undefined) { - bodyParams["Events"] = serializeAws_restJson1_1NotificationEventList( - input.Events, - context - ); - } - if (input.SNSTopic !== undefined) { - bodyParams["SNSTopic"] = input.SNSTopic; - } - return bodyParams; + return { + ...(input.Events !== undefined && { + Events: serializeAws_restJson1_1NotificationEventList( + input.Events, + context + ) + }), + ...(input.SNSTopic !== undefined && { SNSTopic: input.SNSTopic }) + }; }; const deserializeAws_restJson1_1AccessControlPolicyList = ( diff --git a/clients/client-global-accelerator/protocols/Aws_json1_1.ts b/clients/client-global-accelerator/protocols/Aws_json1_1.ts index 4f3c7cc5a21d..c7efe60b3fe5 100644 --- a/clients/client-global-accelerator/protocols/Aws_json1_1.ts +++ b/clients/client-global-accelerator/protocols/Aws_json1_1.ts @@ -2214,184 +2214,162 @@ const serializeAws_json1_1CreateAcceleratorRequest = ( input: CreateAcceleratorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.IpAddressType !== undefined) { - bodyParams["IpAddressType"] = input.IpAddressType; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.IdempotencyToken !== undefined && { + IdempotencyToken: input.IdempotencyToken + }), + ...(input.IpAddressType !== undefined && { + IpAddressType: input.IpAddressType + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateEndpointGroupRequest = ( input: CreateEndpointGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointConfigurations !== undefined) { - bodyParams[ - "EndpointConfigurations" - ] = serializeAws_json1_1EndpointConfigurations( - input.EndpointConfigurations, - context - ); - } - if (input.EndpointGroupRegion !== undefined) { - bodyParams["EndpointGroupRegion"] = input.EndpointGroupRegion; - } - if (input.HealthCheckIntervalSeconds !== undefined) { - bodyParams["HealthCheckIntervalSeconds"] = input.HealthCheckIntervalSeconds; - } - if (input.HealthCheckPath !== undefined) { - bodyParams["HealthCheckPath"] = input.HealthCheckPath; - } - if (input.HealthCheckPort !== undefined) { - bodyParams["HealthCheckPort"] = input.HealthCheckPort; - } - if (input.HealthCheckProtocol !== undefined) { - bodyParams["HealthCheckProtocol"] = input.HealthCheckProtocol; - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.ListenerArn !== undefined) { - bodyParams["ListenerArn"] = input.ListenerArn; - } - if (input.ThresholdCount !== undefined) { - bodyParams["ThresholdCount"] = input.ThresholdCount; - } - if (input.TrafficDialPercentage !== undefined) { - bodyParams["TrafficDialPercentage"] = input.TrafficDialPercentage; - } - return bodyParams; + 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.IdempotencyToken !== undefined && { + IdempotencyToken: input.IdempotencyToken + }), + ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.ThresholdCount !== undefined && { + ThresholdCount: input.ThresholdCount + }), + ...(input.TrafficDialPercentage !== undefined && { + TrafficDialPercentage: input.TrafficDialPercentage + }) + }; }; const serializeAws_json1_1CreateListenerRequest = ( input: CreateListenerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - if (input.ClientAffinity !== undefined) { - bodyParams["ClientAffinity"] = input.ClientAffinity; - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.PortRanges !== undefined) { - bodyParams["PortRanges"] = serializeAws_json1_1PortRanges( - input.PortRanges, - context - ); - } - if (input.Protocol !== undefined) { - bodyParams["Protocol"] = input.Protocol; - } - return bodyParams; + return { + ...(input.AcceleratorArn !== undefined && { + AcceleratorArn: input.AcceleratorArn + }), + ...(input.ClientAffinity !== undefined && { + ClientAffinity: input.ClientAffinity + }), + ...(input.IdempotencyToken !== undefined && { + IdempotencyToken: input.IdempotencyToken + }), + ...(input.PortRanges !== undefined && { + PortRanges: serializeAws_json1_1PortRanges(input.PortRanges, context) + }), + ...(input.Protocol !== undefined && { Protocol: input.Protocol }) + }; }; const serializeAws_json1_1DeleteAcceleratorRequest = ( input: DeleteAcceleratorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - return bodyParams; + return { + ...(input.AcceleratorArn !== undefined && { + AcceleratorArn: input.AcceleratorArn + }) + }; }; const serializeAws_json1_1DeleteEndpointGroupRequest = ( input: DeleteEndpointGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointGroupArn !== undefined) { - bodyParams["EndpointGroupArn"] = input.EndpointGroupArn; - } - return bodyParams; + return { + ...(input.EndpointGroupArn !== undefined && { + EndpointGroupArn: input.EndpointGroupArn + }) + }; }; const serializeAws_json1_1DeleteListenerRequest = ( input: DeleteListenerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ListenerArn !== undefined) { - bodyParams["ListenerArn"] = input.ListenerArn; - } - return bodyParams; + return { + ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }) + }; }; const serializeAws_json1_1DescribeAcceleratorAttributesRequest = ( input: DescribeAcceleratorAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - return bodyParams; + return { + ...(input.AcceleratorArn !== undefined && { + AcceleratorArn: input.AcceleratorArn + }) + }; }; const serializeAws_json1_1DescribeAcceleratorRequest = ( input: DescribeAcceleratorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - return bodyParams; + return { + ...(input.AcceleratorArn !== undefined && { + AcceleratorArn: input.AcceleratorArn + }) + }; }; const serializeAws_json1_1DescribeEndpointGroupRequest = ( input: DescribeEndpointGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointGroupArn !== undefined) { - bodyParams["EndpointGroupArn"] = input.EndpointGroupArn; - } - return bodyParams; + return { + ...(input.EndpointGroupArn !== undefined && { + EndpointGroupArn: input.EndpointGroupArn + }) + }; }; const serializeAws_json1_1DescribeListenerRequest = ( input: DescribeListenerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ListenerArn !== undefined) { - bodyParams["ListenerArn"] = input.ListenerArn; - } - return bodyParams; + return { + ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }) + }; }; const serializeAws_json1_1EndpointConfiguration = ( input: EndpointConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientIPPreservationEnabled !== undefined) { - bodyParams["ClientIPPreservationEnabled"] = - input.ClientIPPreservationEnabled; - } - if (input.EndpointId !== undefined) { - bodyParams["EndpointId"] = input.EndpointId; - } - if (input.Weight !== undefined) { - bodyParams["Weight"] = input.Weight; - } - return bodyParams; + return { + ...(input.ClientIPPreservationEnabled !== undefined && { + ClientIPPreservationEnabled: input.ClientIPPreservationEnabled + }), + ...(input.EndpointId !== undefined && { EndpointId: input.EndpointId }), + ...(input.Weight !== undefined && { Weight: input.Weight }) + }; }; const serializeAws_json1_1EndpointConfigurations = ( @@ -2407,62 +2385,44 @@ const serializeAws_json1_1ListAcceleratorsRequest = ( input: ListAcceleratorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEndpointGroupsRequest = ( input: ListEndpointGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ListenerArn !== undefined) { - bodyParams["ListenerArn"] = input.ListenerArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ListenerArn !== undefined && { ListenerArn: input.ListenerArn }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListListenersRequest = ( input: ListListenersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.AcceleratorArn !== undefined && { + AcceleratorArn: input.AcceleratorArn + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1PortRange = ( input: PortRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FromPort !== undefined) { - bodyParams["FromPort"] = input.FromPort; - } - if (input.ToPort !== undefined) { - bodyParams["ToPort"] = input.ToPort; - } - return bodyParams; + return { + ...(input.FromPort !== undefined && { FromPort: input.FromPort }), + ...(input.ToPort !== undefined && { ToPort: input.ToPort }) + }; }; const serializeAws_json1_1PortRanges = ( @@ -2476,100 +2436,87 @@ const serializeAws_json1_1UpdateAcceleratorAttributesRequest = ( input: UpdateAcceleratorAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - if (input.FlowLogsEnabled !== undefined) { - bodyParams["FlowLogsEnabled"] = input.FlowLogsEnabled; - } - if (input.FlowLogsS3Bucket !== undefined) { - bodyParams["FlowLogsS3Bucket"] = input.FlowLogsS3Bucket; - } - if (input.FlowLogsS3Prefix !== undefined) { - bodyParams["FlowLogsS3Prefix"] = input.FlowLogsS3Prefix; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateAcceleratorRequest = ( input: UpdateAcceleratorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorArn !== undefined) { - bodyParams["AcceleratorArn"] = input.AcceleratorArn; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.IpAddressType !== undefined) { - bodyParams["IpAddressType"] = input.IpAddressType; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateEndpointGroupRequest = ( input: UpdateEndpointGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointConfigurations !== undefined) { - bodyParams[ - "EndpointConfigurations" - ] = serializeAws_json1_1EndpointConfigurations( - input.EndpointConfigurations, - context - ); - } - if (input.EndpointGroupArn !== undefined) { - bodyParams["EndpointGroupArn"] = input.EndpointGroupArn; - } - if (input.HealthCheckIntervalSeconds !== undefined) { - bodyParams["HealthCheckIntervalSeconds"] = input.HealthCheckIntervalSeconds; - } - if (input.HealthCheckPath !== undefined) { - bodyParams["HealthCheckPath"] = input.HealthCheckPath; - } - if (input.HealthCheckPort !== undefined) { - bodyParams["HealthCheckPort"] = input.HealthCheckPort; - } - if (input.HealthCheckProtocol !== undefined) { - bodyParams["HealthCheckProtocol"] = input.HealthCheckProtocol; - } - if (input.ThresholdCount !== undefined) { - bodyParams["ThresholdCount"] = input.ThresholdCount; - } - if (input.TrafficDialPercentage !== undefined) { - bodyParams["TrafficDialPercentage"] = input.TrafficDialPercentage; - } - return bodyParams; + 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.ThresholdCount !== undefined && { + ThresholdCount: input.ThresholdCount + }), + ...(input.TrafficDialPercentage !== undefined && { + TrafficDialPercentage: input.TrafficDialPercentage + }) + }; }; const serializeAws_json1_1UpdateListenerRequest = ( input: UpdateListenerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientAffinity !== undefined) { - bodyParams["ClientAffinity"] = input.ClientAffinity; - } - if (input.ListenerArn !== undefined) { - bodyParams["ListenerArn"] = input.ListenerArn; - } - if (input.PortRanges !== undefined) { - bodyParams["PortRanges"] = serializeAws_json1_1PortRanges( - input.PortRanges, - context - ); - } - if (input.Protocol !== undefined) { - bodyParams["Protocol"] = input.Protocol; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1Accelerator = ( diff --git a/clients/client-glue/protocols/Aws_json1_1.ts b/clients/client-glue/protocols/Aws_json1_1.ts index d5cae60c6a0f..9bb41bb04519 100644 --- a/clients/client-glue/protocols/Aws_json1_1.ts +++ b/clients/client-glue/protocols/Aws_json1_1.ts @@ -15007,45 +15007,33 @@ const serializeAws_json1_1GetTagsRequest = ( input: GetTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagsToAdd !== undefined) { - bodyParams["TagsToAdd"] = serializeAws_json1_1TagsMap( - input.TagsToAdd, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagsToAdd !== undefined && { + TagsToAdd: serializeAws_json1_1TagsMap(input.TagsToAdd, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagsToRemove !== undefined) { - bodyParams["TagsToRemove"] = serializeAws_json1_1TagKeysList( - input.TagsToRemove, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagsToRemove !== undefined && { + TagsToRemove: serializeAws_json1_1TagKeysList(input.TagsToRemove, context) + }) + }; }; const serializeAws_json1_1NameStringList = ( @@ -15076,67 +15064,53 @@ const serializeAws_json1_1BatchCreatePartitionRequest = ( input: BatchCreatePartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionInputList !== undefined) { - bodyParams["PartitionInputList"] = serializeAws_json1_1PartitionInputList( - input.PartitionInputList, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1BatchDeleteConnectionRequest = ( input: BatchDeleteConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.ConnectionNameList !== undefined) { - bodyParams[ - "ConnectionNameList" - ] = serializeAws_json1_1DeleteConnectionNameList( - input.ConnectionNameList, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.ConnectionNameList !== undefined && { + ConnectionNameList: serializeAws_json1_1DeleteConnectionNameList( + input.ConnectionNameList, + context + ) + }) + }; }; const serializeAws_json1_1BatchDeletePartitionRequest = ( input: BatchDeletePartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionsToDelete !== undefined) { - bodyParams[ - "PartitionsToDelete" - ] = serializeAws_json1_1BatchDeletePartitionValueList( - input.PartitionsToDelete, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1BatchDeletePartitionValueList = ( @@ -15159,20 +15133,18 @@ const serializeAws_json1_1BatchDeleteTableRequest = ( input: BatchDeleteTableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TablesToDelete !== undefined) { - bodyParams["TablesToDelete"] = serializeAws_json1_1BatchDeleteTableNameList( - input.TablesToDelete, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.TablesToDelete !== undefined && { + TablesToDelete: serializeAws_json1_1BatchDeleteTableNameList( + input.TablesToDelete, + context + ) + }) + }; }; const serializeAws_json1_1BatchDeleteTableVersionList = ( @@ -15186,48 +15158,38 @@ const serializeAws_json1_1BatchDeleteTableVersionRequest = ( input: BatchDeleteTableVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.VersionIds !== undefined) { - bodyParams["VersionIds"] = serializeAws_json1_1BatchDeleteTableVersionList( - input.VersionIds, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1BatchGetPartitionRequest = ( input: BatchGetPartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionsToGet !== undefined) { - bodyParams[ - "PartitionsToGet" - ] = serializeAws_json1_1BatchGetPartitionValueList( - input.PartitionsToGet, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1BatchGetPartitionValueList = ( @@ -15250,23 +15212,14 @@ const serializeAws_json1_1Column = ( input: Column, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Comment !== undefined) { - bodyParams["Comment"] = input.Comment; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ParametersMap( - input.Parameters, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ColumnList = ( @@ -15287,54 +15240,43 @@ const serializeAws_json1_1ConnectionInput = ( input: ConnectionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionProperties !== undefined) { - bodyParams[ - "ConnectionProperties" - ] = serializeAws_json1_1ConnectionProperties( - input.ConnectionProperties, - context - ); - } - if (input.ConnectionType !== undefined) { - bodyParams["ConnectionType"] = input.ConnectionType; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.MatchCriteria !== undefined) { - bodyParams["MatchCriteria"] = serializeAws_json1_1MatchCriteria( - input.MatchCriteria, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PhysicalConnectionRequirements !== undefined) { - bodyParams[ - "PhysicalConnectionRequirements" - ] = serializeAws_json1_1PhysicalConnectionRequirements( - input.PhysicalConnectionRequirements, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ConnectionPasswordEncryption = ( input: ConnectionPasswordEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsKmsKeyId !== undefined) { - bodyParams["AwsKmsKeyId"] = input.AwsKmsKeyId; - } - if (input.ReturnConnectionPasswordEncrypted !== undefined) { - bodyParams["ReturnConnectionPasswordEncrypted"] = - input.ReturnConnectionPasswordEncrypted; - } - return bodyParams; + return { + ...(input.AwsKmsKeyId !== undefined && { AwsKmsKeyId: input.AwsKmsKeyId }), + ...(input.ReturnConnectionPasswordEncrypted !== undefined && { + ReturnConnectionPasswordEncrypted: input.ReturnConnectionPasswordEncrypted + }) + }; }; const serializeAws_json1_1ConnectionProperties = ( @@ -15351,162 +15293,133 @@ const serializeAws_json1_1CreateConnectionRequest = ( input: CreateConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.ConnectionInput !== undefined) { - bodyParams["ConnectionInput"] = serializeAws_json1_1ConnectionInput( - input.ConnectionInput, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.ConnectionInput !== undefined && { + ConnectionInput: serializeAws_json1_1ConnectionInput( + input.ConnectionInput, + context + ) + }) + }; }; const serializeAws_json1_1CreateDatabaseRequest = ( input: CreateDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseInput !== undefined) { - bodyParams["DatabaseInput"] = serializeAws_json1_1DatabaseInput( - input.DatabaseInput, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseInput !== undefined && { + DatabaseInput: serializeAws_json1_1DatabaseInput( + input.DatabaseInput, + context + ) + }) + }; }; const serializeAws_json1_1CreatePartitionRequest = ( input: CreatePartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionInput !== undefined) { - bodyParams["PartitionInput"] = serializeAws_json1_1PartitionInput( - input.PartitionInput, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateTableRequest = ( input: CreateTableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TableInput !== undefined) { - bodyParams["TableInput"] = serializeAws_json1_1TableInput( - input.TableInput, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.TableInput !== undefined && { + TableInput: serializeAws_json1_1TableInput(input.TableInput, context) + }) + }; }; const serializeAws_json1_1CreateUserDefinedFunctionRequest = ( input: CreateUserDefinedFunctionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.FunctionInput !== undefined) { - bodyParams["FunctionInput"] = serializeAws_json1_1UserDefinedFunctionInput( - input.FunctionInput, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.FunctionInput !== undefined && { + FunctionInput: serializeAws_json1_1UserDefinedFunctionInput( + input.FunctionInput, + context + ) + }) + }; }; const serializeAws_json1_1DataCatalogEncryptionSettings = ( input: DataCatalogEncryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionPasswordEncryption !== undefined) { - bodyParams[ - "ConnectionPasswordEncryption" - ] = serializeAws_json1_1ConnectionPasswordEncryption( - input.ConnectionPasswordEncryption, - context - ); - } - if (input.EncryptionAtRest !== undefined) { - bodyParams["EncryptionAtRest"] = serializeAws_json1_1EncryptionAtRest( - input.EncryptionAtRest, - context - ); - } - return bodyParams; + return { + ...(input.ConnectionPasswordEncryption !== undefined && { + ConnectionPasswordEncryption: serializeAws_json1_1ConnectionPasswordEncryption( + input.ConnectionPasswordEncryption, + context + ) + }), + ...(input.EncryptionAtRest !== undefined && { + EncryptionAtRest: serializeAws_json1_1EncryptionAtRest( + input.EncryptionAtRest, + context + ) + }) + }; }; const serializeAws_json1_1DataLakePrincipal = ( input: DataLakePrincipal, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataLakePrincipalIdentifier !== undefined) { - bodyParams["DataLakePrincipalIdentifier"] = - input.DataLakePrincipalIdentifier; - } - return bodyParams; + return { + ...(input.DataLakePrincipalIdentifier !== undefined && { + DataLakePrincipalIdentifier: input.DataLakePrincipalIdentifier + }) + }; }; const serializeAws_json1_1DatabaseInput = ( input: DatabaseInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreateTableDefaultPermissions !== undefined) { - bodyParams[ - "CreateTableDefaultPermissions" - ] = serializeAws_json1_1PrincipalPermissionsList( - input.CreateTableDefaultPermissions, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.LocationUri !== undefined) { - bodyParams["LocationUri"] = input.LocationUri; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ParametersMap( - input.Parameters, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteConnectionNameList = ( @@ -15520,437 +15433,335 @@ const serializeAws_json1_1DeleteConnectionRequest = ( input: DeleteConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.ConnectionName !== undefined) { - bodyParams["ConnectionName"] = input.ConnectionName; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.ConnectionName !== undefined && { + ConnectionName: input.ConnectionName + }) + }; }; const serializeAws_json1_1DeleteDatabaseRequest = ( input: DeleteDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeletePartitionRequest = ( input: DeletePartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionValues !== undefined) { - bodyParams["PartitionValues"] = serializeAws_json1_1ValueStringList( - input.PartitionValues, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteResourcePolicyRequest = ( input: DeleteResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyHashCondition !== undefined) { - bodyParams["PolicyHashCondition"] = input.PolicyHashCondition; - } - return bodyParams; + return { + ...(input.PolicyHashCondition !== undefined && { + PolicyHashCondition: input.PolicyHashCondition + }) + }; }; const serializeAws_json1_1DeleteTableRequest = ( input: DeleteTableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteTableVersionRequest = ( input: DeleteTableVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.VersionId !== undefined) { - bodyParams["VersionId"] = input.VersionId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteUserDefinedFunctionRequest = ( input: DeleteUserDefinedFunctionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.FunctionName !== undefined) { - bodyParams["FunctionName"] = input.FunctionName; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.FunctionName !== undefined && { + FunctionName: input.FunctionName + }) + }; }; const serializeAws_json1_1EncryptionAtRest = ( input: EncryptionAtRest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogEncryptionMode !== undefined) { - bodyParams["CatalogEncryptionMode"] = input.CatalogEncryptionMode; - } - if (input.SseAwsKmsKeyId !== undefined) { - bodyParams["SseAwsKmsKeyId"] = input.SseAwsKmsKeyId; - } - return bodyParams; + return { + ...(input.CatalogEncryptionMode !== undefined && { + CatalogEncryptionMode: input.CatalogEncryptionMode + }), + ...(input.SseAwsKmsKeyId !== undefined && { + SseAwsKmsKeyId: input.SseAwsKmsKeyId + }) + }; }; const serializeAws_json1_1GetCatalogImportStatusRequest = ( input: GetCatalogImportStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }) + }; }; const serializeAws_json1_1GetConnectionRequest = ( input: GetConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.HidePassword !== undefined) { - bodyParams["HidePassword"] = input.HidePassword; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.HidePassword !== undefined && { + HidePassword: input.HidePassword + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetConnectionsFilter = ( input: GetConnectionsFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionType !== undefined) { - bodyParams["ConnectionType"] = input.ConnectionType; - } - if (input.MatchCriteria !== undefined) { - bodyParams["MatchCriteria"] = serializeAws_json1_1MatchCriteria( - input.MatchCriteria, - context - ); - } - return bodyParams; + return { + ...(input.ConnectionType !== undefined && { + ConnectionType: input.ConnectionType + }), + ...(input.MatchCriteria !== undefined && { + MatchCriteria: serializeAws_json1_1MatchCriteria( + input.MatchCriteria, + context + ) + }) + }; }; const serializeAws_json1_1GetConnectionsRequest = ( input: GetConnectionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1GetConnectionsFilter( - input.Filter, - context - ); - } - if (input.HidePassword !== undefined) { - bodyParams["HidePassword"] = input.HidePassword; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetDataCatalogEncryptionSettingsRequest = ( input: GetDataCatalogEncryptionSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }) + }; }; const serializeAws_json1_1GetDatabaseRequest = ( input: GetDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetDatabasesRequest = ( input: GetDatabasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetPartitionRequest = ( input: GetPartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionValues !== undefined) { - bodyParams["PartitionValues"] = serializeAws_json1_1ValueStringList( - input.PartitionValues, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetPartitionsRequest = ( input: GetPartitionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Expression !== undefined) { - bodyParams["Expression"] = input.Expression; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Segment !== undefined) { - bodyParams["Segment"] = serializeAws_json1_1Segment(input.Segment, context); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetResourcePolicyRequest = ( input: GetResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetTableRequest = ( input: GetTableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetTableVersionRequest = ( input: GetTableVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - if (input.VersionId !== undefined) { - bodyParams["VersionId"] = input.VersionId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetTableVersionsRequest = ( input: GetTableVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetTablesRequest = ( input: GetTablesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Expression !== undefined) { - bodyParams["Expression"] = input.Expression; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetUserDefinedFunctionRequest = ( input: GetUserDefinedFunctionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.FunctionName !== undefined) { - bodyParams["FunctionName"] = input.FunctionName; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.FunctionName !== undefined && { + FunctionName: input.FunctionName + }) + }; }; const serializeAws_json1_1GetUserDefinedFunctionsRequest = ( input: GetUserDefinedFunctionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Pattern !== undefined) { - bodyParams["Pattern"] = input.Pattern; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ImportCatalogToGlueRequest = ( input: ImportCatalogToGlueRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }) + }; }; const serializeAws_json1_1LocationMap = ( @@ -15974,14 +15785,10 @@ const serializeAws_json1_1Order = ( input: Order, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Column !== undefined) { - bodyParams["Column"] = input.Column; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + return { + ...(input.Column !== undefined && { Column: input.Column }), + ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }) + }; }; const serializeAws_json1_1OrderList = ( @@ -16005,36 +15812,26 @@ const serializeAws_json1_1PartitionInput = ( input: PartitionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LastAccessTime !== undefined) { - bodyParams["LastAccessTime"] = Math.round( - input.LastAccessTime.getTime() / 1000 - ); - } - if (input.LastAnalyzedTime !== undefined) { - bodyParams["LastAnalyzedTime"] = Math.round( - input.LastAnalyzedTime.getTime() / 1000 - ); - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ParametersMap( - input.Parameters, - context - ); - } - if (input.StorageDescriptor !== undefined) { - bodyParams["StorageDescriptor"] = serializeAws_json1_1StorageDescriptor( - input.StorageDescriptor, - context - ); - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ValueStringList( - input.Values, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PartitionInputList = ( @@ -16048,14 +15845,11 @@ const serializeAws_json1_1PartitionValueList = ( input: PartitionValueList, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ValueStringList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Values !== undefined && { + Values: serializeAws_json1_1ValueStringList(input.Values, context) + }) + }; }; const serializeAws_json1_1PermissionList = ( @@ -16069,40 +15863,35 @@ const serializeAws_json1_1PhysicalConnectionRequirements = ( input: PhysicalConnectionRequirements, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.SecurityGroupIdList !== undefined) { - bodyParams["SecurityGroupIdList"] = serializeAws_json1_1SecurityGroupIdList( - input.SecurityGroupIdList, - context - ); - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - return bodyParams; + return { + ...(input.AvailabilityZone !== undefined && { + AvailabilityZone: input.AvailabilityZone + }), + ...(input.SecurityGroupIdList !== undefined && { + SecurityGroupIdList: serializeAws_json1_1SecurityGroupIdList( + input.SecurityGroupIdList, + context + ) + }), + ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }) + }; }; const serializeAws_json1_1PrincipalPermissions = ( input: PrincipalPermissions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = serializeAws_json1_1PermissionList( - input.Permissions, - context - ); - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = serializeAws_json1_1DataLakePrincipal( - input.Principal, - context - ); - } - return bodyParams; + return { + ...(input.Permissions !== undefined && { + Permissions: serializeAws_json1_1PermissionList( + input.Permissions, + context + ) + }), + ...(input.Principal !== undefined && { + Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) + }) + }; }; const serializeAws_json1_1PrincipalPermissionsList = ( @@ -16118,67 +15907,55 @@ const serializeAws_json1_1PropertyPredicate = ( input: PropertyPredicate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Comparator !== undefined) { - bodyParams["Comparator"] = input.Comparator; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Comparator !== undefined && { Comparator: input.Comparator }), + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1PutDataCatalogEncryptionSettingsRequest = ( input: PutDataCatalogEncryptionSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DataCatalogEncryptionSettings !== undefined) { - bodyParams[ - "DataCatalogEncryptionSettings" - ] = serializeAws_json1_1DataCatalogEncryptionSettings( - input.DataCatalogEncryptionSettings, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DataCatalogEncryptionSettings !== undefined && { + DataCatalogEncryptionSettings: serializeAws_json1_1DataCatalogEncryptionSettings( + input.DataCatalogEncryptionSettings, + context + ) + }) + }; }; const serializeAws_json1_1PutResourcePolicyRequest = ( input: PutResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyExistsCondition !== undefined) { - bodyParams["PolicyExistsCondition"] = input.PolicyExistsCondition; - } - if (input.PolicyHashCondition !== undefined) { - bodyParams["PolicyHashCondition"] = input.PolicyHashCondition; - } - if (input.PolicyInJson !== undefined) { - bodyParams["PolicyInJson"] = input.PolicyInJson; - } - return bodyParams; + return { + ...(input.PolicyExistsCondition !== undefined && { + PolicyExistsCondition: input.PolicyExistsCondition + }), + ...(input.PolicyHashCondition !== undefined && { + PolicyHashCondition: input.PolicyHashCondition + }), + ...(input.PolicyInJson !== undefined && { + PolicyInJson: input.PolicyInJson + }) + }; }; const serializeAws_json1_1ResourceUri = ( input: ResourceUri, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.Uri !== undefined) { - bodyParams["Uri"] = input.Uri; - } - return bodyParams; + return { + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.Uri !== undefined && { Uri: input.Uri }) + }; }; const serializeAws_json1_1ResourceUriList = ( @@ -16201,32 +15978,24 @@ const serializeAws_json1_1SearchTablesRequest = ( input: SearchTablesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1SearchPropertyPredicates( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SearchText !== undefined) { - bodyParams["SearchText"] = input.SearchText; - } - if (input.SortCriteria !== undefined) { - bodyParams["SortCriteria"] = serializeAws_json1_1SortCriteria( - input.SortCriteria, - context - ); - } - return bodyParams; + 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.SearchText !== undefined && { SearchText: input.SearchText }), + ...(input.SortCriteria !== undefined && { + SortCriteria: serializeAws_json1_1SortCriteria( + input.SortCriteria, + context + ) + }) + }; }; const serializeAws_json1_1SecurityGroupIdList = ( @@ -16240,64 +16009,55 @@ const serializeAws_json1_1Segment = ( input: Segment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SegmentNumber !== undefined) { - bodyParams["SegmentNumber"] = input.SegmentNumber; - } - if (input.TotalSegments !== undefined) { - bodyParams["TotalSegments"] = input.TotalSegments; - } - return bodyParams; + return { + ...(input.SegmentNumber !== undefined && { + SegmentNumber: input.SegmentNumber + }), + ...(input.TotalSegments !== undefined && { + TotalSegments: input.TotalSegments + }) + }; }; const serializeAws_json1_1SerDeInfo = ( input: SerDeInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ParametersMap( - input.Parameters, - context - ); - } - if (input.SerializationLibrary !== undefined) { - bodyParams["SerializationLibrary"] = input.SerializationLibrary; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_1ParametersMap(input.Parameters, context) + }), + ...(input.SerializationLibrary !== undefined && { + SerializationLibrary: input.SerializationLibrary + }) + }; }; const serializeAws_json1_1SkewedInfo = ( input: SkewedInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SkewedColumnNames !== undefined) { - bodyParams["SkewedColumnNames"] = serializeAws_json1_1NameStringList( - input.SkewedColumnNames, - context - ); - } - if (input.SkewedColumnValueLocationMaps !== undefined) { - bodyParams[ - "SkewedColumnValueLocationMaps" - ] = serializeAws_json1_1LocationMap( - input.SkewedColumnValueLocationMaps, - context - ); - } - if (input.SkewedColumnValues !== undefined) { - bodyParams[ - "SkewedColumnValues" - ] = serializeAws_json1_1ColumnValueStringList( - input.SkewedColumnValues, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SortCriteria = ( @@ -16311,276 +16071,205 @@ const serializeAws_json1_1SortCriterion = ( input: SortCriterion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldName !== undefined) { - bodyParams["FieldName"] = input.FieldName; - } - if (input.Sort !== undefined) { - bodyParams["Sort"] = input.Sort; - } - return bodyParams; + return { + ...(input.FieldName !== undefined && { FieldName: input.FieldName }), + ...(input.Sort !== undefined && { Sort: input.Sort }) + }; }; const serializeAws_json1_1StorageDescriptor = ( input: StorageDescriptor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketColumns !== undefined) { - bodyParams["BucketColumns"] = serializeAws_json1_1NameStringList( - input.BucketColumns, - context - ); - } - if (input.Columns !== undefined) { - bodyParams["Columns"] = serializeAws_json1_1ColumnList( - input.Columns, - context - ); - } - if (input.Compressed !== undefined) { - bodyParams["Compressed"] = input.Compressed; - } - if (input.InputFormat !== undefined) { - bodyParams["InputFormat"] = input.InputFormat; - } - if (input.Location !== undefined) { - bodyParams["Location"] = input.Location; - } - if (input.NumberOfBuckets !== undefined) { - bodyParams["NumberOfBuckets"] = input.NumberOfBuckets; - } - if (input.OutputFormat !== undefined) { - bodyParams["OutputFormat"] = input.OutputFormat; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ParametersMap( - input.Parameters, - context - ); - } - if (input.SerdeInfo !== undefined) { - bodyParams["SerdeInfo"] = serializeAws_json1_1SerDeInfo( - input.SerdeInfo, - context - ); - } - if (input.SkewedInfo !== undefined) { - bodyParams["SkewedInfo"] = serializeAws_json1_1SkewedInfo( - input.SkewedInfo, - context - ); - } - if (input.SortColumns !== undefined) { - bodyParams["SortColumns"] = serializeAws_json1_1OrderList( - input.SortColumns, - context - ); - } - if (input.StoredAsSubDirectories !== undefined) { - bodyParams["StoredAsSubDirectories"] = input.StoredAsSubDirectories; - } - return bodyParams; + 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.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 + }) + }; }; const serializeAws_json1_1TableInput = ( input: TableInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.LastAccessTime !== undefined) { - bodyParams["LastAccessTime"] = Math.round( - input.LastAccessTime.getTime() / 1000 - ); - } - if (input.LastAnalyzedTime !== undefined) { - bodyParams["LastAnalyzedTime"] = Math.round( - input.LastAnalyzedTime.getTime() / 1000 - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Owner !== undefined) { - bodyParams["Owner"] = input.Owner; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ParametersMap( - input.Parameters, - context - ); - } - if (input.PartitionKeys !== undefined) { - bodyParams["PartitionKeys"] = serializeAws_json1_1ColumnList( - input.PartitionKeys, - context - ); - } - if (input.Retention !== undefined) { - bodyParams["Retention"] = input.Retention; - } - if (input.StorageDescriptor !== undefined) { - bodyParams["StorageDescriptor"] = serializeAws_json1_1StorageDescriptor( - input.StorageDescriptor, - context - ); - } - if (input.TableType !== undefined) { - bodyParams["TableType"] = input.TableType; - } - if (input.ViewExpandedText !== undefined) { - bodyParams["ViewExpandedText"] = input.ViewExpandedText; - } - if (input.ViewOriginalText !== undefined) { - bodyParams["ViewOriginalText"] = input.ViewOriginalText; - } - return bodyParams; + 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.ViewExpandedText !== undefined && { + ViewExpandedText: input.ViewExpandedText + }), + ...(input.ViewOriginalText !== undefined && { + ViewOriginalText: input.ViewOriginalText + }) + }; }; const serializeAws_json1_1UpdateConnectionRequest = ( input: UpdateConnectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.ConnectionInput !== undefined) { - bodyParams["ConnectionInput"] = serializeAws_json1_1ConnectionInput( - input.ConnectionInput, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.ConnectionInput !== undefined && { + ConnectionInput: serializeAws_json1_1ConnectionInput( + input.ConnectionInput, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateDatabaseRequest = ( input: UpdateDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseInput !== undefined) { - bodyParams["DatabaseInput"] = serializeAws_json1_1DatabaseInput( - input.DatabaseInput, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DatabaseInput !== undefined && { + DatabaseInput: serializeAws_json1_1DatabaseInput( + input.DatabaseInput, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdatePartitionRequest = ( input: UpdatePartitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.PartitionInput !== undefined) { - bodyParams["PartitionInput"] = serializeAws_json1_1PartitionInput( - input.PartitionInput, - context - ); - } - if (input.PartitionValueList !== undefined) { - bodyParams[ - "PartitionValueList" - ] = serializeAws_json1_1BoundedPartitionValueList( - input.PartitionValueList, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateTableRequest = ( input: UpdateTableRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.SkipArchive !== undefined) { - bodyParams["SkipArchive"] = input.SkipArchive; - } - if (input.TableInput !== undefined) { - bodyParams["TableInput"] = serializeAws_json1_1TableInput( - input.TableInput, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateUserDefinedFunctionRequest = ( input: UpdateUserDefinedFunctionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.FunctionInput !== undefined) { - bodyParams["FunctionInput"] = serializeAws_json1_1UserDefinedFunctionInput( - input.FunctionInput, - context - ); - } - if (input.FunctionName !== undefined) { - bodyParams["FunctionName"] = input.FunctionName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UserDefinedFunctionInput = ( input: UserDefinedFunctionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClassName !== undefined) { - bodyParams["ClassName"] = input.ClassName; - } - if (input.FunctionName !== undefined) { - bodyParams["FunctionName"] = input.FunctionName; - } - if (input.OwnerName !== undefined) { - bodyParams["OwnerName"] = input.OwnerName; - } - if (input.OwnerType !== undefined) { - bodyParams["OwnerType"] = input.OwnerType; - } - if (input.ResourceUris !== undefined) { - bodyParams["ResourceUris"] = serializeAws_json1_1ResourceUriList( - input.ResourceUris, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ValueStringList = ( @@ -16594,145 +16283,121 @@ const serializeAws_json1_1BatchGetDevEndpointsRequest = ( input: BatchGetDevEndpointsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DevEndpointNames !== undefined) { - bodyParams["DevEndpointNames"] = serializeAws_json1_1DevEndpointNames( - input.DevEndpointNames, - context - ); - } - return bodyParams; + return { + ...(input.DevEndpointNames !== undefined && { + DevEndpointNames: serializeAws_json1_1DevEndpointNames( + input.DevEndpointNames, + context + ) + }) + }; }; const serializeAws_json1_1CloudWatchEncryption = ( input: CloudWatchEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchEncryptionMode !== undefined) { - bodyParams["CloudWatchEncryptionMode"] = input.CloudWatchEncryptionMode; - } - if (input.KmsKeyArn !== undefined) { - bodyParams["KmsKeyArn"] = input.KmsKeyArn; - } - return bodyParams; + return { + ...(input.CloudWatchEncryptionMode !== undefined && { + CloudWatchEncryptionMode: input.CloudWatchEncryptionMode + }), + ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }) + }; }; const serializeAws_json1_1CreateDevEndpointRequest = ( input: CreateDevEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arguments !== undefined) { - bodyParams["Arguments"] = serializeAws_json1_1MapValue( - input.Arguments, - context - ); - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.ExtraJarsS3Path !== undefined) { - bodyParams["ExtraJarsS3Path"] = input.ExtraJarsS3Path; - } - if (input.ExtraPythonLibsS3Path !== undefined) { - bodyParams["ExtraPythonLibsS3Path"] = input.ExtraPythonLibsS3Path; - } - if (input.GlueVersion !== undefined) { - bodyParams["GlueVersion"] = input.GlueVersion; - } - if (input.NumberOfNodes !== undefined) { - bodyParams["NumberOfNodes"] = input.NumberOfNodes; - } - if (input.NumberOfWorkers !== undefined) { - bodyParams["NumberOfWorkers"] = input.NumberOfWorkers; - } - if (input.PublicKey !== undefined) { - bodyParams["PublicKey"] = input.PublicKey; - } - if (input.PublicKeys !== undefined) { - bodyParams["PublicKeys"] = serializeAws_json1_1PublicKeysList( - input.PublicKeys, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1StringList( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - if (input.WorkerType !== undefined) { - bodyParams["WorkerType"] = input.WorkerType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateSecurityConfigurationRequest = ( input: CreateSecurityConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_json1_1EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.EncryptionConfiguration !== undefined && { + EncryptionConfiguration: serializeAws_json1_1EncryptionConfiguration( + input.EncryptionConfiguration, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteDevEndpointRequest = ( input: DeleteDevEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - return bodyParams; + return { + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }) + }; }; const serializeAws_json1_1DeleteSecurityConfigurationRequest = ( input: DeleteSecurityConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DevEndpointCustomLibraries = ( input: DevEndpointCustomLibraries, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExtraJarsS3Path !== undefined) { - bodyParams["ExtraJarsS3Path"] = input.ExtraJarsS3Path; - } - if (input.ExtraPythonLibsS3Path !== undefined) { - bodyParams["ExtraPythonLibsS3Path"] = input.ExtraPythonLibsS3Path; - } - return bodyParams; + return { + ...(input.ExtraJarsS3Path !== undefined && { + ExtraJarsS3Path: input.ExtraJarsS3Path + }), + ...(input.ExtraPythonLibsS3Path !== undefined && { + ExtraPythonLibsS3Path: input.ExtraPythonLibsS3Path + }) + }; }; const serializeAws_json1_1DevEndpointNames = ( @@ -16746,125 +16411,101 @@ const serializeAws_json1_1EncryptionConfiguration = ( input: EncryptionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchEncryption !== undefined) { - bodyParams[ - "CloudWatchEncryption" - ] = serializeAws_json1_1CloudWatchEncryption( - input.CloudWatchEncryption, - context - ); - } - if (input.JobBookmarksEncryption !== undefined) { - bodyParams[ - "JobBookmarksEncryption" - ] = serializeAws_json1_1JobBookmarksEncryption( - input.JobBookmarksEncryption, - context - ); - } - if (input.S3Encryption !== undefined) { - bodyParams["S3Encryption"] = serializeAws_json1_1S3EncryptionList( - input.S3Encryption, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1GetDevEndpointRequest = ( input: GetDevEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - return bodyParams; + return { + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }) + }; }; const serializeAws_json1_1GetDevEndpointsRequest = ( input: GetDevEndpointsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetJobBookmarkRequest = ( input: GetJobBookmarkRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.RunId !== undefined) { - bodyParams["RunId"] = input.RunId; - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.RunId !== undefined && { RunId: input.RunId }) + }; }; const serializeAws_json1_1GetSecurityConfigurationRequest = ( input: GetSecurityConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetSecurityConfigurationsRequest = ( input: GetSecurityConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1JobBookmarksEncryption = ( input: JobBookmarksEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobBookmarksEncryptionMode !== undefined) { - bodyParams["JobBookmarksEncryptionMode"] = input.JobBookmarksEncryptionMode; - } - if (input.KmsKeyArn !== undefined) { - bodyParams["KmsKeyArn"] = input.KmsKeyArn; - } - return bodyParams; + return { + ...(input.JobBookmarksEncryptionMode !== undefined && { + JobBookmarksEncryptionMode: input.JobBookmarksEncryptionMode + }), + ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }) + }; }; const serializeAws_json1_1ListDevEndpointsRequest = ( input: ListDevEndpointsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagsMap(input.Tags, context) + }) + }; }; const serializeAws_json1_1MapValue = ( @@ -16888,28 +16529,22 @@ const serializeAws_json1_1ResetJobBookmarkRequest = ( input: ResetJobBookmarkRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.RunId !== undefined) { - bodyParams["RunId"] = input.RunId; - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.RunId !== undefined && { RunId: input.RunId }) + }; }; const serializeAws_json1_1S3Encryption = ( input: S3Encryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyArn !== undefined) { - bodyParams["KmsKeyArn"] = input.KmsKeyArn; - } - if (input.S3EncryptionMode !== undefined) { - bodyParams["S3EncryptionMode"] = input.S3EncryptionMode; - } - return bodyParams; + return { + ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), + ...(input.S3EncryptionMode !== undefined && { + S3EncryptionMode: input.S3EncryptionMode + }) + }; }; const serializeAws_json1_1S3EncryptionList = ( @@ -16930,241 +16565,180 @@ const serializeAws_json1_1UpdateDevEndpointRequest = ( input: UpdateDevEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddArguments !== undefined) { - bodyParams["AddArguments"] = serializeAws_json1_1MapValue( - input.AddArguments, - context - ); - } - if (input.AddPublicKeys !== undefined) { - bodyParams["AddPublicKeys"] = serializeAws_json1_1PublicKeysList( - input.AddPublicKeys, - context - ); - } - if (input.CustomLibraries !== undefined) { - bodyParams[ - "CustomLibraries" - ] = serializeAws_json1_1DevEndpointCustomLibraries( - input.CustomLibraries, - context - ); - } - if (input.DeleteArguments !== undefined) { - bodyParams["DeleteArguments"] = serializeAws_json1_1StringList( - input.DeleteArguments, - context - ); - } - if (input.DeletePublicKeys !== undefined) { - bodyParams["DeletePublicKeys"] = serializeAws_json1_1PublicKeysList( - input.DeletePublicKeys, - context - ); - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.PublicKey !== undefined) { - bodyParams["PublicKey"] = input.PublicKey; - } - if (input.UpdateEtlLibraries !== undefined) { - bodyParams["UpdateEtlLibraries"] = input.UpdateEtlLibraries; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CancelMLTaskRunRequest = ( input: CancelMLTaskRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskRunId !== undefined) { - bodyParams["TaskRunId"] = input.TaskRunId; - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.TaskRunId !== undefined && { TaskRunId: input.TaskRunId }), + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1CreateMLTransformRequest = ( input: CreateMLTransformRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GlueVersion !== undefined) { - bodyParams["GlueVersion"] = input.GlueVersion; - } - if (input.InputRecordTables !== undefined) { - bodyParams["InputRecordTables"] = serializeAws_json1_1GlueTables( - input.InputRecordTables, - context - ); - } - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MaxRetries !== undefined) { - bodyParams["MaxRetries"] = input.MaxRetries; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NumberOfWorkers !== undefined) { - bodyParams["NumberOfWorkers"] = input.NumberOfWorkers; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1TransformParameters( - input.Parameters, - context - ); - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - if (input.WorkerType !== undefined) { - bodyParams["WorkerType"] = input.WorkerType; - } - return bodyParams; + 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.Timeout !== undefined && { Timeout: input.Timeout }), + ...(input.WorkerType !== undefined && { WorkerType: input.WorkerType }) + }; }; const serializeAws_json1_1DeleteMLTransformRequest = ( input: DeleteMLTransformRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1FindMatchesParameters = ( input: FindMatchesParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccuracyCostTradeoff !== undefined) { - bodyParams["AccuracyCostTradeoff"] = input.AccuracyCostTradeoff; - } - if (input.EnforceProvidedLabels !== undefined) { - bodyParams["EnforceProvidedLabels"] = input.EnforceProvidedLabels; - } - if (input.PrecisionRecallTradeoff !== undefined) { - bodyParams["PrecisionRecallTradeoff"] = input.PrecisionRecallTradeoff; - } - if (input.PrimaryKeyColumnName !== undefined) { - bodyParams["PrimaryKeyColumnName"] = input.PrimaryKeyColumnName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetMLTaskRunRequest = ( input: GetMLTaskRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskRunId !== undefined) { - bodyParams["TaskRunId"] = input.TaskRunId; - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.TaskRunId !== undefined && { TaskRunId: input.TaskRunId }), + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1GetMLTaskRunsRequest = ( input: GetMLTaskRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1TaskRunFilterCriteria( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Sort !== undefined) { - bodyParams["Sort"] = serializeAws_json1_1TaskRunSortCriteria( - input.Sort, - context - ); - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetMLTransformRequest = ( input: GetMLTransformRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1GetMLTransformsRequest = ( input: GetMLTransformsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1TransformFilterCriteria( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Sort !== undefined) { - bodyParams["Sort"] = serializeAws_json1_1TransformSortCriteria( - input.Sort, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GlueTable = ( input: GlueTable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.ConnectionName !== undefined) { - bodyParams["ConnectionName"] = input.ConnectionName; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GlueTables = ( @@ -17178,173 +16752,130 @@ const serializeAws_json1_1SchemaColumn = ( input: SchemaColumn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataType !== undefined) { - bodyParams["DataType"] = input.DataType; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.DataType !== undefined && { DataType: input.DataType }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StartExportLabelsTaskRunRequest = ( input: StartExportLabelsTaskRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputS3Path !== undefined) { - bodyParams["OutputS3Path"] = input.OutputS3Path; - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.OutputS3Path !== undefined && { + OutputS3Path: input.OutputS3Path + }), + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1StartImportLabelsTaskRunRequest = ( input: StartImportLabelsTaskRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputS3Path !== undefined) { - bodyParams["InputS3Path"] = input.InputS3Path; - } - if (input.ReplaceAllLabels !== undefined) { - bodyParams["ReplaceAllLabels"] = input.ReplaceAllLabels; - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.InputS3Path !== undefined && { InputS3Path: input.InputS3Path }), + ...(input.ReplaceAllLabels !== undefined && { + ReplaceAllLabels: input.ReplaceAllLabels + }), + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1StartMLEvaluationTaskRunRequest = ( input: StartMLEvaluationTaskRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1StartMLLabelingSetGenerationTaskRunRequest = ( input: StartMLLabelingSetGenerationTaskRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputS3Path !== undefined) { - bodyParams["OutputS3Path"] = input.OutputS3Path; - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - return bodyParams; + return { + ...(input.OutputS3Path !== undefined && { + OutputS3Path: input.OutputS3Path + }), + ...(input.TransformId !== undefined && { TransformId: input.TransformId }) + }; }; const serializeAws_json1_1TaskRunFilterCriteria = ( input: TaskRunFilterCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StartedAfter !== undefined) { - bodyParams["StartedAfter"] = Math.round( - input.StartedAfter.getTime() / 1000 - ); - } - if (input.StartedBefore !== undefined) { - bodyParams["StartedBefore"] = Math.round( - input.StartedBefore.getTime() / 1000 - ); - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.TaskRunType !== undefined) { - bodyParams["TaskRunType"] = input.TaskRunType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1TaskRunSortCriteria = ( input: TaskRunSortCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Column !== undefined) { - bodyParams["Column"] = input.Column; - } - if (input.SortDirection !== undefined) { - bodyParams["SortDirection"] = input.SortDirection; - } - return bodyParams; + return { + ...(input.Column !== undefined && { Column: input.Column }), + ...(input.SortDirection !== undefined && { + SortDirection: input.SortDirection + }) + }; }; const serializeAws_json1_1TransformFilterCriteria = ( input: TransformFilterCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedAfter !== undefined) { - bodyParams["CreatedAfter"] = Math.round( - input.CreatedAfter.getTime() / 1000 - ); - } - if (input.CreatedBefore !== undefined) { - bodyParams["CreatedBefore"] = Math.round( - input.CreatedBefore.getTime() / 1000 - ); - } - if (input.GlueVersion !== undefined) { - bodyParams["GlueVersion"] = input.GlueVersion; - } - if (input.LastModifiedAfter !== undefined) { - bodyParams["LastModifiedAfter"] = Math.round( - input.LastModifiedAfter.getTime() / 1000 - ); - } - if (input.LastModifiedBefore !== undefined) { - bodyParams["LastModifiedBefore"] = Math.round( - input.LastModifiedBefore.getTime() / 1000 - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Schema !== undefined) { - bodyParams["Schema"] = serializeAws_json1_1TransformSchema( - input.Schema, - context - ); - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.TransformType !== undefined) { - bodyParams["TransformType"] = input.TransformType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1TransformParameters = ( input: TransformParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FindMatchesParameters !== undefined) { - bodyParams[ - "FindMatchesParameters" - ] = serializeAws_json1_1FindMatchesParameters( - input.FindMatchesParameters, - context - ); - } - if (input.TransformType !== undefined) { - bodyParams["TransformType"] = input.TransformType; - } - return bodyParams; + return { + ...(input.FindMatchesParameters !== undefined && { + FindMatchesParameters: serializeAws_json1_1FindMatchesParameters( + input.FindMatchesParameters, + context + ) + }), + ...(input.TransformType !== undefined && { + TransformType: input.TransformType + }) + }; }; const serializeAws_json1_1TransformSchema = ( @@ -17358,92 +16889,61 @@ const serializeAws_json1_1TransformSortCriteria = ( input: TransformSortCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Column !== undefined) { - bodyParams["Column"] = input.Column; - } - if (input.SortDirection !== undefined) { - bodyParams["SortDirection"] = input.SortDirection; - } - return bodyParams; + return { + ...(input.Column !== undefined && { Column: input.Column }), + ...(input.SortDirection !== undefined && { + SortDirection: input.SortDirection + }) + }; }; const serializeAws_json1_1UpdateMLTransformRequest = ( input: UpdateMLTransformRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GlueVersion !== undefined) { - bodyParams["GlueVersion"] = input.GlueVersion; - } - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MaxRetries !== undefined) { - bodyParams["MaxRetries"] = input.MaxRetries; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NumberOfWorkers !== undefined) { - bodyParams["NumberOfWorkers"] = input.NumberOfWorkers; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1TransformParameters( - input.Parameters, - context - ); - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - if (input.TransformId !== undefined) { - bodyParams["TransformId"] = input.TransformId; - } - if (input.WorkerType !== undefined) { - bodyParams["WorkerType"] = input.WorkerType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Action = ( input: Action, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arguments !== undefined) { - bodyParams["Arguments"] = serializeAws_json1_1GenericMap( - input.Arguments, - context - ); - } - if (input.CrawlerName !== undefined) { - bodyParams["CrawlerName"] = input.CrawlerName; - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.NotificationProperty !== undefined) { - bodyParams[ - "NotificationProperty" - ] = serializeAws_json1_1NotificationProperty( - input.NotificationProperty, - context - ); - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ActionList = ( @@ -17457,45 +16957,39 @@ const serializeAws_json1_1BatchGetJobsRequest = ( input: BatchGetJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobNames !== undefined) { - bodyParams["JobNames"] = serializeAws_json1_1JobNameList( - input.JobNames, - context - ); - } - return bodyParams; + return { + ...(input.JobNames !== undefined && { + JobNames: serializeAws_json1_1JobNameList(input.JobNames, context) + }) + }; }; const serializeAws_json1_1BatchGetTriggersRequest = ( input: BatchGetTriggersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TriggerNames !== undefined) { - bodyParams["TriggerNames"] = serializeAws_json1_1TriggerNameList( - input.TriggerNames, - context - ); - } - return bodyParams; + return { + ...(input.TriggerNames !== undefined && { + TriggerNames: serializeAws_json1_1TriggerNameList( + input.TriggerNames, + context + ) + }) + }; }; const serializeAws_json1_1BatchGetWorkflowsRequest = ( input: BatchGetWorkflowsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IncludeGraph !== undefined) { - bodyParams["IncludeGraph"] = input.IncludeGraph; - } - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1WorkflowNames( - input.Names, - context - ); - } - return bodyParams; + return { + ...(input.IncludeGraph !== undefined && { + IncludeGraph: input.IncludeGraph + }), + ...(input.Names !== undefined && { + Names: serializeAws_json1_1WorkflowNames(input.Names, context) + }) + }; }; const serializeAws_json1_1BatchStopJobRunJobRunIdList = ( @@ -17509,40 +17003,30 @@ const serializeAws_json1_1BatchStopJobRunRequest = ( input: BatchStopJobRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobRunIds !== undefined) { - bodyParams["JobRunIds"] = serializeAws_json1_1BatchStopJobRunJobRunIdList( - input.JobRunIds, - context - ); - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.JobRunIds !== undefined && { + JobRunIds: serializeAws_json1_1BatchStopJobRunJobRunIdList( + input.JobRunIds, + context + ) + }) + }; }; const serializeAws_json1_1Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlState !== undefined) { - bodyParams["CrawlState"] = input.CrawlState; - } - if (input.CrawlerName !== undefined) { - bodyParams["CrawlerName"] = input.CrawlerName; - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.LogicalOperator !== undefined) { - bodyParams["LogicalOperator"] = input.LogicalOperator; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ConditionList = ( @@ -17556,203 +17040,154 @@ const serializeAws_json1_1ConnectionsList = ( input: ConnectionsList, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Connections !== undefined) { - bodyParams["Connections"] = serializeAws_json1_1OrchestrationStringList( - input.Connections, - context - ); - } - return bodyParams; + return { + ...(input.Connections !== undefined && { + Connections: serializeAws_json1_1OrchestrationStringList( + input.Connections, + context + ) + }) + }; }; const serializeAws_json1_1CreateJobRequest = ( input: CreateJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllocatedCapacity !== undefined) { - bodyParams["AllocatedCapacity"] = input.AllocatedCapacity; - } - if (input.Command !== undefined) { - bodyParams["Command"] = serializeAws_json1_1JobCommand( - input.Command, - context - ); - } - if (input.Connections !== undefined) { - bodyParams["Connections"] = serializeAws_json1_1ConnectionsList( - input.Connections, - context - ); - } - if (input.DefaultArguments !== undefined) { - bodyParams["DefaultArguments"] = serializeAws_json1_1GenericMap( - input.DefaultArguments, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ExecutionProperty !== undefined) { - bodyParams["ExecutionProperty"] = serializeAws_json1_1ExecutionProperty( - input.ExecutionProperty, - context - ); - } - if (input.GlueVersion !== undefined) { - bodyParams["GlueVersion"] = input.GlueVersion; - } - if (input.LogUri !== undefined) { - bodyParams["LogUri"] = input.LogUri; - } - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MaxRetries !== undefined) { - bodyParams["MaxRetries"] = input.MaxRetries; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NotificationProperty !== undefined) { - bodyParams[ - "NotificationProperty" - ] = serializeAws_json1_1NotificationProperty( - input.NotificationProperty, - context - ); - } - if (input.NumberOfWorkers !== undefined) { - bodyParams["NumberOfWorkers"] = input.NumberOfWorkers; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - if (input.WorkerType !== undefined) { - bodyParams["WorkerType"] = input.WorkerType; - } - return bodyParams; + 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.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 }) + }; }; const serializeAws_json1_1CreateTriggerRequest = ( input: CreateTriggerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_json1_1ActionList( - input.Actions, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Predicate !== undefined) { - bodyParams["Predicate"] = serializeAws_json1_1Predicate( - input.Predicate, - context - ); - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.StartOnCreation !== undefined) { - bodyParams["StartOnCreation"] = input.StartOnCreation; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.WorkflowName !== undefined) { - bodyParams["WorkflowName"] = input.WorkflowName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateWorkflowRequest = ( input: CreateWorkflowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultRunProperties !== undefined) { - bodyParams[ - "DefaultRunProperties" - ] = serializeAws_json1_1WorkflowRunProperties( - input.DefaultRunProperties, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - return bodyParams; + return { + ...(input.DefaultRunProperties !== undefined && { + DefaultRunProperties: serializeAws_json1_1WorkflowRunProperties( + input.DefaultRunProperties, + context + ) + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagsMap(input.Tags, context) + }) + }; }; const serializeAws_json1_1DeleteJobRequest = ( input: DeleteJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }) + }; }; const serializeAws_json1_1DeleteTriggerRequest = ( input: DeleteTriggerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteWorkflowRequest = ( input: DeleteWorkflowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1ExecutionProperty = ( input: ExecutionProperty, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxConcurrentRuns !== undefined) { - bodyParams["MaxConcurrentRuns"] = input.MaxConcurrentRuns; - } - return bodyParams; + return { + ...(input.MaxConcurrentRuns !== undefined && { + MaxConcurrentRuns: input.MaxConcurrentRuns + }) + }; }; const serializeAws_json1_1GenericMap = ( @@ -17769,169 +17204,129 @@ const serializeAws_json1_1GetJobRequest = ( input: GetJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }) + }; }; const serializeAws_json1_1GetJobRunRequest = ( input: GetJobRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.PredecessorsIncluded !== undefined) { - bodyParams["PredecessorsIncluded"] = input.PredecessorsIncluded; - } - if (input.RunId !== undefined) { - bodyParams["RunId"] = input.RunId; - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.PredecessorsIncluded !== undefined && { + PredecessorsIncluded: input.PredecessorsIncluded + }), + ...(input.RunId !== undefined && { RunId: input.RunId }) + }; }; const serializeAws_json1_1GetJobRunsRequest = ( input: GetJobRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetJobsRequest = ( input: GetJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetTriggerRequest = ( input: GetTriggerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetTriggersRequest = ( input: GetTriggersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DependentJobName !== undefined) { - bodyParams["DependentJobName"] = input.DependentJobName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DependentJobName !== undefined && { + DependentJobName: input.DependentJobName + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetWorkflowRequest = ( input: GetWorkflowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IncludeGraph !== undefined) { - bodyParams["IncludeGraph"] = input.IncludeGraph; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.IncludeGraph !== undefined && { + IncludeGraph: input.IncludeGraph + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetWorkflowRunPropertiesRequest = ( input: GetWorkflowRunPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RunId !== undefined) { - bodyParams["RunId"] = input.RunId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RunId !== undefined && { RunId: input.RunId }) + }; }; const serializeAws_json1_1GetWorkflowRunRequest = ( input: GetWorkflowRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IncludeGraph !== undefined) { - bodyParams["IncludeGraph"] = input.IncludeGraph; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RunId !== undefined) { - bodyParams["RunId"] = input.RunId; - } - return bodyParams; + return { + ...(input.IncludeGraph !== undefined && { + IncludeGraph: input.IncludeGraph + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RunId !== undefined && { RunId: input.RunId }) + }; }; const serializeAws_json1_1GetWorkflowRunsRequest = ( input: GetWorkflowRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IncludeGraph !== undefined) { - bodyParams["IncludeGraph"] = input.IncludeGraph; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1JobCommand = ( input: JobCommand, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PythonVersion !== undefined) { - bodyParams["PythonVersion"] = input.PythonVersion; - } - if (input.ScriptLocation !== undefined) { - bodyParams["ScriptLocation"] = input.ScriptLocation; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.PythonVersion !== undefined && { + PythonVersion: input.PythonVersion + }), + ...(input.ScriptLocation !== undefined && { + ScriptLocation: input.ScriptLocation + }) + }; }; const serializeAws_json1_1JobNameList = ( @@ -17945,135 +17340,102 @@ const serializeAws_json1_1JobUpdate = ( input: JobUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllocatedCapacity !== undefined) { - bodyParams["AllocatedCapacity"] = input.AllocatedCapacity; - } - if (input.Command !== undefined) { - bodyParams["Command"] = serializeAws_json1_1JobCommand( - input.Command, - context - ); - } - if (input.Connections !== undefined) { - bodyParams["Connections"] = serializeAws_json1_1ConnectionsList( - input.Connections, - context - ); - } - if (input.DefaultArguments !== undefined) { - bodyParams["DefaultArguments"] = serializeAws_json1_1GenericMap( - input.DefaultArguments, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ExecutionProperty !== undefined) { - bodyParams["ExecutionProperty"] = serializeAws_json1_1ExecutionProperty( - input.ExecutionProperty, - context - ); - } - if (input.GlueVersion !== undefined) { - bodyParams["GlueVersion"] = input.GlueVersion; - } - if (input.LogUri !== undefined) { - bodyParams["LogUri"] = input.LogUri; - } - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.MaxRetries !== undefined) { - bodyParams["MaxRetries"] = input.MaxRetries; - } - if (input.NotificationProperty !== undefined) { - bodyParams[ - "NotificationProperty" - ] = serializeAws_json1_1NotificationProperty( - input.NotificationProperty, - context - ); - } - if (input.NumberOfWorkers !== undefined) { - bodyParams["NumberOfWorkers"] = input.NumberOfWorkers; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - if (input.WorkerType !== undefined) { - bodyParams["WorkerType"] = input.WorkerType; - } - return bodyParams; + 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.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 }) + }; }; const serializeAws_json1_1ListJobsRequest = ( input: ListJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagsMap(input.Tags, context) + }) + }; }; const serializeAws_json1_1ListTriggersRequest = ( input: ListTriggersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DependentJobName !== undefined) { - bodyParams["DependentJobName"] = input.DependentJobName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListWorkflowsRequest = ( input: ListWorkflowsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1NotificationProperty = ( input: NotificationProperty, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotifyDelayAfter !== undefined) { - bodyParams["NotifyDelayAfter"] = input.NotifyDelayAfter; - } - return bodyParams; + return { + ...(input.NotifyDelayAfter !== undefined && { + NotifyDelayAfter: input.NotifyDelayAfter + }) + }; }; const serializeAws_json1_1OrchestrationStringList = ( @@ -18087,116 +17449,86 @@ const serializeAws_json1_1Predicate = ( input: Predicate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Conditions !== undefined) { - bodyParams["Conditions"] = serializeAws_json1_1ConditionList( - input.Conditions, - context - ); - } - if (input.Logical !== undefined) { - bodyParams["Logical"] = input.Logical; - } - return bodyParams; + return { + ...(input.Conditions !== undefined && { + Conditions: serializeAws_json1_1ConditionList(input.Conditions, context) + }), + ...(input.Logical !== undefined && { Logical: input.Logical }) + }; }; const serializeAws_json1_1PutWorkflowRunPropertiesRequest = ( input: PutWorkflowRunPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RunId !== undefined) { - bodyParams["RunId"] = input.RunId; - } - if (input.RunProperties !== undefined) { - bodyParams["RunProperties"] = serializeAws_json1_1WorkflowRunProperties( - input.RunProperties, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RunId !== undefined && { RunId: input.RunId }), + ...(input.RunProperties !== undefined && { + RunProperties: serializeAws_json1_1WorkflowRunProperties( + input.RunProperties, + context + ) + }) + }; }; const serializeAws_json1_1StartJobRunRequest = ( input: StartJobRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllocatedCapacity !== undefined) { - bodyParams["AllocatedCapacity"] = input.AllocatedCapacity; - } - if (input.Arguments !== undefined) { - bodyParams["Arguments"] = serializeAws_json1_1GenericMap( - input.Arguments, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobRunId !== undefined) { - bodyParams["JobRunId"] = input.JobRunId; - } - if (input.MaxCapacity !== undefined) { - bodyParams["MaxCapacity"] = input.MaxCapacity; - } - if (input.NotificationProperty !== undefined) { - bodyParams[ - "NotificationProperty" - ] = serializeAws_json1_1NotificationProperty( - input.NotificationProperty, - context - ); - } - if (input.NumberOfWorkers !== undefined) { - bodyParams["NumberOfWorkers"] = input.NumberOfWorkers; - } - if (input.SecurityConfiguration !== undefined) { - bodyParams["SecurityConfiguration"] = input.SecurityConfiguration; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - if (input.WorkerType !== undefined) { - bodyParams["WorkerType"] = input.WorkerType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartTriggerRequest = ( input: StartTriggerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StartWorkflowRunRequest = ( input: StartWorkflowRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StopTriggerRequest = ( input: StopTriggerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1TriggerNameList = ( @@ -18210,85 +17542,60 @@ const serializeAws_json1_1TriggerUpdate = ( input: TriggerUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_json1_1ActionList( - input.Actions, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Predicate !== undefined) { - bodyParams["Predicate"] = serializeAws_json1_1Predicate( - input.Predicate, - context - ); - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateJobRequest = ( input: UpdateJobRequest, context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobUpdate !== undefined) { - bodyParams["JobUpdate"] = serializeAws_json1_1JobUpdate( - input.JobUpdate, - context - ); - } - return bodyParams; +): any => { + return { + ...(input.JobName !== undefined && { JobName: input.JobName }), + ...(input.JobUpdate !== undefined && { + JobUpdate: serializeAws_json1_1JobUpdate(input.JobUpdate, context) + }) + }; }; const serializeAws_json1_1UpdateTriggerRequest = ( input: UpdateTriggerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.TriggerUpdate !== undefined) { - bodyParams["TriggerUpdate"] = serializeAws_json1_1TriggerUpdate( - input.TriggerUpdate, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.TriggerUpdate !== undefined && { + TriggerUpdate: serializeAws_json1_1TriggerUpdate( + input.TriggerUpdate, + context + ) + }) + }; }; const serializeAws_json1_1UpdateWorkflowRequest = ( input: UpdateWorkflowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultRunProperties !== undefined) { - bodyParams[ - "DefaultRunProperties" - ] = serializeAws_json1_1WorkflowRunProperties( - input.DefaultRunProperties, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.DefaultRunProperties !== undefined && { + DefaultRunProperties: serializeAws_json1_1WorkflowRunProperties( + input.DefaultRunProperties, + context + ) + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1WorkflowNames = ( @@ -18312,14 +17619,14 @@ const serializeAws_json1_1BatchGetCrawlersRequest = ( input: BatchGetCrawlersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlerNames !== undefined) { - bodyParams["CrawlerNames"] = serializeAws_json1_1CrawlerNameList( - input.CrawlerNames, - context - ); - } - return bodyParams; + return { + ...(input.CrawlerNames !== undefined && { + CrawlerNames: serializeAws_json1_1CrawlerNameList( + input.CrawlerNames, + context + ) + }) + }; }; const serializeAws_json1_1CatalogEntries = ( @@ -18333,14 +17640,12 @@ const serializeAws_json1_1CatalogEntry = ( input: CatalogEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + return { + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.TableName !== undefined && { TableName: input.TableName }) + }; }; const serializeAws_json1_1CatalogTablesList = ( @@ -18354,17 +17659,14 @@ const serializeAws_json1_1CatalogTarget = ( input: CatalogTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Tables !== undefined) { - bodyParams["Tables"] = serializeAws_json1_1CatalogTablesList( - input.Tables, - context - ); - } - return bodyParams; + return { + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.Tables !== undefined && { + Tables: serializeAws_json1_1CatalogTablesList(input.Tables, context) + }) + }; }; const serializeAws_json1_1CatalogTargetList = ( @@ -18385,57 +17687,38 @@ const serializeAws_json1_1CodeGenEdge = ( input: CodeGenEdge, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Target !== undefined) { - bodyParams["Target"] = input.Target; - } - if (input.TargetParameter !== undefined) { - bodyParams["TargetParameter"] = input.TargetParameter; - } - return bodyParams; + return { + ...(input.Source !== undefined && { Source: input.Source }), + ...(input.Target !== undefined && { Target: input.Target }), + ...(input.TargetParameter !== undefined && { + TargetParameter: input.TargetParameter + }) + }; }; const serializeAws_json1_1CodeGenNode = ( input: CodeGenNode, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Args !== undefined) { - bodyParams["Args"] = serializeAws_json1_1CodeGenNodeArgs( - input.Args, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LineNumber !== undefined) { - bodyParams["LineNumber"] = input.LineNumber; - } - if (input.NodeType !== undefined) { - bodyParams["NodeType"] = input.NodeType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CodeGenNodeArg = ( input: CodeGenNodeArg, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Param !== undefined) { - bodyParams["Param"] = input.Param; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Param !== undefined && { Param: input.Param }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1CodeGenNodeArgs = ( @@ -18456,229 +17739,178 @@ const serializeAws_json1_1CrawlerTargets = ( input: CrawlerTargets, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogTargets !== undefined) { - bodyParams["CatalogTargets"] = serializeAws_json1_1CatalogTargetList( - input.CatalogTargets, - context - ); - } - if (input.DynamoDBTargets !== undefined) { - bodyParams["DynamoDBTargets"] = serializeAws_json1_1DynamoDBTargetList( - input.DynamoDBTargets, - context - ); - } - if (input.JdbcTargets !== undefined) { - bodyParams["JdbcTargets"] = serializeAws_json1_1JdbcTargetList( - input.JdbcTargets, - context - ); - } - if (input.S3Targets !== undefined) { - bodyParams["S3Targets"] = serializeAws_json1_1S3TargetList( - input.S3Targets, - context - ); - } - return bodyParams; + 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.S3Targets !== undefined && { + S3Targets: serializeAws_json1_1S3TargetList(input.S3Targets, context) + }) + }; }; const serializeAws_json1_1CreateClassifierRequest = ( input: CreateClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CsvClassifier !== undefined) { - bodyParams[ - "CsvClassifier" - ] = serializeAws_json1_1CreateCsvClassifierRequest( - input.CsvClassifier, - context - ); - } - if (input.GrokClassifier !== undefined) { - bodyParams[ - "GrokClassifier" - ] = serializeAws_json1_1CreateGrokClassifierRequest( - input.GrokClassifier, - context - ); - } - if (input.JsonClassifier !== undefined) { - bodyParams[ - "JsonClassifier" - ] = serializeAws_json1_1CreateJsonClassifierRequest( - input.JsonClassifier, - context - ); - } - if (input.XMLClassifier !== undefined) { - bodyParams[ - "XMLClassifier" - ] = serializeAws_json1_1CreateXMLClassifierRequest( - input.XMLClassifier, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateCrawlerRequest = ( input: CreateCrawlerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classifiers !== undefined) { - bodyParams["Classifiers"] = serializeAws_json1_1ClassifierNameList( - input.Classifiers, - context - ); - } - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = input.Configuration; - } - if (input.CrawlerSecurityConfiguration !== undefined) { - bodyParams["CrawlerSecurityConfiguration"] = - input.CrawlerSecurityConfiguration; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.SchemaChangePolicy !== undefined) { - bodyParams["SchemaChangePolicy"] = serializeAws_json1_1SchemaChangePolicy( - input.SchemaChangePolicy, - context - ); - } - if (input.TablePrefix !== undefined) { - bodyParams["TablePrefix"] = input.TablePrefix; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1CrawlerTargets( - input.Targets, - context - ); - } - return bodyParams; + 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.Name !== undefined && { Name: input.Name }), + ...(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) + }) + }; }; const serializeAws_json1_1CreateCsvClassifierRequest = ( input: CreateCsvClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowSingleColumn !== undefined) { - bodyParams["AllowSingleColumn"] = input.AllowSingleColumn; - } - if (input.ContainsHeader !== undefined) { - bodyParams["ContainsHeader"] = input.ContainsHeader; - } - if (input.Delimiter !== undefined) { - bodyParams["Delimiter"] = input.Delimiter; - } - if (input.DisableValueTrimming !== undefined) { - bodyParams["DisableValueTrimming"] = input.DisableValueTrimming; - } - if (input.Header !== undefined) { - bodyParams["Header"] = serializeAws_json1_1CsvHeader(input.Header, context); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.QuoteSymbol !== undefined) { - bodyParams["QuoteSymbol"] = input.QuoteSymbol; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateGrokClassifierRequest = ( input: CreateGrokClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classification !== undefined) { - bodyParams["Classification"] = input.Classification; - } - if (input.CustomPatterns !== undefined) { - bodyParams["CustomPatterns"] = input.CustomPatterns; - } - if (input.GrokPattern !== undefined) { - bodyParams["GrokPattern"] = input.GrokPattern; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateJsonClassifierRequest = ( input: CreateJsonClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JsonPath !== undefined) { - bodyParams["JsonPath"] = input.JsonPath; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.JsonPath !== undefined && { JsonPath: input.JsonPath }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateScriptRequest = ( input: CreateScriptRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DagEdges !== undefined) { - bodyParams["DagEdges"] = serializeAws_json1_1DagEdges( - input.DagEdges, - context - ); - } - if (input.DagNodes !== undefined) { - bodyParams["DagNodes"] = serializeAws_json1_1DagNodes( - input.DagNodes, - context - ); - } - if (input.Language !== undefined) { - bodyParams["Language"] = input.Language; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateXMLClassifierRequest = ( input: CreateXMLClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classification !== undefined) { - bodyParams["Classification"] = input.Classification; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RowTag !== undefined) { - bodyParams["RowTag"] = input.RowTag; - } - return bodyParams; + return { + ...(input.Classification !== undefined && { + Classification: input.Classification + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RowTag !== undefined && { RowTag: input.RowTag }) + }; }; const serializeAws_json1_1CsvHeader = ( @@ -18706,33 +17938,27 @@ const serializeAws_json1_1DeleteClassifierRequest = ( input: DeleteClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteCrawlerRequest = ( input: DeleteCrawlerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DynamoDBTarget = ( input: DynamoDBTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - return bodyParams; + return { + ...(input.Path !== undefined && { Path: input.Path }) + }; }; const serializeAws_json1_1DynamoDBTargetList = ( @@ -18746,162 +17972,118 @@ const serializeAws_json1_1GetClassifierRequest = ( input: GetClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetClassifiersRequest = ( input: GetClassifiersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetCrawlerMetricsRequest = ( input: GetCrawlerMetricsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlerNameList !== undefined) { - bodyParams["CrawlerNameList"] = serializeAws_json1_1CrawlerNameList( - input.CrawlerNameList, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.CrawlerNameList !== undefined && { + CrawlerNameList: serializeAws_json1_1CrawlerNameList( + input.CrawlerNameList, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetCrawlerRequest = ( input: GetCrawlerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1GetCrawlersRequest = ( input: GetCrawlersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetDataflowGraphRequest = ( input: GetDataflowGraphRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PythonScript !== undefined) { - bodyParams["PythonScript"] = input.PythonScript; - } - return bodyParams; + return { + ...(input.PythonScript !== undefined && { + PythonScript: input.PythonScript + }) + }; }; const serializeAws_json1_1GetMappingRequest = ( input: GetMappingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Location !== undefined) { - bodyParams["Location"] = serializeAws_json1_1Location( - input.Location, - context - ); - } - if (input.Sinks !== undefined) { - bodyParams["Sinks"] = serializeAws_json1_1CatalogEntries( - input.Sinks, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = serializeAws_json1_1CatalogEntry( - input.Source, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetPlanRequest = ( input: GetPlanRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Language !== undefined) { - bodyParams["Language"] = input.Language; - } - if (input.Location !== undefined) { - bodyParams["Location"] = serializeAws_json1_1Location( - input.Location, - context - ); - } - if (input.Mapping !== undefined) { - bodyParams["Mapping"] = serializeAws_json1_1MappingList( - input.Mapping, - context - ); - } - if (input.Sinks !== undefined) { - bodyParams["Sinks"] = serializeAws_json1_1CatalogEntries( - input.Sinks, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = serializeAws_json1_1CatalogEntry( - input.Source, - context - ); - } - return bodyParams; + return { + ...(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) + }) + }; }; const serializeAws_json1_1JdbcTarget = ( input: JdbcTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionName !== undefined) { - bodyParams["ConnectionName"] = input.ConnectionName; - } - if (input.Exclusions !== undefined) { - bodyParams["Exclusions"] = serializeAws_json1_1PathList( - input.Exclusions, - context - ); - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - return bodyParams; + return { + ...(input.ConnectionName !== undefined && { + ConnectionName: input.ConnectionName + }), + ...(input.Exclusions !== undefined && { + Exclusions: serializeAws_json1_1PathList(input.Exclusions, context) + }), + ...(input.Path !== undefined && { Path: input.Path }) + }; }; const serializeAws_json1_1JdbcTargetList = ( @@ -18915,66 +18097,44 @@ const serializeAws_json1_1ListCrawlersRequest = ( input: ListCrawlersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagsMap(input.Tags, context); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagsMap(input.Tags, context) + }) + }; }; const serializeAws_json1_1Location = ( input: Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DynamoDB !== undefined) { - bodyParams["DynamoDB"] = serializeAws_json1_1CodeGenNodeArgs( - input.DynamoDB, - context - ); - } - if (input.Jdbc !== undefined) { - bodyParams["Jdbc"] = serializeAws_json1_1CodeGenNodeArgs( - input.Jdbc, - context - ); - } - if (input.S3 !== undefined) { - bodyParams["S3"] = serializeAws_json1_1CodeGenNodeArgs(input.S3, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1MappingEntry = ( input: MappingEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SourcePath !== undefined) { - bodyParams["SourcePath"] = input.SourcePath; - } - if (input.SourceTable !== undefined) { - bodyParams["SourceTable"] = input.SourceTable; - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - if (input.TargetPath !== undefined) { - bodyParams["TargetPath"] = input.TargetPath; - } - if (input.TargetTable !== undefined) { - bodyParams["TargetTable"] = input.TargetTable; - } - if (input.TargetType !== undefined) { - bodyParams["TargetType"] = input.TargetType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1MappingList = ( @@ -18995,17 +18155,12 @@ const serializeAws_json1_1S3Target = ( input: S3Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Exclusions !== undefined) { - bodyParams["Exclusions"] = serializeAws_json1_1PathList( - input.Exclusions, - context - ); - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - return bodyParams; + return { + ...(input.Exclusions !== undefined && { + Exclusions: serializeAws_json1_1PathList(input.Exclusions, context) + }), + ...(input.Path !== undefined && { Path: input.Path }) + }; }; const serializeAws_json1_1S3TargetList = ( @@ -19019,243 +18174,191 @@ const serializeAws_json1_1SchemaChangePolicy = ( input: SchemaChangePolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteBehavior !== undefined) { - bodyParams["DeleteBehavior"] = input.DeleteBehavior; - } - if (input.UpdateBehavior !== undefined) { - bodyParams["UpdateBehavior"] = input.UpdateBehavior; - } - return bodyParams; + return { + ...(input.DeleteBehavior !== undefined && { + DeleteBehavior: input.DeleteBehavior + }), + ...(input.UpdateBehavior !== undefined && { + UpdateBehavior: input.UpdateBehavior + }) + }; }; const serializeAws_json1_1StartCrawlerRequest = ( input: StartCrawlerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StartCrawlerScheduleRequest = ( input: StartCrawlerScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlerName !== undefined) { - bodyParams["CrawlerName"] = input.CrawlerName; - } - return bodyParams; + return { + ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }) + }; }; const serializeAws_json1_1StopCrawlerRequest = ( input: StopCrawlerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StopCrawlerScheduleRequest = ( input: StopCrawlerScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlerName !== undefined) { - bodyParams["CrawlerName"] = input.CrawlerName; - } - return bodyParams; + return { + ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }) + }; }; const serializeAws_json1_1UpdateClassifierRequest = ( input: UpdateClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CsvClassifier !== undefined) { - bodyParams[ - "CsvClassifier" - ] = serializeAws_json1_1UpdateCsvClassifierRequest( - input.CsvClassifier, - context - ); - } - if (input.GrokClassifier !== undefined) { - bodyParams[ - "GrokClassifier" - ] = serializeAws_json1_1UpdateGrokClassifierRequest( - input.GrokClassifier, - context - ); - } - if (input.JsonClassifier !== undefined) { - bodyParams[ - "JsonClassifier" - ] = serializeAws_json1_1UpdateJsonClassifierRequest( - input.JsonClassifier, - context - ); - } - if (input.XMLClassifier !== undefined) { - bodyParams[ - "XMLClassifier" - ] = serializeAws_json1_1UpdateXMLClassifierRequest( - input.XMLClassifier, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateCrawlerRequest = ( input: UpdateCrawlerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classifiers !== undefined) { - bodyParams["Classifiers"] = serializeAws_json1_1ClassifierNameList( - input.Classifiers, - context - ); - } - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = input.Configuration; - } - if (input.CrawlerSecurityConfiguration !== undefined) { - bodyParams["CrawlerSecurityConfiguration"] = - input.CrawlerSecurityConfiguration; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.SchemaChangePolicy !== undefined) { - bodyParams["SchemaChangePolicy"] = serializeAws_json1_1SchemaChangePolicy( - input.SchemaChangePolicy, - context - ); - } - if (input.TablePrefix !== undefined) { - bodyParams["TablePrefix"] = input.TablePrefix; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1CrawlerTargets( - input.Targets, - context - ); - } - return bodyParams; + 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.Name !== undefined && { Name: input.Name }), + ...(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) + }) + }; }; const serializeAws_json1_1UpdateCrawlerScheduleRequest = ( input: UpdateCrawlerScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlerName !== undefined) { - bodyParams["CrawlerName"] = input.CrawlerName; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - return bodyParams; + return { + ...(input.CrawlerName !== undefined && { CrawlerName: input.CrawlerName }), + ...(input.Schedule !== undefined && { Schedule: input.Schedule }) + }; }; const serializeAws_json1_1UpdateCsvClassifierRequest = ( input: UpdateCsvClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowSingleColumn !== undefined) { - bodyParams["AllowSingleColumn"] = input.AllowSingleColumn; - } - if (input.ContainsHeader !== undefined) { - bodyParams["ContainsHeader"] = input.ContainsHeader; - } - if (input.Delimiter !== undefined) { - bodyParams["Delimiter"] = input.Delimiter; - } - if (input.DisableValueTrimming !== undefined) { - bodyParams["DisableValueTrimming"] = input.DisableValueTrimming; - } - if (input.Header !== undefined) { - bodyParams["Header"] = serializeAws_json1_1CsvHeader(input.Header, context); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.QuoteSymbol !== undefined) { - bodyParams["QuoteSymbol"] = input.QuoteSymbol; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateGrokClassifierRequest = ( input: UpdateGrokClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classification !== undefined) { - bodyParams["Classification"] = input.Classification; - } - if (input.CustomPatterns !== undefined) { - bodyParams["CustomPatterns"] = input.CustomPatterns; - } - if (input.GrokPattern !== undefined) { - bodyParams["GrokPattern"] = input.GrokPattern; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateJsonClassifierRequest = ( input: UpdateJsonClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JsonPath !== undefined) { - bodyParams["JsonPath"] = input.JsonPath; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.JsonPath !== undefined && { JsonPath: input.JsonPath }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateXMLClassifierRequest = ( input: UpdateXMLClassifierRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Classification !== undefined) { - bodyParams["Classification"] = input.Classification; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RowTag !== undefined) { - bodyParams["RowTag"] = input.RowTag; - } - return bodyParams; + return { + ...(input.Classification !== undefined && { + Classification: input.Classification + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RowTag !== undefined && { RowTag: input.RowTag }) + }; }; const deserializeAws_json1_1GetTagsResponse = ( diff --git a/clients/client-greengrass/protocols/Aws_restJson1_1.ts b/clients/client-greengrass/protocols/Aws_restJson1_1.ts index 9685f12fb09b..2ea546d1c5ed 100644 --- a/clients/client-greengrass/protocols/Aws_restJson1_1.ts +++ b/clients/client-greengrass/protocols/Aws_restJson1_1.ts @@ -10611,623 +10611,498 @@ const serializeAws_restJson1_1ConnectivityInfo = ( input: ConnectivityInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HostAddress !== undefined) { - bodyParams["HostAddress"] = input.HostAddress; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Metadata !== undefined) { - bodyParams["Metadata"] = input.Metadata; - } - if (input.PortNumber !== undefined) { - bodyParams["PortNumber"] = input.PortNumber; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Connector = ( input: Connector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectorArn !== undefined) { - bodyParams["ConnectorArn"] = input.ConnectorArn; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_restJson1_1__mapOf__string( - input.Parameters, - context - ); - } - return bodyParams; + return { + ...(input.ConnectorArn !== undefined && { + ConnectorArn: input.ConnectorArn + }), + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Parameters !== undefined && { + Parameters: serializeAws_restJson1_1__mapOf__string( + input.Parameters, + context + ) + }) + }; }; const serializeAws_restJson1_1ConnectorDefinitionVersion = ( input: ConnectorDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Connectors !== undefined) { - bodyParams["Connectors"] = serializeAws_restJson1_1__listOfConnector( - input.Connectors, - context - ); - } - return bodyParams; + return { + ...(input.Connectors !== undefined && { + Connectors: serializeAws_restJson1_1__listOfConnector( + input.Connectors, + context + ) + }) + }; }; const serializeAws_restJson1_1Core = ( input: Core, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.SyncShadow !== undefined) { - bodyParams["SyncShadow"] = input.SyncShadow; - } - if (input.ThingArn !== undefined) { - bodyParams["ThingArn"] = input.ThingArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CoreDefinitionVersion = ( input: CoreDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Cores !== undefined) { - bodyParams["Cores"] = serializeAws_restJson1_1__listOfCore( - input.Cores, - context - ); - } - return bodyParams; + return { + ...(input.Cores !== undefined && { + Cores: serializeAws_restJson1_1__listOfCore(input.Cores, context) + }) + }; }; const serializeAws_restJson1_1Device = ( input: Device, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["CertificateArn"] = input.CertificateArn; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.SyncShadow !== undefined) { - bodyParams["SyncShadow"] = input.SyncShadow; - } - if (input.ThingArn !== undefined) { - bodyParams["ThingArn"] = input.ThingArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DeviceDefinitionVersion = ( input: DeviceDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Devices !== undefined) { - bodyParams["Devices"] = serializeAws_restJson1_1__listOfDevice( - input.Devices, - context - ); - } - return bodyParams; + return { + ...(input.Devices !== undefined && { + Devices: serializeAws_restJson1_1__listOfDevice(input.Devices, context) + }) + }; }; const serializeAws_restJson1_1Function = ( input: Function, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FunctionArn !== undefined) { - bodyParams["FunctionArn"] = input.FunctionArn; - } - if (input.FunctionConfiguration !== undefined) { - bodyParams[ - "FunctionConfiguration" - ] = serializeAws_restJson1_1FunctionConfiguration( - input.FunctionConfiguration, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.FunctionArn !== undefined && { FunctionArn: input.FunctionArn }), + ...(input.FunctionConfiguration !== undefined && { + FunctionConfiguration: serializeAws_restJson1_1FunctionConfiguration( + input.FunctionConfiguration, + context + ) + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_restJson1_1FunctionConfiguration = ( input: FunctionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncodingType !== undefined) { - bodyParams["EncodingType"] = input.EncodingType; - } - if (input.Environment !== undefined) { - bodyParams[ - "Environment" - ] = serializeAws_restJson1_1FunctionConfigurationEnvironment( - input.Environment, - context - ); - } - if (input.ExecArgs !== undefined) { - bodyParams["ExecArgs"] = input.ExecArgs; - } - if (input.Executable !== undefined) { - bodyParams["Executable"] = input.Executable; - } - if (input.MemorySize !== undefined) { - bodyParams["MemorySize"] = input.MemorySize; - } - if (input.Pinned !== undefined) { - bodyParams["Pinned"] = input.Pinned; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - return bodyParams; + return { + ...(input.EncodingType !== undefined && { + EncodingType: input.EncodingType + }), + ...(input.Environment !== undefined && { + Environment: serializeAws_restJson1_1FunctionConfigurationEnvironment( + 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 }) + }; }; const serializeAws_restJson1_1FunctionConfigurationEnvironment = ( input: FunctionConfigurationEnvironment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessSysfs !== undefined) { - bodyParams["AccessSysfs"] = input.AccessSysfs; - } - if (input.Execution !== undefined) { - bodyParams["Execution"] = serializeAws_restJson1_1FunctionExecutionConfig( - input.Execution, - context - ); - } - if (input.ResourceAccessPolicies !== undefined) { - bodyParams[ - "ResourceAccessPolicies" - ] = serializeAws_restJson1_1__listOfResourceAccessPolicy( - input.ResourceAccessPolicies, - context - ); - } - if (input.Variables !== undefined) { - bodyParams["Variables"] = serializeAws_restJson1_1__mapOf__string( - input.Variables, - context - ); - } - return bodyParams; + return { + ...(input.AccessSysfs !== undefined && { AccessSysfs: input.AccessSysfs }), + ...(input.Execution !== undefined && { + Execution: serializeAws_restJson1_1FunctionExecutionConfig( + input.Execution, + context + ) + }), + ...(input.ResourceAccessPolicies !== undefined && { + ResourceAccessPolicies: serializeAws_restJson1_1__listOfResourceAccessPolicy( + input.ResourceAccessPolicies, + context + ) + }), + ...(input.Variables !== undefined && { + Variables: serializeAws_restJson1_1__mapOf__string( + input.Variables, + context + ) + }) + }; }; const serializeAws_restJson1_1FunctionDefaultConfig = ( input: FunctionDefaultConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Execution !== undefined) { - bodyParams[ - "Execution" - ] = serializeAws_restJson1_1FunctionDefaultExecutionConfig( - input.Execution, - context - ); - } - return bodyParams; + return { + ...(input.Execution !== undefined && { + Execution: serializeAws_restJson1_1FunctionDefaultExecutionConfig( + input.Execution, + context + ) + }) + }; }; const serializeAws_restJson1_1FunctionDefaultExecutionConfig = ( input: FunctionDefaultExecutionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IsolationMode !== undefined) { - bodyParams["IsolationMode"] = input.IsolationMode; - } - if (input.RunAs !== undefined) { - bodyParams["RunAs"] = serializeAws_restJson1_1FunctionRunAsConfig( - input.RunAs, - context - ); - } - return bodyParams; + return { + ...(input.IsolationMode !== undefined && { + IsolationMode: input.IsolationMode + }), + ...(input.RunAs !== undefined && { + RunAs: serializeAws_restJson1_1FunctionRunAsConfig(input.RunAs, context) + }) + }; }; const serializeAws_restJson1_1FunctionDefinitionVersion = ( input: FunctionDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultConfig !== undefined) { - bodyParams["DefaultConfig"] = serializeAws_restJson1_1FunctionDefaultConfig( - input.DefaultConfig, - context - ); - } - if (input.Functions !== undefined) { - bodyParams["Functions"] = serializeAws_restJson1_1__listOfFunction( - input.Functions, - context - ); - } - return bodyParams; + return { + ...(input.DefaultConfig !== undefined && { + DefaultConfig: serializeAws_restJson1_1FunctionDefaultConfig( + input.DefaultConfig, + context + ) + }), + ...(input.Functions !== undefined && { + Functions: serializeAws_restJson1_1__listOfFunction( + input.Functions, + context + ) + }) + }; }; const serializeAws_restJson1_1FunctionExecutionConfig = ( input: FunctionExecutionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IsolationMode !== undefined) { - bodyParams["IsolationMode"] = input.IsolationMode; - } - if (input.RunAs !== undefined) { - bodyParams["RunAs"] = serializeAws_restJson1_1FunctionRunAsConfig( - input.RunAs, - context - ); - } - return bodyParams; + return { + ...(input.IsolationMode !== undefined && { + IsolationMode: input.IsolationMode + }), + ...(input.RunAs !== undefined && { + RunAs: serializeAws_restJson1_1FunctionRunAsConfig(input.RunAs, context) + }) + }; }; const serializeAws_restJson1_1FunctionRunAsConfig = ( input: FunctionRunAsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Gid !== undefined) { - bodyParams["Gid"] = input.Gid; - } - if (input.Uid !== undefined) { - bodyParams["Uid"] = input.Uid; - } - return bodyParams; + return { + ...(input.Gid !== undefined && { Gid: input.Gid }), + ...(input.Uid !== undefined && { Uid: input.Uid }) + }; }; const serializeAws_restJson1_1GroupOwnerSetting = ( input: GroupOwnerSetting, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoAddGroupOwner !== undefined) { - bodyParams["AutoAddGroupOwner"] = input.AutoAddGroupOwner; - } - if (input.GroupOwner !== undefined) { - bodyParams["GroupOwner"] = input.GroupOwner; - } - return bodyParams; + return { + ...(input.AutoAddGroupOwner !== undefined && { + AutoAddGroupOwner: input.AutoAddGroupOwner + }), + ...(input.GroupOwner !== undefined && { GroupOwner: input.GroupOwner }) + }; }; const serializeAws_restJson1_1GroupVersion = ( input: GroupVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectorDefinitionVersionArn !== undefined) { - bodyParams["ConnectorDefinitionVersionArn"] = - input.ConnectorDefinitionVersionArn; - } - if (input.CoreDefinitionVersionArn !== undefined) { - bodyParams["CoreDefinitionVersionArn"] = input.CoreDefinitionVersionArn; - } - if (input.DeviceDefinitionVersionArn !== undefined) { - bodyParams["DeviceDefinitionVersionArn"] = input.DeviceDefinitionVersionArn; - } - if (input.FunctionDefinitionVersionArn !== undefined) { - bodyParams["FunctionDefinitionVersionArn"] = - input.FunctionDefinitionVersionArn; - } - if (input.LoggerDefinitionVersionArn !== undefined) { - bodyParams["LoggerDefinitionVersionArn"] = input.LoggerDefinitionVersionArn; - } - if (input.ResourceDefinitionVersionArn !== undefined) { - bodyParams["ResourceDefinitionVersionArn"] = - input.ResourceDefinitionVersionArn; - } - if (input.SubscriptionDefinitionVersionArn !== undefined) { - bodyParams["SubscriptionDefinitionVersionArn"] = - input.SubscriptionDefinitionVersionArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1LocalDeviceResourceData = ( input: LocalDeviceResourceData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupOwnerSetting !== undefined) { - bodyParams["GroupOwnerSetting"] = serializeAws_restJson1_1GroupOwnerSetting( - input.GroupOwnerSetting, - context - ); - } - if (input.SourcePath !== undefined) { - bodyParams["SourcePath"] = input.SourcePath; - } - return bodyParams; + return { + ...(input.GroupOwnerSetting !== undefined && { + GroupOwnerSetting: serializeAws_restJson1_1GroupOwnerSetting( + input.GroupOwnerSetting, + context + ) + }), + ...(input.SourcePath !== undefined && { SourcePath: input.SourcePath }) + }; }; const serializeAws_restJson1_1LocalVolumeResourceData = ( input: LocalVolumeResourceData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationPath !== undefined) { - bodyParams["DestinationPath"] = input.DestinationPath; - } - if (input.GroupOwnerSetting !== undefined) { - bodyParams["GroupOwnerSetting"] = serializeAws_restJson1_1GroupOwnerSetting( - input.GroupOwnerSetting, - context - ); - } - if (input.SourcePath !== undefined) { - bodyParams["SourcePath"] = input.SourcePath; - } - return bodyParams; + return { + ...(input.DestinationPath !== undefined && { + DestinationPath: input.DestinationPath + }), + ...(input.GroupOwnerSetting !== undefined && { + GroupOwnerSetting: serializeAws_restJson1_1GroupOwnerSetting( + input.GroupOwnerSetting, + context + ) + }), + ...(input.SourcePath !== undefined && { SourcePath: input.SourcePath }) + }; }; const serializeAws_restJson1_1Logger = ( input: Logger, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Component !== undefined) { - bodyParams["Component"] = input.Component; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Level !== undefined) { - bodyParams["Level"] = input.Level; - } - if (input.Space !== undefined) { - bodyParams["Space"] = input.Space; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1LoggerDefinitionVersion = ( input: LoggerDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Loggers !== undefined) { - bodyParams["Loggers"] = serializeAws_restJson1_1__listOfLogger( - input.Loggers, - context - ); - } - return bodyParams; + return { + ...(input.Loggers !== undefined && { + Loggers: serializeAws_restJson1_1__listOfLogger(input.Loggers, context) + }) + }; }; const serializeAws_restJson1_1Resource = ( input: Resource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ResourceDataContainer !== undefined) { - bodyParams[ - "ResourceDataContainer" - ] = serializeAws_restJson1_1ResourceDataContainer( - input.ResourceDataContainer, - context - ); - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ResourceDataContainer !== undefined && { + ResourceDataContainer: serializeAws_restJson1_1ResourceDataContainer( + input.ResourceDataContainer, + context + ) + }) + }; }; const serializeAws_restJson1_1ResourceAccessPolicy = ( input: ResourceAccessPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Permission !== undefined) { - bodyParams["Permission"] = input.Permission; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.Permission !== undefined && { Permission: input.Permission }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_restJson1_1ResourceDataContainer = ( input: ResourceDataContainer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocalDeviceResourceData !== undefined) { - bodyParams[ - "LocalDeviceResourceData" - ] = serializeAws_restJson1_1LocalDeviceResourceData( - input.LocalDeviceResourceData, - context - ); - } - if (input.LocalVolumeResourceData !== undefined) { - bodyParams[ - "LocalVolumeResourceData" - ] = serializeAws_restJson1_1LocalVolumeResourceData( - input.LocalVolumeResourceData, - context - ); - } - if (input.S3MachineLearningModelResourceData !== undefined) { - bodyParams[ - "S3MachineLearningModelResourceData" - ] = serializeAws_restJson1_1S3MachineLearningModelResourceData( - input.S3MachineLearningModelResourceData, - context - ); - } - if (input.SageMakerMachineLearningModelResourceData !== undefined) { - bodyParams[ - "SageMakerMachineLearningModelResourceData" - ] = serializeAws_restJson1_1SageMakerMachineLearningModelResourceData( - input.SageMakerMachineLearningModelResourceData, - context - ); - } - if (input.SecretsManagerSecretResourceData !== undefined) { - bodyParams[ - "SecretsManagerSecretResourceData" - ] = serializeAws_restJson1_1SecretsManagerSecretResourceData( - input.SecretsManagerSecretResourceData, - context - ); - } - return bodyParams; + return { + ...(input.LocalDeviceResourceData !== undefined && { + LocalDeviceResourceData: serializeAws_restJson1_1LocalDeviceResourceData( + input.LocalDeviceResourceData, + context + ) + }), + ...(input.LocalVolumeResourceData !== undefined && { + LocalVolumeResourceData: serializeAws_restJson1_1LocalVolumeResourceData( + input.LocalVolumeResourceData, + context + ) + }), + ...(input.S3MachineLearningModelResourceData !== undefined && { + S3MachineLearningModelResourceData: serializeAws_restJson1_1S3MachineLearningModelResourceData( + input.S3MachineLearningModelResourceData, + context + ) + }), + ...(input.SageMakerMachineLearningModelResourceData !== undefined && { + SageMakerMachineLearningModelResourceData: serializeAws_restJson1_1SageMakerMachineLearningModelResourceData( + input.SageMakerMachineLearningModelResourceData, + context + ) + }), + ...(input.SecretsManagerSecretResourceData !== undefined && { + SecretsManagerSecretResourceData: serializeAws_restJson1_1SecretsManagerSecretResourceData( + input.SecretsManagerSecretResourceData, + context + ) + }) + }; }; const serializeAws_restJson1_1ResourceDefinitionVersion = ( input: ResourceDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_restJson1_1__listOfResource( - input.Resources, - context - ); - } - return bodyParams; + return { + ...(input.Resources !== undefined && { + Resources: serializeAws_restJson1_1__listOfResource( + input.Resources, + context + ) + }) + }; }; const serializeAws_restJson1_1ResourceDownloadOwnerSetting = ( input: ResourceDownloadOwnerSetting, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupOwner !== undefined) { - bodyParams["GroupOwner"] = input.GroupOwner; - } - if (input.GroupPermission !== undefined) { - bodyParams["GroupPermission"] = input.GroupPermission; - } - return bodyParams; + return { + ...(input.GroupOwner !== undefined && { GroupOwner: input.GroupOwner }), + ...(input.GroupPermission !== undefined && { + GroupPermission: input.GroupPermission + }) + }; }; const serializeAws_restJson1_1S3MachineLearningModelResourceData = ( input: S3MachineLearningModelResourceData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationPath !== undefined) { - bodyParams["DestinationPath"] = input.DestinationPath; - } - if (input.OwnerSetting !== undefined) { - bodyParams[ - "OwnerSetting" - ] = serializeAws_restJson1_1ResourceDownloadOwnerSetting( - input.OwnerSetting, - context - ); - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.DestinationPath !== undefined && { + DestinationPath: input.DestinationPath + }), + ...(input.OwnerSetting !== undefined && { + OwnerSetting: serializeAws_restJson1_1ResourceDownloadOwnerSetting( + input.OwnerSetting, + context + ) + }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_restJson1_1SageMakerMachineLearningModelResourceData = ( input: SageMakerMachineLearningModelResourceData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationPath !== undefined) { - bodyParams["DestinationPath"] = input.DestinationPath; - } - if (input.OwnerSetting !== undefined) { - bodyParams[ - "OwnerSetting" - ] = serializeAws_restJson1_1ResourceDownloadOwnerSetting( - input.OwnerSetting, - context - ); - } - if (input.SageMakerJobArn !== undefined) { - bodyParams["SageMakerJobArn"] = input.SageMakerJobArn; - } - return bodyParams; + return { + ...(input.DestinationPath !== undefined && { + DestinationPath: input.DestinationPath + }), + ...(input.OwnerSetting !== undefined && { + OwnerSetting: serializeAws_restJson1_1ResourceDownloadOwnerSetting( + input.OwnerSetting, + context + ) + }), + ...(input.SageMakerJobArn !== undefined && { + SageMakerJobArn: input.SageMakerJobArn + }) + }; }; const serializeAws_restJson1_1SecretsManagerSecretResourceData = ( input: SecretsManagerSecretResourceData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ARN !== undefined) { - bodyParams["ARN"] = input.ARN; - } - if (input.AdditionalStagingLabelsToDownload !== undefined) { - bodyParams[ - "AdditionalStagingLabelsToDownload" - ] = serializeAws_restJson1_1__listOf__string( - input.AdditionalStagingLabelsToDownload, - context - ); - } - return bodyParams; + return { + ...(input.ARN !== undefined && { ARN: input.ARN }), + ...(input.AdditionalStagingLabelsToDownload !== undefined && { + AdditionalStagingLabelsToDownload: serializeAws_restJson1_1__listOf__string( + input.AdditionalStagingLabelsToDownload, + context + ) + }) + }; }; const serializeAws_restJson1_1Subscription = ( input: Subscription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = input.Subject; - } - if (input.Target !== undefined) { - bodyParams["Target"] = input.Target; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1SubscriptionDefinitionVersion = ( input: SubscriptionDefinitionVersion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Subscriptions !== undefined) { - bodyParams["Subscriptions"] = serializeAws_restJson1_1__listOfSubscription( - input.Subscriptions, - context - ); - } - return bodyParams; + return { + ...(input.Subscriptions !== undefined && { + Subscriptions: serializeAws_restJson1_1__listOfSubscription( + input.Subscriptions, + context + ) + }) + }; }; const serializeAws_restJson1_1Tags = ( diff --git a/clients/client-groundstation/protocols/Aws_restJson1_1.ts b/clients/client-groundstation/protocols/Aws_restJson1_1.ts index 669e965353ce..d5031d953ec6 100644 --- a/clients/client-groundstation/protocols/Aws_restJson1_1.ts +++ b/clients/client-groundstation/protocols/Aws_restJson1_1.ts @@ -3494,62 +3494,57 @@ const serializeAws_restJson1_1AntennaDownlinkConfig = ( input: AntennaDownlinkConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.spectrumConfig !== undefined) { - bodyParams["spectrumConfig"] = serializeAws_restJson1_1SpectrumConfig( - input.spectrumConfig, - context - ); - } - return bodyParams; + return { + ...(input.spectrumConfig !== undefined && { + spectrumConfig: serializeAws_restJson1_1SpectrumConfig( + input.spectrumConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1AntennaDownlinkDemodDecodeConfig = ( input: AntennaDownlinkDemodDecodeConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.decodeConfig !== undefined) { - bodyParams["decodeConfig"] = serializeAws_restJson1_1DecodeConfig( - input.decodeConfig, - context - ); - } - if (input.demodulationConfig !== undefined) { - bodyParams[ - "demodulationConfig" - ] = serializeAws_restJson1_1DemodulationConfig( - input.demodulationConfig, - context - ); - } - if (input.spectrumConfig !== undefined) { - bodyParams["spectrumConfig"] = serializeAws_restJson1_1SpectrumConfig( - input.spectrumConfig, - context - ); - } - return bodyParams; + return { + ...(input.decodeConfig !== undefined && { + decodeConfig: serializeAws_restJson1_1DecodeConfig( + input.decodeConfig, + context + ) + }), + ...(input.demodulationConfig !== undefined && { + demodulationConfig: serializeAws_restJson1_1DemodulationConfig( + input.demodulationConfig, + context + ) + }), + ...(input.spectrumConfig !== undefined && { + spectrumConfig: serializeAws_restJson1_1SpectrumConfig( + input.spectrumConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1AntennaUplinkConfig = ( input: AntennaUplinkConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.spectrumConfig !== undefined) { - bodyParams["spectrumConfig"] = serializeAws_restJson1_1UplinkSpectrumConfig( - input.spectrumConfig, - context - ); - } - if (input.targetEirp !== undefined) { - bodyParams["targetEirp"] = serializeAws_restJson1_1Eirp( - input.targetEirp, - context - ); - } - return bodyParams; + return { + ...(input.spectrumConfig !== undefined && { + spectrumConfig: serializeAws_restJson1_1UplinkSpectrumConfig( + input.spectrumConfig, + context + ) + }), + ...(input.targetEirp !== undefined && { + targetEirp: serializeAws_restJson1_1Eirp(input.targetEirp, context) + }) + }; }; const serializeAws_restJson1_1ConfigTypeData = ( @@ -3593,73 +3588,66 @@ const serializeAws_restJson1_1DataflowEndpoint = ( input: DataflowEndpoint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.address !== undefined) { - bodyParams["address"] = serializeAws_restJson1_1SocketAddress( - input.address, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.address !== undefined && { + address: serializeAws_restJson1_1SocketAddress(input.address, context) + }), + ...(input.name !== undefined && { name: input.name }), + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_restJson1_1DataflowEndpointConfig = ( input: DataflowEndpointConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataflowEndpointName !== undefined) { - bodyParams["dataflowEndpointName"] = input.dataflowEndpointName; - } - return bodyParams; + return { + ...(input.dataflowEndpointName !== undefined && { + dataflowEndpointName: input.dataflowEndpointName + }) + }; }; const serializeAws_restJson1_1DecodeConfig = ( input: DecodeConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.unvalidatedJSON !== undefined) { - bodyParams["unvalidatedJSON"] = input.unvalidatedJSON; - } - return bodyParams; + return { + ...(input.unvalidatedJSON !== undefined && { + unvalidatedJSON: input.unvalidatedJSON + }) + }; }; const serializeAws_restJson1_1DemodulationConfig = ( input: DemodulationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.unvalidatedJSON !== undefined) { - bodyParams["unvalidatedJSON"] = input.unvalidatedJSON; - } - return bodyParams; + return { + ...(input.unvalidatedJSON !== undefined && { + unvalidatedJSON: input.unvalidatedJSON + }) + }; }; const serializeAws_restJson1_1EndpointDetails = ( input: EndpointDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endpoint !== undefined) { - bodyParams["endpoint"] = serializeAws_restJson1_1DataflowEndpoint( - input.endpoint, - context - ); - } - if (input.securityDetails !== undefined) { - bodyParams["securityDetails"] = serializeAws_restJson1_1SecurityDetails( - input.securityDetails, - context - ); - } - return bodyParams; + return { + ...(input.endpoint !== undefined && { + endpoint: serializeAws_restJson1_1DataflowEndpoint( + input.endpoint, + context + ) + }), + ...(input.securityDetails !== undefined && { + securityDetails: serializeAws_restJson1_1SecurityDetails( + input.securityDetails, + context + ) + }) + }; }; const serializeAws_restJson1_1EndpointDetailsList = ( @@ -3682,92 +3670,69 @@ const serializeAws_restJson1_1TrackingConfig = ( input: TrackingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.autotrack !== undefined) { - bodyParams["autotrack"] = input.autotrack; - } - return bodyParams; + return { + ...(input.autotrack !== undefined && { autotrack: input.autotrack }) + }; }; const serializeAws_restJson1_1UplinkEchoConfig = ( input: UplinkEchoConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.antennaUplinkConfigArn !== undefined) { - bodyParams["antennaUplinkConfigArn"] = input.antennaUplinkConfigArn; - } - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - return bodyParams; + return { + ...(input.antennaUplinkConfigArn !== undefined && { + antennaUplinkConfigArn: input.antennaUplinkConfigArn + }), + ...(input.enabled !== undefined && { enabled: input.enabled }) + }; }; const serializeAws_restJson1_1Eirp = ( input: Eirp, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.units !== undefined) { - bodyParams["units"] = input.units; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.units !== undefined && { units: input.units }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1Frequency = ( input: Frequency, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.units !== undefined) { - bodyParams["units"] = input.units; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.units !== undefined && { units: input.units }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1FrequencyBandwidth = ( input: FrequencyBandwidth, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.units !== undefined) { - bodyParams["units"] = input.units; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.units !== undefined && { units: input.units }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1SecurityDetails = ( input: SecurityDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.securityGroupIds !== undefined) { - bodyParams[ - "securityGroupIds" - ] = serializeAws_restJson1_1SecurityGroupIdList( - input.securityGroupIds, - context - ); - } - if (input.subnetIds !== undefined) { - bodyParams["subnetIds"] = serializeAws_restJson1_1SubnetList( - input.subnetIds, - context - ); - } - return bodyParams; + return { + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.securityGroupIds !== undefined && { + securityGroupIds: serializeAws_restJson1_1SecurityGroupIdList( + input.securityGroupIds, + context + ) + }), + ...(input.subnetIds !== undefined && { + subnetIds: serializeAws_restJson1_1SubnetList(input.subnetIds, context) + }) + }; }; const serializeAws_restJson1_1SecurityGroupIdList = ( @@ -3781,37 +3746,33 @@ const serializeAws_restJson1_1SocketAddress = ( input: SocketAddress, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.port !== undefined) { - bodyParams["port"] = input.port; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.port !== undefined && { port: input.port }) + }; }; const serializeAws_restJson1_1SpectrumConfig = ( input: SpectrumConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bandwidth !== undefined) { - bodyParams["bandwidth"] = serializeAws_restJson1_1FrequencyBandwidth( - input.bandwidth, - context - ); - } - if (input.centerFrequency !== undefined) { - bodyParams["centerFrequency"] = serializeAws_restJson1_1Frequency( - input.centerFrequency, - context - ); - } - if (input.polarization !== undefined) { - bodyParams["polarization"] = input.polarization; - } - return bodyParams; + return { + ...(input.bandwidth !== undefined && { + bandwidth: serializeAws_restJson1_1FrequencyBandwidth( + input.bandwidth, + context + ) + }), + ...(input.centerFrequency !== undefined && { + centerFrequency: serializeAws_restJson1_1Frequency( + input.centerFrequency, + context + ) + }), + ...(input.polarization !== undefined && { + polarization: input.polarization + }) + }; }; const serializeAws_restJson1_1SubnetList = ( @@ -3835,17 +3796,17 @@ const serializeAws_restJson1_1UplinkSpectrumConfig = ( input: UplinkSpectrumConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.centerFrequency !== undefined) { - bodyParams["centerFrequency"] = serializeAws_restJson1_1Frequency( - input.centerFrequency, - context - ); - } - if (input.polarization !== undefined) { - bodyParams["polarization"] = input.polarization; - } - return bodyParams; + return { + ...(input.centerFrequency !== undefined && { + centerFrequency: serializeAws_restJson1_1Frequency( + input.centerFrequency, + context + ) + }), + ...(input.polarization !== undefined && { + polarization: input.polarization + }) + }; }; const deserializeAws_restJson1_1AntennaDownlinkConfig = ( diff --git a/clients/client-guardduty/protocols/Aws_restJson1_1.ts b/clients/client-guardduty/protocols/Aws_restJson1_1.ts index 02addad26eac..224de38843df 100644 --- a/clients/client-guardduty/protocols/Aws_restJson1_1.ts +++ b/clients/client-guardduty/protocols/Aws_restJson1_1.ts @@ -6198,14 +6198,10 @@ const serializeAws_restJson1_1AccountDetail = ( input: AccountDetail, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["accountId"] = input.AccountId; - } - if (input.Email !== undefined) { - bodyParams["email"] = input.Email; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { accountId: input.AccountId }), + ...(input.Email !== undefined && { email: input.Email }) + }; }; const serializeAws_restJson1_1AccountDetails = ( @@ -6228,50 +6224,32 @@ const serializeAws_restJson1_1Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Eq !== undefined) { - bodyParams["eq"] = serializeAws_restJson1_1Eq(input.Eq, context); - } - if (input.Equals !== undefined) { - bodyParams["equals"] = serializeAws_restJson1_1Equals( - input.Equals, - context - ); - } - if (input.GreaterThan !== undefined) { - bodyParams["greaterThan"] = input.GreaterThan; - } - if (input.GreaterThanOrEqual !== undefined) { - bodyParams["greaterThanOrEqual"] = input.GreaterThanOrEqual; - } - if (input.Gt !== undefined) { - bodyParams["gt"] = input.Gt; - } - if (input.Gte !== undefined) { - bodyParams["gte"] = input.Gte; - } - if (input.LessThan !== undefined) { - bodyParams["lessThan"] = input.LessThan; - } - if (input.LessThanOrEqual !== undefined) { - bodyParams["lessThanOrEqual"] = input.LessThanOrEqual; - } - if (input.Lt !== undefined) { - bodyParams["lt"] = input.Lt; - } - if (input.Lte !== undefined) { - bodyParams["lte"] = input.Lte; - } - if (input.Neq !== undefined) { - bodyParams["neq"] = serializeAws_restJson1_1Neq(input.Neq, context); - } - if (input.NotEquals !== undefined) { - bodyParams["notEquals"] = serializeAws_restJson1_1NotEquals( - input.NotEquals, - context - ); - } - return bodyParams; + return { + ...(input.Eq !== undefined && { + eq: serializeAws_restJson1_1Eq(input.Eq, context) + }), + ...(input.Equals !== undefined && { + equals: serializeAws_restJson1_1Equals(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_restJson1_1Neq(input.Neq, context) + }), + ...(input.NotEquals !== undefined && { + notEquals: serializeAws_restJson1_1NotEquals(input.NotEquals, context) + }) + }; }; const serializeAws_restJson1_1Criterion = ( @@ -6288,14 +6266,12 @@ const serializeAws_restJson1_1DestinationProperties = ( input: DestinationProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationArn !== undefined) { - bodyParams["destinationArn"] = input.DestinationArn; - } - if (input.KmsKeyArn !== undefined) { - bodyParams["kmsKeyArn"] = input.KmsKeyArn; - } - return bodyParams; + return { + ...(input.DestinationArn !== undefined && { + destinationArn: input.DestinationArn + }), + ...(input.KmsKeyArn !== undefined && { kmsKeyArn: input.KmsKeyArn }) + }; }; const serializeAws_restJson1_1Eq = ( @@ -6316,14 +6292,11 @@ const serializeAws_restJson1_1FindingCriteria = ( input: FindingCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Criterion !== undefined) { - bodyParams["criterion"] = serializeAws_restJson1_1Criterion( - input.Criterion, - context - ); - } - return bodyParams; + return { + ...(input.Criterion !== undefined && { + criterion: serializeAws_restJson1_1Criterion(input.Criterion, context) + }) + }; }; const serializeAws_restJson1_1FindingIds = ( @@ -6365,14 +6338,12 @@ const serializeAws_restJson1_1SortCriteria = ( input: SortCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["attributeName"] = input.AttributeName; - } - if (input.OrderBy !== undefined) { - bodyParams["orderBy"] = input.OrderBy; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + attributeName: input.AttributeName + }), + ...(input.OrderBy !== undefined && { orderBy: input.OrderBy }) + }; }; const serializeAws_restJson1_1TagMap = ( diff --git a/clients/client-health/protocols/Aws_json1_1.ts b/clients/client-health/protocols/Aws_json1_1.ts index c92d3cc3d110..84fe200396da 100644 --- a/clients/client-health/protocols/Aws_json1_1.ts +++ b/clients/client-health/protocols/Aws_json1_1.ts @@ -1322,207 +1322,138 @@ const serializeAws_json1_1DescribeAffectedAccountsForOrganizationRequest = ( input: DescribeAffectedAccountsForOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventArn !== undefined) { - bodyParams["eventArn"] = input.eventArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.eventArn !== undefined && { eventArn: input.eventArn }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1DescribeAffectedEntitiesForOrganizationRequest = ( input: DescribeAffectedEntitiesForOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.organizationEntityFilters !== undefined) { - bodyParams[ - "organizationEntityFilters" - ] = serializeAws_json1_1OrganizationEntityFiltersList( - input.organizationEntityFilters, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeAffectedEntitiesRequest = ( input: DescribeAffectedEntitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1EntityFilter( - input.filter, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEntityAggregatesRequest = ( input: DescribeEntityAggregatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventArns !== undefined) { - bodyParams["eventArns"] = serializeAws_json1_1EventArnsList( - input.eventArns, - context - ); - } - return bodyParams; + return { + ...(input.eventArns !== undefined && { + eventArns: serializeAws_json1_1EventArnsList(input.eventArns, context) + }) + }; }; const serializeAws_json1_1DescribeEventAggregatesRequest = ( input: DescribeEventAggregatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.aggregateField !== undefined) { - bodyParams["aggregateField"] = input.aggregateField; - } - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1EventFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEventDetailsForOrganizationRequest = ( input: DescribeEventDetailsForOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.organizationEventDetailFilters !== undefined) { - bodyParams[ - "organizationEventDetailFilters" - ] = serializeAws_json1_1OrganizationEventDetailFiltersList( - input.organizationEventDetailFilters, - context - ); - } - return bodyParams; + return { + ...(input.locale !== undefined && { locale: input.locale }), + ...(input.organizationEventDetailFilters !== undefined && { + organizationEventDetailFilters: serializeAws_json1_1OrganizationEventDetailFiltersList( + input.organizationEventDetailFilters, + context + ) + }) + }; }; const serializeAws_json1_1DescribeEventDetailsRequest = ( input: DescribeEventDetailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventArns !== undefined) { - bodyParams["eventArns"] = serializeAws_json1_1eventArnList( - input.eventArns, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - return bodyParams; + return { + ...(input.eventArns !== undefined && { + eventArns: serializeAws_json1_1eventArnList(input.eventArns, context) + }), + ...(input.locale !== undefined && { locale: input.locale }) + }; }; const serializeAws_json1_1DescribeEventTypesRequest = ( input: DescribeEventTypesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1EventTypeFilter( - input.filter, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEventsForOrganizationRequest = ( input: DescribeEventsForOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1OrganizationEventFilter( - input.filter, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEventsRequest = ( input: DescribeEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1EventFilter( - input.filter, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EventArnsList = ( @@ -1554,154 +1485,127 @@ const serializeAws_json1_1DateTimeRange = ( input: DateTimeRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.from !== undefined) { - bodyParams["from"] = Math.round(input.from.getTime() / 1000); - } - if (input.to !== undefined) { - bodyParams["to"] = Math.round(input.to.getTime() / 1000); - } - return bodyParams; + return { + ...(input.from !== undefined && { + from: Math.round(input.from.getTime() / 1000) + }), + ...(input.to !== undefined && { to: Math.round(input.to.getTime() / 1000) }) + }; }; const serializeAws_json1_1EntityFilter = ( input: EntityFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.entityArns !== undefined) { - bodyParams["entityArns"] = serializeAws_json1_1entityArnList( - input.entityArns, - context - ); - } - if (input.entityValues !== undefined) { - bodyParams["entityValues"] = serializeAws_json1_1entityValueList( - input.entityValues, - context - ); - } - if (input.eventArns !== undefined) { - bodyParams["eventArns"] = serializeAws_json1_1eventArnList( - input.eventArns, - context - ); - } - if (input.lastUpdatedTimes !== undefined) { - bodyParams["lastUpdatedTimes"] = serializeAws_json1_1dateTimeRangeList( - input.lastUpdatedTimes, - context - ); - } - if (input.statusCodes !== undefined) { - bodyParams["statusCodes"] = serializeAws_json1_1entityStatusCodeList( - input.statusCodes, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1tagFilter(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1EventAccountFilter = ( input: EventAccountFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsAccountId !== undefined) { - bodyParams["awsAccountId"] = input.awsAccountId; - } - if (input.eventArn !== undefined) { - bodyParams["eventArn"] = input.eventArn; - } - return bodyParams; + return { + ...(input.awsAccountId !== undefined && { + awsAccountId: input.awsAccountId + }), + ...(input.eventArn !== undefined && { eventArn: input.eventArn }) + }; }; const serializeAws_json1_1EventFilter = ( input: EventFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.availabilityZones !== undefined) { - bodyParams["availabilityZones"] = serializeAws_json1_1availabilityZones( - input.availabilityZones, - context - ); - } - if (input.endTimes !== undefined) { - bodyParams["endTimes"] = serializeAws_json1_1dateTimeRangeList( - input.endTimes, - context - ); - } - if (input.entityArns !== undefined) { - bodyParams["entityArns"] = serializeAws_json1_1entityArnList( - input.entityArns, - context - ); - } - if (input.entityValues !== undefined) { - bodyParams["entityValues"] = serializeAws_json1_1entityValueList( - input.entityValues, - context - ); - } - if (input.eventArns !== undefined) { - bodyParams["eventArns"] = serializeAws_json1_1eventArnList( - input.eventArns, - context - ); - } - if (input.eventStatusCodes !== undefined) { - bodyParams["eventStatusCodes"] = serializeAws_json1_1eventStatusCodeList( - input.eventStatusCodes, - context - ); - } - if (input.eventTypeCategories !== undefined) { - bodyParams[ - "eventTypeCategories" - ] = serializeAws_json1_1eventTypeCategoryList( - input.eventTypeCategories, - context - ); - } - if (input.eventTypeCodes !== undefined) { - bodyParams["eventTypeCodes"] = serializeAws_json1_1eventTypeList( - input.eventTypeCodes, - context - ); - } - if (input.lastUpdatedTimes !== undefined) { - bodyParams["lastUpdatedTimes"] = serializeAws_json1_1dateTimeRangeList( - input.lastUpdatedTimes, - context - ); - } - if (input.regions !== undefined) { - bodyParams["regions"] = serializeAws_json1_1regionList( - input.regions, - context - ); - } - if (input.services !== undefined) { - bodyParams["services"] = serializeAws_json1_1serviceList( - input.services, - context - ); - } - if (input.startTimes !== undefined) { - bodyParams["startTimes"] = serializeAws_json1_1dateTimeRangeList( - input.startTimes, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1tagFilter(input.tags, context); - } - return bodyParams; + 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_1eventTypeCategoryList( + input.eventTypeCategories, + context + ) + }), + ...(input.eventTypeCodes !== undefined && { + eventTypeCodes: serializeAws_json1_1eventTypeList( + 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) + }) + }; }; const serializeAws_json1_1EventTypeCategoryList = ( @@ -1722,104 +1626,82 @@ const serializeAws_json1_1EventTypeFilter = ( input: EventTypeFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventTypeCategories !== undefined) { - bodyParams[ - "eventTypeCategories" - ] = serializeAws_json1_1EventTypeCategoryList( - input.eventTypeCategories, - context - ); - } - if (input.eventTypeCodes !== undefined) { - bodyParams["eventTypeCodes"] = serializeAws_json1_1EventTypeCodeList( - input.eventTypeCodes, - context - ); - } - if (input.services !== undefined) { - bodyParams["services"] = serializeAws_json1_1serviceList( - input.services, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1OrganizationEventFilter = ( input: OrganizationEventFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsAccountIds !== undefined) { - bodyParams["awsAccountIds"] = serializeAws_json1_1awsAccountIdsList( - input.awsAccountIds, - context - ); - } - if (input.endTime !== undefined) { - bodyParams["endTime"] = serializeAws_json1_1DateTimeRange( - input.endTime, - context - ); - } - if (input.entityArns !== undefined) { - bodyParams["entityArns"] = serializeAws_json1_1entityArnList( - input.entityArns, - context - ); - } - if (input.entityValues !== undefined) { - bodyParams["entityValues"] = serializeAws_json1_1entityValueList( - input.entityValues, - context - ); - } - if (input.eventStatusCodes !== undefined) { - bodyParams["eventStatusCodes"] = serializeAws_json1_1eventStatusCodeList( - input.eventStatusCodes, - context - ); - } - if (input.eventTypeCategories !== undefined) { - bodyParams[ - "eventTypeCategories" - ] = serializeAws_json1_1eventTypeCategoryList( - input.eventTypeCategories, - context - ); - } - if (input.eventTypeCodes !== undefined) { - bodyParams["eventTypeCodes"] = serializeAws_json1_1eventTypeList( - input.eventTypeCodes, - context - ); - } - if (input.lastUpdatedTime !== undefined) { - bodyParams["lastUpdatedTime"] = serializeAws_json1_1DateTimeRange( - input.lastUpdatedTime, - context - ); - } - if (input.regions !== undefined) { - bodyParams["regions"] = serializeAws_json1_1regionList( - input.regions, - context - ); - } - if (input.services !== undefined) { - bodyParams["services"] = serializeAws_json1_1serviceList( - input.services, - context - ); - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = serializeAws_json1_1DateTimeRange( - input.startTime, - context - ); - } - return bodyParams; + 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_1eventTypeCategoryList( + input.eventTypeCategories, + context + ) + }), + ...(input.eventTypeCodes !== undefined && { + eventTypeCodes: serializeAws_json1_1eventTypeList( + 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) + }) + }; }; const serializeAws_json1_1dateTimeRangeList = ( diff --git a/clients/client-imagebuilder/protocols/Aws_restJson1_1.ts b/clients/client-imagebuilder/protocols/Aws_restJson1_1.ts index 67e74aa921b0..72bc4389d137 100644 --- a/clients/client-imagebuilder/protocols/Aws_restJson1_1.ts +++ b/clients/client-imagebuilder/protocols/Aws_restJson1_1.ts @@ -7857,28 +7857,19 @@ const serializeAws_restJson1_1AmiDistributionConfiguration = ( input: AmiDistributionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.amiTags !== undefined) { - bodyParams["amiTags"] = serializeAws_restJson1_1TagMap( - input.amiTags, - context - ); - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.launchPermission !== undefined) { - bodyParams[ - "launchPermission" - ] = serializeAws_restJson1_1LaunchPermissionConfiguration( - input.launchPermission, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.amiTags !== undefined && { + amiTags: serializeAws_restJson1_1TagMap(input.amiTags, context) + }), + ...(input.description !== undefined && { description: input.description }), + ...(input.launchPermission !== undefined && { + launchPermission: serializeAws_restJson1_1LaunchPermissionConfiguration( + input.launchPermission, + context + ) + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1ArnList = ( @@ -7892,11 +7883,11 @@ const serializeAws_restJson1_1ComponentConfiguration = ( input: ComponentConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.componentArn !== undefined) { - bodyParams["componentArn"] = input.componentArn; - } - return bodyParams; + return { + ...(input.componentArn !== undefined && { + componentArn: input.componentArn + }) + }; }; const serializeAws_restJson1_1ComponentConfigurationList = ( @@ -7912,25 +7903,21 @@ const serializeAws_restJson1_1Distribution = ( input: Distribution, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.amiDistributionConfiguration !== undefined) { - bodyParams[ - "amiDistributionConfiguration" - ] = serializeAws_restJson1_1AmiDistributionConfiguration( - input.amiDistributionConfiguration, - context - ); - } - if (input.licenseConfigurationArns !== undefined) { - bodyParams["licenseConfigurationArns"] = serializeAws_restJson1_1ArnList( - input.licenseConfigurationArns, - context - ); - } - if (input.region !== undefined) { - bodyParams["region"] = input.region; - } - return bodyParams; + return { + ...(input.amiDistributionConfiguration !== undefined && { + amiDistributionConfiguration: serializeAws_restJson1_1AmiDistributionConfiguration( + input.amiDistributionConfiguration, + context + ) + }), + ...(input.licenseConfigurationArns !== undefined && { + licenseConfigurationArns: serializeAws_restJson1_1ArnList( + input.licenseConfigurationArns, + context + ) + }), + ...(input.region !== undefined && { region: input.region }) + }; }; const serializeAws_restJson1_1DistributionList = ( @@ -7946,46 +7933,29 @@ const serializeAws_restJson1_1EbsInstanceBlockDeviceSpecification = ( input: EbsInstanceBlockDeviceSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deleteOnTermination !== undefined) { - bodyParams["deleteOnTermination"] = input.deleteOnTermination; - } - if (input.encrypted !== undefined) { - bodyParams["encrypted"] = input.encrypted; - } - if (input.iops !== undefined) { - bodyParams["iops"] = input.iops; - } - if (input.kmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.kmsKeyId; - } - if (input.snapshotId !== undefined) { - bodyParams["snapshotId"] = input.snapshotId; - } - if (input.volumeSize !== undefined) { - bodyParams["volumeSize"] = input.volumeSize; - } - if (input.volumeType !== undefined) { - bodyParams["volumeType"] = input.volumeType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_restJson1_1FilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_restJson1_1FilterValues(input.values, context) + }) + }; }; const serializeAws_restJson1_1FilterList = ( @@ -8006,39 +7976,31 @@ const serializeAws_restJson1_1ImageTestsConfiguration = ( input: ImageTestsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.imageTestsEnabled !== undefined) { - bodyParams["imageTestsEnabled"] = input.imageTestsEnabled; - } - if (input.timeoutMinutes !== undefined) { - bodyParams["timeoutMinutes"] = input.timeoutMinutes; - } - return bodyParams; + return { + ...(input.imageTestsEnabled !== undefined && { + imageTestsEnabled: input.imageTestsEnabled + }), + ...(input.timeoutMinutes !== undefined && { + timeoutMinutes: input.timeoutMinutes + }) + }; }; const serializeAws_restJson1_1InstanceBlockDeviceMapping = ( input: InstanceBlockDeviceMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deviceName !== undefined) { - bodyParams["deviceName"] = input.deviceName; - } - if (input.ebs !== undefined) { - bodyParams[ - "ebs" - ] = serializeAws_restJson1_1EbsInstanceBlockDeviceSpecification( - input.ebs, - context - ); - } - if (input.noDevice !== undefined) { - bodyParams["noDevice"] = input.noDevice; - } - if (input.virtualName !== undefined) { - bodyParams["virtualName"] = input.virtualName; - } - return bodyParams; + return { + ...(input.deviceName !== undefined && { deviceName: input.deviceName }), + ...(input.ebs !== undefined && { + ebs: serializeAws_restJson1_1EbsInstanceBlockDeviceSpecification( + input.ebs, + context + ) + }), + ...(input.noDevice !== undefined && { noDevice: input.noDevice }), + ...(input.virtualName !== undefined && { virtualName: input.virtualName }) + }; }; const serializeAws_restJson1_1InstanceBlockDeviceMappings = ( @@ -8061,63 +8023,51 @@ const serializeAws_restJson1_1LaunchPermissionConfiguration = ( input: LaunchPermissionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.userGroups !== undefined) { - bodyParams["userGroups"] = serializeAws_restJson1_1StringList( - input.userGroups, - context - ); - } - if (input.userIds !== undefined) { - bodyParams["userIds"] = serializeAws_restJson1_1AccountList( - input.userIds, - context - ); - } - return bodyParams; + return { + ...(input.userGroups !== undefined && { + userGroups: serializeAws_restJson1_1StringList(input.userGroups, context) + }), + ...(input.userIds !== undefined && { + userIds: serializeAws_restJson1_1AccountList(input.userIds, context) + }) + }; }; const serializeAws_restJson1_1Logging = ( input: Logging, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3Logs !== undefined) { - bodyParams["s3Logs"] = serializeAws_restJson1_1S3Logs( - input.s3Logs, - context - ); - } - return bodyParams; + return { + ...(input.s3Logs !== undefined && { + s3Logs: serializeAws_restJson1_1S3Logs(input.s3Logs, context) + }) + }; }; const serializeAws_restJson1_1S3Logs = ( input: S3Logs, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3BucketName !== undefined) { - bodyParams["s3BucketName"] = input.s3BucketName; - } - if (input.s3KeyPrefix !== undefined) { - bodyParams["s3KeyPrefix"] = input.s3KeyPrefix; - } - return bodyParams; + return { + ...(input.s3BucketName !== undefined && { + s3BucketName: input.s3BucketName + }), + ...(input.s3KeyPrefix !== undefined && { s3KeyPrefix: input.s3KeyPrefix }) + }; }; const serializeAws_restJson1_1Schedule = ( input: Schedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pipelineExecutionStartCondition !== undefined) { - bodyParams["pipelineExecutionStartCondition"] = - input.pipelineExecutionStartCondition; - } - if (input.scheduleExpression !== undefined) { - bodyParams["scheduleExpression"] = input.scheduleExpression; - } - return bodyParams; + return { + ...(input.pipelineExecutionStartCondition !== undefined && { + pipelineExecutionStartCondition: input.pipelineExecutionStartCondition + }), + ...(input.scheduleExpression !== undefined && { + scheduleExpression: input.scheduleExpression + }) + }; }; const serializeAws_restJson1_1SecurityGroupIds = ( diff --git a/clients/client-inspector/protocols/Aws_json1_1.ts b/clients/client-inspector/protocols/Aws_json1_1.ts index 4a6f9ed697eb..01aa08ede704 100644 --- a/clients/client-inspector/protocols/Aws_json1_1.ts +++ b/clients/client-inspector/protocols/Aws_json1_1.ts @@ -4692,22 +4692,20 @@ const serializeAws_json1_1AddAttributesToFindingsRequest = ( input: AddAttributesToFindingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_json1_1UserAttributeList( - input.attributes, - context - ); - } - if (input.findingArns !== undefined) { - bodyParams[ - "findingArns" - ] = serializeAws_json1_1AddRemoveAttributesFindingArnList( - input.findingArns, - context - ); - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_json1_1UserAttributeList( + input.attributes, + context + ) + }), + ...(input.findingArns !== undefined && { + findingArns: serializeAws_json1_1AddRemoveAttributesFindingArnList( + input.findingArns, + context + ) + }) + }; }; const serializeAws_json1_1AddRemoveAttributesFindingArnList = ( @@ -4721,20 +4719,20 @@ const serializeAws_json1_1AgentFilter = ( input: AgentFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.agentHealthCodes !== undefined) { - bodyParams["agentHealthCodes"] = serializeAws_json1_1AgentHealthCodeList( - input.agentHealthCodes, - context - ); - } - if (input.agentHealths !== undefined) { - bodyParams["agentHealths"] = serializeAws_json1_1AgentHealthList( - input.agentHealths, - context - ); - } - return bodyParams; + return { + ...(input.agentHealthCodes !== undefined && { + agentHealthCodes: serializeAws_json1_1AgentHealthCodeList( + input.agentHealthCodes, + context + ) + }), + ...(input.agentHealths !== undefined && { + agentHealths: serializeAws_json1_1AgentHealthList( + input.agentHealths, + context + ) + }) + }; }; const serializeAws_json1_1AgentHealthCodeList = ( @@ -4762,49 +4760,42 @@ const serializeAws_json1_1AssessmentRunFilter = ( input: AssessmentRunFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.completionTimeRange !== undefined) { - bodyParams["completionTimeRange"] = serializeAws_json1_1TimestampRange( - input.completionTimeRange, - context - ); - } - if (input.durationRange !== undefined) { - bodyParams["durationRange"] = serializeAws_json1_1DurationRange( - input.durationRange, - context - ); - } - if (input.namePattern !== undefined) { - bodyParams["namePattern"] = input.namePattern; - } - if (input.rulesPackageArns !== undefined) { - bodyParams[ - "rulesPackageArns" - ] = serializeAws_json1_1FilterRulesPackageArnList( - input.rulesPackageArns, - context - ); - } - if (input.startTimeRange !== undefined) { - bodyParams["startTimeRange"] = serializeAws_json1_1TimestampRange( - input.startTimeRange, - context - ); - } - if (input.stateChangeTimeRange !== undefined) { - bodyParams["stateChangeTimeRange"] = serializeAws_json1_1TimestampRange( - input.stateChangeTimeRange, - context - ); - } - if (input.states !== undefined) { - bodyParams["states"] = serializeAws_json1_1AssessmentRunStateList( - input.states, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1AssessmentRunStateList = ( @@ -4818,37 +4809,32 @@ const serializeAws_json1_1AssessmentTargetFilter = ( input: AssessmentTargetFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetNamePattern !== undefined) { - bodyParams["assessmentTargetNamePattern"] = - input.assessmentTargetNamePattern; - } - return bodyParams; + return { + ...(input.assessmentTargetNamePattern !== undefined && { + assessmentTargetNamePattern: input.assessmentTargetNamePattern + }) + }; }; const serializeAws_json1_1AssessmentTemplateFilter = ( input: AssessmentTemplateFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.durationRange !== undefined) { - bodyParams["durationRange"] = serializeAws_json1_1DurationRange( - input.durationRange, - context - ); - } - if (input.namePattern !== undefined) { - bodyParams["namePattern"] = input.namePattern; - } - if (input.rulesPackageArns !== undefined) { - bodyParams[ - "rulesPackageArns" - ] = serializeAws_json1_1FilterRulesPackageArnList( - input.rulesPackageArns, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AssessmentTemplateRulesPackageArnList = ( @@ -4862,14 +4848,10 @@ const serializeAws_json1_1Attribute = ( input: Attribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1AttributeList = ( @@ -4904,232 +4886,212 @@ const serializeAws_json1_1CreateAssessmentTargetRequest = ( input: CreateAssessmentTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetName !== undefined) { - bodyParams["assessmentTargetName"] = input.assessmentTargetName; - } - if (input.resourceGroupArn !== undefined) { - bodyParams["resourceGroupArn"] = input.resourceGroupArn; - } - return bodyParams; + return { + ...(input.assessmentTargetName !== undefined && { + assessmentTargetName: input.assessmentTargetName + }), + ...(input.resourceGroupArn !== undefined && { + resourceGroupArn: input.resourceGroupArn + }) + }; }; const serializeAws_json1_1CreateAssessmentTemplateRequest = ( input: CreateAssessmentTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetArn !== undefined) { - bodyParams["assessmentTargetArn"] = input.assessmentTargetArn; - } - if (input.assessmentTemplateName !== undefined) { - bodyParams["assessmentTemplateName"] = input.assessmentTemplateName; - } - if (input.durationInSeconds !== undefined) { - bodyParams["durationInSeconds"] = input.durationInSeconds; - } - if (input.rulesPackageArns !== undefined) { - bodyParams[ - "rulesPackageArns" - ] = serializeAws_json1_1AssessmentTemplateRulesPackageArnList( - input.rulesPackageArns, - context - ); - } - if (input.userAttributesForFindings !== undefined) { - bodyParams[ - "userAttributesForFindings" - ] = serializeAws_json1_1UserAttributeList( - input.userAttributesForFindings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateExclusionsPreviewRequest = ( input: CreateExclusionsPreviewRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTemplateArn !== undefined) { - bodyParams["assessmentTemplateArn"] = input.assessmentTemplateArn; - } - return bodyParams; + return { + ...(input.assessmentTemplateArn !== undefined && { + assessmentTemplateArn: input.assessmentTemplateArn + }) + }; }; const serializeAws_json1_1CreateResourceGroupRequest = ( input: CreateResourceGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceGroupTags !== undefined) { - bodyParams["resourceGroupTags"] = serializeAws_json1_1ResourceGroupTags( - input.resourceGroupTags, - context - ); - } - return bodyParams; + return { + ...(input.resourceGroupTags !== undefined && { + resourceGroupTags: serializeAws_json1_1ResourceGroupTags( + input.resourceGroupTags, + context + ) + }) + }; }; const serializeAws_json1_1DeleteAssessmentRunRequest = ( input: DeleteAssessmentRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArn !== undefined) { - bodyParams["assessmentRunArn"] = input.assessmentRunArn; - } - return bodyParams; + return { + ...(input.assessmentRunArn !== undefined && { + assessmentRunArn: input.assessmentRunArn + }) + }; }; const serializeAws_json1_1DeleteAssessmentTargetRequest = ( input: DeleteAssessmentTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetArn !== undefined) { - bodyParams["assessmentTargetArn"] = input.assessmentTargetArn; - } - return bodyParams; + return { + ...(input.assessmentTargetArn !== undefined && { + assessmentTargetArn: input.assessmentTargetArn + }) + }; }; const serializeAws_json1_1DeleteAssessmentTemplateRequest = ( input: DeleteAssessmentTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTemplateArn !== undefined) { - bodyParams["assessmentTemplateArn"] = input.assessmentTemplateArn; - } - return bodyParams; + return { + ...(input.assessmentTemplateArn !== undefined && { + assessmentTemplateArn: input.assessmentTemplateArn + }) + }; }; const serializeAws_json1_1DescribeAssessmentRunsRequest = ( input: DescribeAssessmentRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArns !== undefined) { - bodyParams["assessmentRunArns"] = serializeAws_json1_1BatchDescribeArnList( - input.assessmentRunArns, - context - ); - } - return bodyParams; + return { + ...(input.assessmentRunArns !== undefined && { + assessmentRunArns: serializeAws_json1_1BatchDescribeArnList( + input.assessmentRunArns, + context + ) + }) + }; }; const serializeAws_json1_1DescribeAssessmentTargetsRequest = ( input: DescribeAssessmentTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetArns !== undefined) { - bodyParams[ - "assessmentTargetArns" - ] = serializeAws_json1_1BatchDescribeArnList( - input.assessmentTargetArns, - context - ); - } - return bodyParams; + return { + ...(input.assessmentTargetArns !== undefined && { + assessmentTargetArns: serializeAws_json1_1BatchDescribeArnList( + input.assessmentTargetArns, + context + ) + }) + }; }; const serializeAws_json1_1DescribeAssessmentTemplatesRequest = ( input: DescribeAssessmentTemplatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTemplateArns !== undefined) { - bodyParams[ - "assessmentTemplateArns" - ] = serializeAws_json1_1BatchDescribeArnList( - input.assessmentTemplateArns, - context - ); - } - return bodyParams; + return { + ...(input.assessmentTemplateArns !== undefined && { + assessmentTemplateArns: serializeAws_json1_1BatchDescribeArnList( + input.assessmentTemplateArns, + context + ) + }) + }; }; const serializeAws_json1_1DescribeExclusionsRequest = ( input: DescribeExclusionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exclusionArns !== undefined) { - bodyParams[ - "exclusionArns" - ] = serializeAws_json1_1BatchDescribeExclusionsArnList( - input.exclusionArns, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - return bodyParams; + return { + ...(input.exclusionArns !== undefined && { + exclusionArns: serializeAws_json1_1BatchDescribeExclusionsArnList( + input.exclusionArns, + context + ) + }), + ...(input.locale !== undefined && { locale: input.locale }) + }; }; const serializeAws_json1_1DescribeFindingsRequest = ( input: DescribeFindingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.findingArns !== undefined) { - bodyParams["findingArns"] = serializeAws_json1_1BatchDescribeArnList( - input.findingArns, - context - ); - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - return bodyParams; + return { + ...(input.findingArns !== undefined && { + findingArns: serializeAws_json1_1BatchDescribeArnList( + input.findingArns, + context + ) + }), + ...(input.locale !== undefined && { locale: input.locale }) + }; }; const serializeAws_json1_1DescribeResourceGroupsRequest = ( input: DescribeResourceGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceGroupArns !== undefined) { - bodyParams["resourceGroupArns"] = serializeAws_json1_1BatchDescribeArnList( - input.resourceGroupArns, - context - ); - } - return bodyParams; + return { + ...(input.resourceGroupArns !== undefined && { + resourceGroupArns: serializeAws_json1_1BatchDescribeArnList( + input.resourceGroupArns, + context + ) + }) + }; }; const serializeAws_json1_1DescribeRulesPackagesRequest = ( input: DescribeRulesPackagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.rulesPackageArns !== undefined) { - bodyParams["rulesPackageArns"] = serializeAws_json1_1BatchDescribeArnList( - input.rulesPackageArns, - context - ); - } - return bodyParams; + return { + ...(input.locale !== undefined && { locale: input.locale }), + ...(input.rulesPackageArns !== undefined && { + rulesPackageArns: serializeAws_json1_1BatchDescribeArnList( + input.rulesPackageArns, + context + ) + }) + }; }; const serializeAws_json1_1DurationRange = ( input: DurationRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxSeconds !== undefined) { - bodyParams["maxSeconds"] = input.maxSeconds; - } - if (input.minSeconds !== undefined) { - bodyParams["minSeconds"] = input.minSeconds; - } - return bodyParams; + return { + ...(input.maxSeconds !== undefined && { maxSeconds: input.maxSeconds }), + ...(input.minSeconds !== undefined && { minSeconds: input.minSeconds }) + }; }; const serializeAws_json1_1FilterRulesPackageArnList = ( @@ -5143,266 +5105,200 @@ const serializeAws_json1_1FindingFilter = ( input: FindingFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.agentIds !== undefined) { - bodyParams["agentIds"] = serializeAws_json1_1AgentIdList( - input.agentIds, - context - ); - } - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_json1_1AttributeList( - input.attributes, - context - ); - } - if (input.autoScalingGroups !== undefined) { - bodyParams["autoScalingGroups"] = serializeAws_json1_1AutoScalingGroupList( - input.autoScalingGroups, - context - ); - } - if (input.creationTimeRange !== undefined) { - bodyParams["creationTimeRange"] = serializeAws_json1_1TimestampRange( - input.creationTimeRange, - context - ); - } - if (input.ruleNames !== undefined) { - bodyParams["ruleNames"] = serializeAws_json1_1RuleNameList( - input.ruleNames, - context - ); - } - if (input.rulesPackageArns !== undefined) { - bodyParams[ - "rulesPackageArns" - ] = serializeAws_json1_1FilterRulesPackageArnList( - input.rulesPackageArns, - context - ); - } - if (input.severities !== undefined) { - bodyParams["severities"] = serializeAws_json1_1SeverityList( - input.severities, - context - ); - } - if (input.userAttributes !== undefined) { - bodyParams["userAttributes"] = serializeAws_json1_1AttributeList( - input.userAttributes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1GetAssessmentReportRequest = ( input: GetAssessmentReportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArn !== undefined) { - bodyParams["assessmentRunArn"] = input.assessmentRunArn; - } - if (input.reportFileFormat !== undefined) { - bodyParams["reportFileFormat"] = input.reportFileFormat; - } - if (input.reportType !== undefined) { - bodyParams["reportType"] = input.reportType; - } - return bodyParams; + return { + ...(input.assessmentRunArn !== undefined && { + assessmentRunArn: input.assessmentRunArn + }), + ...(input.reportFileFormat !== undefined && { + reportFileFormat: input.reportFileFormat + }), + ...(input.reportType !== undefined && { reportType: input.reportType }) + }; }; const serializeAws_json1_1GetExclusionsPreviewRequest = ( input: GetExclusionsPreviewRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTemplateArn !== undefined) { - bodyParams["assessmentTemplateArn"] = input.assessmentTemplateArn; - } - if (input.locale !== undefined) { - bodyParams["locale"] = input.locale; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.previewToken !== undefined) { - bodyParams["previewToken"] = input.previewToken; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetTelemetryMetadataRequest = ( input: GetTelemetryMetadataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArn !== undefined) { - bodyParams["assessmentRunArn"] = input.assessmentRunArn; - } - return bodyParams; + return { + ...(input.assessmentRunArn !== undefined && { + assessmentRunArn: input.assessmentRunArn + }) + }; }; const serializeAws_json1_1ListAssessmentRunAgentsRequest = ( input: ListAssessmentRunAgentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArn !== undefined) { - bodyParams["assessmentRunArn"] = input.assessmentRunArn; - } - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1AgentFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListAssessmentRunsRequest = ( input: ListAssessmentRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTemplateArns !== undefined) { - bodyParams[ - "assessmentTemplateArns" - ] = serializeAws_json1_1ListParentArnList( - input.assessmentTemplateArns, - context - ); - } - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1AssessmentRunFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListAssessmentTargetsRequest = ( input: ListAssessmentTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1AssessmentTargetFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.filter !== undefined && { + filter: serializeAws_json1_1AssessmentTargetFilter(input.filter, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListAssessmentTemplatesRequest = ( input: ListAssessmentTemplatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetArns !== undefined) { - bodyParams["assessmentTargetArns"] = serializeAws_json1_1ListParentArnList( - input.assessmentTargetArns, - context - ); - } - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1AssessmentTemplateFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListEventSubscriptionsRequest = ( input: ListEventSubscriptionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1ListExclusionsRequest = ( input: ListExclusionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArn !== undefined) { - bodyParams["assessmentRunArn"] = input.assessmentRunArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.assessmentRunArn !== undefined && { + assessmentRunArn: input.assessmentRunArn + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListFindingsRequest = ( input: ListFindingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArns !== undefined) { - bodyParams["assessmentRunArns"] = serializeAws_json1_1ListParentArnList( - input.assessmentRunArns, - context - ); - } - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_json1_1FindingFilter( - input.filter, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListParentArnList = ( @@ -5416,89 +5312,71 @@ const serializeAws_json1_1ListRulesPackagesRequest = ( input: ListRulesPackagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1PreviewAgentsRequest = ( input: PreviewAgentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.previewAgentsArn !== undefined) { - bodyParams["previewAgentsArn"] = input.previewAgentsArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.previewAgentsArn !== undefined && { + previewAgentsArn: input.previewAgentsArn + }) + }; }; const serializeAws_json1_1RegisterCrossAccountAccessRoleRequest = ( input: RegisterCrossAccountAccessRoleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_json1_1RemoveAttributesFromFindingsRequest = ( input: RemoveAttributesFromFindingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributeKeys !== undefined) { - bodyParams["attributeKeys"] = serializeAws_json1_1UserAttributeKeyList( - input.attributeKeys, - context - ); - } - if (input.findingArns !== undefined) { - bodyParams[ - "findingArns" - ] = serializeAws_json1_1AddRemoveAttributesFindingArnList( - input.findingArns, - context - ); - } - return bodyParams; + return { + ...(input.attributeKeys !== undefined && { + attributeKeys: serializeAws_json1_1UserAttributeKeyList( + input.attributeKeys, + context + ) + }), + ...(input.findingArns !== undefined && { + findingArns: serializeAws_json1_1AddRemoveAttributesFindingArnList( + input.findingArns, + context + ) + }) + }; }; const serializeAws_json1_1ResourceGroupTag = ( input: ResourceGroupTag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1ResourceGroupTags = ( @@ -5521,14 +5399,12 @@ const serializeAws_json1_1SetTagsForResourceRequest = ( input: SetTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1SeverityList = ( @@ -5542,56 +5418,44 @@ const serializeAws_json1_1StartAssessmentRunRequest = ( input: StartAssessmentRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunName !== undefined) { - bodyParams["assessmentRunName"] = input.assessmentRunName; - } - if (input.assessmentTemplateArn !== undefined) { - bodyParams["assessmentTemplateArn"] = input.assessmentTemplateArn; - } - return bodyParams; + return { + ...(input.assessmentRunName !== undefined && { + assessmentRunName: input.assessmentRunName + }), + ...(input.assessmentTemplateArn !== undefined && { + assessmentTemplateArn: input.assessmentTemplateArn + }) + }; }; const serializeAws_json1_1StopAssessmentRunRequest = ( input: StopAssessmentRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentRunArn !== undefined) { - bodyParams["assessmentRunArn"] = input.assessmentRunArn; - } - if (input.stopAction !== undefined) { - bodyParams["stopAction"] = input.stopAction; - } - return bodyParams; + return { + ...(input.assessmentRunArn !== undefined && { + assessmentRunArn: input.assessmentRunArn + }), + ...(input.stopAction !== undefined && { stopAction: input.stopAction }) + }; }; const serializeAws_json1_1SubscribeToEventRequest = ( input: SubscribeToEventRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.event !== undefined) { - bodyParams["event"] = input.event; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.topicArn !== undefined) { - bodyParams["topicArn"] = input.topicArn; - } - return bodyParams; + return { + ...(input.event !== undefined && { event: input.event }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.topicArn !== undefined && { topicArn: input.topicArn }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagList = ( @@ -5605,48 +5469,42 @@ const serializeAws_json1_1TimestampRange = ( input: TimestampRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.beginDate !== undefined) { - bodyParams["beginDate"] = Math.round(input.beginDate.getTime() / 1000); - } - if (input.endDate !== undefined) { - bodyParams["endDate"] = Math.round(input.endDate.getTime() / 1000); - } - return bodyParams; + return { + ...(input.beginDate !== undefined && { + beginDate: Math.round(input.beginDate.getTime() / 1000) + }), + ...(input.endDate !== undefined && { + endDate: Math.round(input.endDate.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UnsubscribeFromEventRequest = ( input: UnsubscribeFromEventRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.event !== undefined) { - bodyParams["event"] = input.event; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.topicArn !== undefined) { - bodyParams["topicArn"] = input.topicArn; - } - return bodyParams; + return { + ...(input.event !== undefined && { event: input.event }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.topicArn !== undefined && { topicArn: input.topicArn }) + }; }; const serializeAws_json1_1UpdateAssessmentTargetRequest = ( input: UpdateAssessmentTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assessmentTargetArn !== undefined) { - bodyParams["assessmentTargetArn"] = input.assessmentTargetArn; - } - if (input.assessmentTargetName !== undefined) { - bodyParams["assessmentTargetName"] = input.assessmentTargetName; - } - if (input.resourceGroupArn !== undefined) { - bodyParams["resourceGroupArn"] = input.resourceGroupArn; - } - return bodyParams; + return { + ...(input.assessmentTargetArn !== undefined && { + assessmentTargetArn: input.assessmentTargetArn + }), + ...(input.assessmentTargetName !== undefined && { + assessmentTargetName: input.assessmentTargetName + }), + ...(input.resourceGroupArn !== undefined && { + resourceGroupArn: input.resourceGroupArn + }) + }; }; const serializeAws_json1_1UserAttributeKeyList = ( diff --git a/clients/client-iot-1click-devices-service/protocols/Aws_restJson1_1.ts b/clients/client-iot-1click-devices-service/protocols/Aws_restJson1_1.ts index 5005e889bd2e..15aaddff55f9 100644 --- a/clients/client-iot-1click-devices-service/protocols/Aws_restJson1_1.ts +++ b/clients/client-iot-1click-devices-service/protocols/Aws_restJson1_1.ts @@ -1878,14 +1878,10 @@ const serializeAws_restJson1_1DeviceMethod = ( input: DeviceMethod, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceType !== undefined) { - bodyParams["deviceType"] = input.DeviceType; - } - if (input.MethodName !== undefined) { - bodyParams["methodName"] = input.MethodName; - } - return bodyParams; + return { + ...(input.DeviceType !== undefined && { deviceType: input.DeviceType }), + ...(input.MethodName !== undefined && { methodName: input.MethodName }) + }; }; const serializeAws_restJson1_1__mapOf__string = ( diff --git a/clients/client-iot-1click-projects/protocols/Aws_restJson1_1.ts b/clients/client-iot-1click-projects/protocols/Aws_restJson1_1.ts index 2e4e9f41f298..3ef00ab36956 100644 --- a/clients/client-iot-1click-projects/protocols/Aws_restJson1_1.ts +++ b/clients/client-iot-1click-projects/protocols/Aws_restJson1_1.ts @@ -2322,19 +2322,15 @@ const serializeAws_restJson1_1DeviceTemplate = ( input: DeviceTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.callbackOverrides !== undefined) { - bodyParams[ - "callbackOverrides" - ] = serializeAws_restJson1_1DeviceCallbackOverrideMap( - input.callbackOverrides, - context - ); - } - if (input.deviceType !== undefined) { - bodyParams["deviceType"] = input.deviceType; - } - return bodyParams; + return { + ...(input.callbackOverrides !== undefined && { + callbackOverrides: serializeAws_restJson1_1DeviceCallbackOverrideMap( + input.callbackOverrides, + context + ) + }), + ...(input.deviceType !== undefined && { deviceType: input.deviceType }) + }; }; const serializeAws_restJson1_1DeviceTemplateMap = ( @@ -2361,22 +2357,20 @@ const serializeAws_restJson1_1PlacementTemplate = ( input: PlacementTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultAttributes !== undefined) { - bodyParams[ - "defaultAttributes" - ] = serializeAws_restJson1_1DefaultPlacementAttributeMap( - input.defaultAttributes, - context - ); - } - if (input.deviceTemplates !== undefined) { - bodyParams["deviceTemplates"] = serializeAws_restJson1_1DeviceTemplateMap( - input.deviceTemplates, - context - ); - } - return bodyParams; + return { + ...(input.defaultAttributes !== undefined && { + defaultAttributes: serializeAws_restJson1_1DefaultPlacementAttributeMap( + input.defaultAttributes, + context + ) + }), + ...(input.deviceTemplates !== undefined && { + deviceTemplates: serializeAws_restJson1_1DeviceTemplateMap( + input.deviceTemplates, + context + ) + }) + }; }; const serializeAws_restJson1_1TagMap = ( diff --git a/clients/client-iot-events-data/protocols/Aws_restJson1_1.ts b/clients/client-iot-events-data/protocols/Aws_restJson1_1.ts index bd3d7a530513..c14f6a38ca92 100644 --- a/clients/client-iot-events-data/protocols/Aws_restJson1_1.ts +++ b/clients/client-iot-events-data/protocols/Aws_restJson1_1.ts @@ -703,40 +703,31 @@ const serializeAws_restJson1_1DetectorStateDefinition = ( input: DetectorStateDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.stateName !== undefined) { - bodyParams["stateName"] = input.stateName; - } - if (input.timers !== undefined) { - bodyParams["timers"] = serializeAws_restJson1_1TimerDefinitions( - input.timers, - context - ); - } - if (input.variables !== undefined) { - bodyParams["variables"] = serializeAws_restJson1_1VariableDefinitions( - input.variables, - context - ); - } - return bodyParams; + return { + ...(input.stateName !== undefined && { stateName: input.stateName }), + ...(input.timers !== undefined && { + timers: serializeAws_restJson1_1TimerDefinitions(input.timers, context) + }), + ...(input.variables !== undefined && { + variables: serializeAws_restJson1_1VariableDefinitions( + input.variables, + context + ) + }) + }; }; const serializeAws_restJson1_1Message = ( input: Message, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inputName !== undefined) { - bodyParams["inputName"] = input.inputName; - } - if (input.messageId !== undefined) { - bodyParams["messageId"] = input.messageId; - } - if (input.payload !== undefined) { - bodyParams["payload"] = context.base64Encoder(input.payload); - } - return bodyParams; + return { + ...(input.inputName !== undefined && { inputName: input.inputName }), + ...(input.messageId !== undefined && { messageId: input.messageId }), + ...(input.payload !== undefined && { + payload: context.base64Encoder(input.payload) + }) + }; }; const serializeAws_restJson1_1Messages = ( @@ -750,14 +741,10 @@ const serializeAws_restJson1_1TimerDefinition = ( input: TimerDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.seconds !== undefined) { - bodyParams["seconds"] = input.seconds; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.seconds !== undefined && { seconds: input.seconds }) + }; }; const serializeAws_restJson1_1TimerDefinitions = ( @@ -773,23 +760,19 @@ const serializeAws_restJson1_1UpdateDetectorRequest = ( input: UpdateDetectorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorModelName !== undefined) { - bodyParams["detectorModelName"] = input.detectorModelName; - } - if (input.keyValue !== undefined) { - bodyParams["keyValue"] = input.keyValue; - } - if (input.messageId !== undefined) { - bodyParams["messageId"] = input.messageId; - } - if (input.state !== undefined) { - bodyParams["state"] = serializeAws_restJson1_1DetectorStateDefinition( - input.state, - context - ); - } - return bodyParams; + return { + ...(input.detectorModelName !== undefined && { + detectorModelName: input.detectorModelName + }), + ...(input.keyValue !== undefined && { keyValue: input.keyValue }), + ...(input.messageId !== undefined && { messageId: input.messageId }), + ...(input.state !== undefined && { + state: serializeAws_restJson1_1DetectorStateDefinition( + input.state, + context + ) + }) + }; }; const serializeAws_restJson1_1UpdateDetectorRequests = ( @@ -805,14 +788,10 @@ const serializeAws_restJson1_1VariableDefinition = ( input: VariableDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1VariableDefinitions = ( diff --git a/clients/client-iot-events/protocols/Aws_restJson1_1.ts b/clients/client-iot-events/protocols/Aws_restJson1_1.ts index 600d983fa1c5..705ca7c0bce0 100644 --- a/clients/client-iot-events/protocols/Aws_restJson1_1.ts +++ b/clients/client-iot-events/protocols/Aws_restJson1_1.ts @@ -2638,67 +2638,53 @@ const serializeAws_restJson1_1Action = ( input: Action, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clearTimer !== undefined) { - bodyParams["clearTimer"] = serializeAws_restJson1_1ClearTimerAction( - input.clearTimer, - context - ); - } - if (input.firehose !== undefined) { - bodyParams["firehose"] = serializeAws_restJson1_1FirehoseAction( - input.firehose, - context - ); - } - if (input.iotEvents !== undefined) { - bodyParams["iotEvents"] = serializeAws_restJson1_1IotEventsAction( - input.iotEvents, - context - ); - } - if (input.iotTopicPublish !== undefined) { - bodyParams[ - "iotTopicPublish" - ] = serializeAws_restJson1_1IotTopicPublishAction( - input.iotTopicPublish, - context - ); - } - if (input.lambda !== undefined) { - bodyParams["lambda"] = serializeAws_restJson1_1LambdaAction( - input.lambda, - context - ); - } - if (input.resetTimer !== undefined) { - bodyParams["resetTimer"] = serializeAws_restJson1_1ResetTimerAction( - input.resetTimer, - context - ); - } - if (input.setTimer !== undefined) { - bodyParams["setTimer"] = serializeAws_restJson1_1SetTimerAction( - input.setTimer, - context - ); - } - if (input.setVariable !== undefined) { - bodyParams["setVariable"] = serializeAws_restJson1_1SetVariableAction( - input.setVariable, - context - ); - } - if (input.sns !== undefined) { - bodyParams["sns"] = serializeAws_restJson1_1SNSTopicPublishAction( - input.sns, - context - ); - } - if (input.sqs !== undefined) { - bodyParams["sqs"] = serializeAws_restJson1_1SqsAction(input.sqs, context); - } - return bodyParams; + return { + ...(input.clearTimer !== undefined && { + clearTimer: serializeAws_restJson1_1ClearTimerAction( + input.clearTimer, + context + ) + }), + ...(input.firehose !== undefined && { + firehose: serializeAws_restJson1_1FirehoseAction(input.firehose, context) + }), + ...(input.iotEvents !== undefined && { + iotEvents: serializeAws_restJson1_1IotEventsAction( + input.iotEvents, + context + ) + }), + ...(input.iotTopicPublish !== undefined && { + iotTopicPublish: serializeAws_restJson1_1IotTopicPublishAction( + input.iotTopicPublish, + context + ) + }), + ...(input.lambda !== undefined && { + lambda: serializeAws_restJson1_1LambdaAction(input.lambda, context) + }), + ...(input.resetTimer !== undefined && { + resetTimer: serializeAws_restJson1_1ResetTimerAction( + input.resetTimer, + context + ) + }), + ...(input.setTimer !== undefined && { + setTimer: serializeAws_restJson1_1SetTimerAction(input.setTimer, context) + }), + ...(input.setVariable !== undefined && { + setVariable: serializeAws_restJson1_1SetVariableAction( + input.setVariable, + context + ) + }), + ...(input.sns !== undefined && { + sns: serializeAws_restJson1_1SNSTopicPublishAction(input.sns, context) + }), + ...(input.sqs !== undefined && { + sqs: serializeAws_restJson1_1SqsAction(input.sqs, context) + }) + }; }; const serializeAws_restJson1_1Actions = ( @@ -2712,11 +2698,9 @@ const serializeAws_restJson1_1Attribute = ( input: Attribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.jsonPath !== undefined) { - bodyParams["jsonPath"] = input.jsonPath; - } - return bodyParams; + return { + ...(input.jsonPath !== undefined && { jsonPath: input.jsonPath }) + }; }; const serializeAws_restJson1_1Attributes = ( @@ -2730,25 +2714,21 @@ const serializeAws_restJson1_1ClearTimerAction = ( input: ClearTimerAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.timerName !== undefined) { - bodyParams["timerName"] = input.timerName; - } - return bodyParams; + return { + ...(input.timerName !== undefined && { timerName: input.timerName }) + }; }; const serializeAws_restJson1_1DetectorDebugOption = ( input: DetectorDebugOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorModelName !== undefined) { - bodyParams["detectorModelName"] = input.detectorModelName; - } - if (input.keyValue !== undefined) { - bodyParams["keyValue"] = input.keyValue; - } - return bodyParams; + return { + ...(input.detectorModelName !== undefined && { + detectorModelName: input.detectorModelName + }), + ...(input.keyValue !== undefined && { keyValue: input.keyValue }) + }; }; const serializeAws_restJson1_1DetectorDebugOptions = ( @@ -2764,37 +2744,27 @@ const serializeAws_restJson1_1DetectorModelDefinition = ( input: DetectorModelDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.initialStateName !== undefined) { - bodyParams["initialStateName"] = input.initialStateName; - } - if (input.states !== undefined) { - bodyParams["states"] = serializeAws_restJson1_1States( - input.states, - context - ); - } - return bodyParams; + return { + ...(input.initialStateName !== undefined && { + initialStateName: input.initialStateName + }), + ...(input.states !== undefined && { + states: serializeAws_restJson1_1States(input.states, context) + }) + }; }; const serializeAws_restJson1_1Event = ( input: Event, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actions !== undefined) { - bodyParams["actions"] = serializeAws_restJson1_1Actions( - input.actions, - context - ); - } - if (input.condition !== undefined) { - bodyParams["condition"] = input.condition; - } - if (input.eventName !== undefined) { - bodyParams["eventName"] = input.eventName; - } - return bodyParams; + return { + ...(input.actions !== undefined && { + actions: serializeAws_restJson1_1Actions(input.actions, context) + }), + ...(input.condition !== undefined && { condition: input.condition }), + ...(input.eventName !== undefined && { eventName: input.eventName }) + }; }; const serializeAws_restJson1_1Events = ( @@ -2808,227 +2778,174 @@ const serializeAws_restJson1_1FirehoseAction = ( input: FirehoseAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deliveryStreamName !== undefined) { - bodyParams["deliveryStreamName"] = input.deliveryStreamName; - } - if (input.separator !== undefined) { - bodyParams["separator"] = input.separator; - } - return bodyParams; + return { + ...(input.deliveryStreamName !== undefined && { + deliveryStreamName: input.deliveryStreamName + }), + ...(input.separator !== undefined && { separator: input.separator }) + }; }; const serializeAws_restJson1_1InputDefinition = ( input: InputDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_restJson1_1Attributes( - input.attributes, - context - ); - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1Attributes(input.attributes, context) + }) + }; }; const serializeAws_restJson1_1IotEventsAction = ( input: IotEventsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inputName !== undefined) { - bodyParams["inputName"] = input.inputName; - } - return bodyParams; + return { + ...(input.inputName !== undefined && { inputName: input.inputName }) + }; }; const serializeAws_restJson1_1IotTopicPublishAction = ( input: IotTopicPublishAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.mqttTopic !== undefined) { - bodyParams["mqttTopic"] = input.mqttTopic; - } - return bodyParams; + return { + ...(input.mqttTopic !== undefined && { mqttTopic: input.mqttTopic }) + }; }; const serializeAws_restJson1_1LambdaAction = ( input: LambdaAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.functionArn !== undefined) { - bodyParams["functionArn"] = input.functionArn; - } - return bodyParams; + return { + ...(input.functionArn !== undefined && { functionArn: input.functionArn }) + }; }; const serializeAws_restJson1_1LoggingOptions = ( input: LoggingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.detectorDebugOptions !== undefined) { - bodyParams[ - "detectorDebugOptions" - ] = serializeAws_restJson1_1DetectorDebugOptions( - input.detectorDebugOptions, - context - ); - } - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - if (input.level !== undefined) { - bodyParams["level"] = input.level; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.detectorDebugOptions !== undefined && { + detectorDebugOptions: serializeAws_restJson1_1DetectorDebugOptions( + input.detectorDebugOptions, + context + ) + }), + ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.level !== undefined && { level: input.level }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1OnEnterLifecycle = ( input: OnEnterLifecycle, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.events !== undefined) { - bodyParams["events"] = serializeAws_restJson1_1Events( - input.events, - context - ); - } - return bodyParams; + return { + ...(input.events !== undefined && { + events: serializeAws_restJson1_1Events(input.events, context) + }) + }; }; const serializeAws_restJson1_1OnExitLifecycle = ( input: OnExitLifecycle, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.events !== undefined) { - bodyParams["events"] = serializeAws_restJson1_1Events( - input.events, - context - ); - } - return bodyParams; + return { + ...(input.events !== undefined && { + events: serializeAws_restJson1_1Events(input.events, context) + }) + }; }; const serializeAws_restJson1_1OnInputLifecycle = ( input: OnInputLifecycle, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.events !== undefined) { - bodyParams["events"] = serializeAws_restJson1_1Events( - input.events, - context - ); - } - if (input.transitionEvents !== undefined) { - bodyParams["transitionEvents"] = serializeAws_restJson1_1TransitionEvents( - input.transitionEvents, - context - ); - } - return bodyParams; + return { + ...(input.events !== undefined && { + events: serializeAws_restJson1_1Events(input.events, context) + }), + ...(input.transitionEvents !== undefined && { + transitionEvents: serializeAws_restJson1_1TransitionEvents( + input.transitionEvents, + context + ) + }) + }; }; const serializeAws_restJson1_1ResetTimerAction = ( input: ResetTimerAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.timerName !== undefined) { - bodyParams["timerName"] = input.timerName; - } - return bodyParams; + return { + ...(input.timerName !== undefined && { timerName: input.timerName }) + }; }; const serializeAws_restJson1_1SNSTopicPublishAction = ( input: SNSTopicPublishAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.targetArn !== undefined) { - bodyParams["targetArn"] = input.targetArn; - } - return bodyParams; + return { + ...(input.targetArn !== undefined && { targetArn: input.targetArn }) + }; }; const serializeAws_restJson1_1SetTimerAction = ( input: SetTimerAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.seconds !== undefined) { - bodyParams["seconds"] = input.seconds; - } - if (input.timerName !== undefined) { - bodyParams["timerName"] = input.timerName; - } - return bodyParams; + return { + ...(input.seconds !== undefined && { seconds: input.seconds }), + ...(input.timerName !== undefined && { timerName: input.timerName }) + }; }; const serializeAws_restJson1_1SetVariableAction = ( input: SetVariableAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - if (input.variableName !== undefined) { - bodyParams["variableName"] = input.variableName; - } - return bodyParams; + return { + ...(input.value !== undefined && { value: input.value }), + ...(input.variableName !== undefined && { + variableName: input.variableName + }) + }; }; const serializeAws_restJson1_1SqsAction = ( input: SqsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.queueUrl !== undefined) { - bodyParams["queueUrl"] = input.queueUrl; - } - if (input.useBase64 !== undefined) { - bodyParams["useBase64"] = input.useBase64; - } - return bodyParams; + return { + ...(input.queueUrl !== undefined && { queueUrl: input.queueUrl }), + ...(input.useBase64 !== undefined && { useBase64: input.useBase64 }) + }; }; const serializeAws_restJson1_1State = ( input: State, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.onEnter !== undefined) { - bodyParams["onEnter"] = serializeAws_restJson1_1OnEnterLifecycle( - input.onEnter, - context - ); - } - if (input.onExit !== undefined) { - bodyParams["onExit"] = serializeAws_restJson1_1OnExitLifecycle( - input.onExit, - context - ); - } - if (input.onInput !== undefined) { - bodyParams["onInput"] = serializeAws_restJson1_1OnInputLifecycle( - input.onInput, - context - ); - } - if (input.stateName !== undefined) { - bodyParams["stateName"] = input.stateName; - } - return bodyParams; + return { + ...(input.onEnter !== undefined && { + onEnter: serializeAws_restJson1_1OnEnterLifecycle(input.onEnter, context) + }), + ...(input.onExit !== undefined && { + onExit: serializeAws_restJson1_1OnExitLifecycle(input.onExit, context) + }), + ...(input.onInput !== undefined && { + onInput: serializeAws_restJson1_1OnInputLifecycle(input.onInput, context) + }), + ...(input.stateName !== undefined && { stateName: input.stateName }) + }; }; const serializeAws_restJson1_1States = ( @@ -3042,14 +2959,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1Tags = ( @@ -3063,23 +2976,14 @@ const serializeAws_restJson1_1TransitionEvent = ( input: TransitionEvent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actions !== undefined) { - bodyParams["actions"] = serializeAws_restJson1_1Actions( - input.actions, - context - ); - } - if (input.condition !== undefined) { - bodyParams["condition"] = input.condition; - } - if (input.eventName !== undefined) { - bodyParams["eventName"] = input.eventName; - } - if (input.nextState !== undefined) { - bodyParams["nextState"] = input.nextState; - } - return bodyParams; + return { + ...(input.actions !== undefined && { + actions: serializeAws_restJson1_1Actions(input.actions, context) + }), + ...(input.condition !== undefined && { condition: input.condition }), + ...(input.eventName !== undefined && { eventName: input.eventName }), + ...(input.nextState !== undefined && { nextState: input.nextState }) + }; }; const serializeAws_restJson1_1TransitionEvents = ( diff --git a/clients/client-iot/protocols/Aws_restJson1_1.ts b/clients/client-iot/protocols/Aws_restJson1_1.ts index 1749dac1bfee..baf5dd2dbb0f 100644 --- a/clients/client-iot/protocols/Aws_restJson1_1.ts +++ b/clients/client-iot/protocols/Aws_restJson1_1.ts @@ -32018,11 +32018,9 @@ const serializeAws_restJson1_1Configuration = ( input: Configuration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_restJson1_1EventConfigurations = ( @@ -32046,14 +32044,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagKeyList = ( @@ -32074,111 +32068,92 @@ const serializeAws_restJson1_1Action = ( input: Action, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cloudwatchAlarm !== undefined) { - bodyParams[ - "cloudwatchAlarm" - ] = serializeAws_restJson1_1CloudwatchAlarmAction( - input.cloudwatchAlarm, - context - ); - } - if (input.cloudwatchMetric !== undefined) { - bodyParams[ - "cloudwatchMetric" - ] = serializeAws_restJson1_1CloudwatchMetricAction( - input.cloudwatchMetric, - context - ); - } - if (input.dynamoDB !== undefined) { - bodyParams["dynamoDB"] = serializeAws_restJson1_1DynamoDBAction( - input.dynamoDB, - context - ); - } - if (input.dynamoDBv2 !== undefined) { - bodyParams["dynamoDBv2"] = serializeAws_restJson1_1DynamoDBv2Action( - input.dynamoDBv2, - context - ); - } - if (input.elasticsearch !== undefined) { - bodyParams["elasticsearch"] = serializeAws_restJson1_1ElasticsearchAction( - input.elasticsearch, - context - ); - } - if (input.firehose !== undefined) { - bodyParams["firehose"] = serializeAws_restJson1_1FirehoseAction( - input.firehose, - context - ); - } - if (input.http !== undefined) { - bodyParams["http"] = serializeAws_restJson1_1HttpAction( - input.http, - context - ); - } - if (input.iotAnalytics !== undefined) { - bodyParams["iotAnalytics"] = serializeAws_restJson1_1IotAnalyticsAction( - input.iotAnalytics, - context - ); - } - if (input.iotEvents !== undefined) { - bodyParams["iotEvents"] = serializeAws_restJson1_1IotEventsAction( - input.iotEvents, - context - ); - } - if (input.iotSiteWise !== undefined) { - bodyParams["iotSiteWise"] = serializeAws_restJson1_1IotSiteWiseAction( - input.iotSiteWise, - context - ); - } - if (input.kinesis !== undefined) { - bodyParams["kinesis"] = serializeAws_restJson1_1KinesisAction( - input.kinesis, - context - ); - } - if (input.lambda !== undefined) { - bodyParams["lambda"] = serializeAws_restJson1_1LambdaAction( - input.lambda, - context - ); - } - if (input.republish !== undefined) { - bodyParams["republish"] = serializeAws_restJson1_1RepublishAction( - input.republish, - context - ); - } - if (input.s3 !== undefined) { - bodyParams["s3"] = serializeAws_restJson1_1S3Action(input.s3, context); - } - if (input.salesforce !== undefined) { - bodyParams["salesforce"] = serializeAws_restJson1_1SalesforceAction( - input.salesforce, - context - ); - } - if (input.sns !== undefined) { - bodyParams["sns"] = serializeAws_restJson1_1SnsAction(input.sns, context); - } - if (input.sqs !== undefined) { - bodyParams["sqs"] = serializeAws_restJson1_1SqsAction(input.sqs, context); - } - if (input.stepFunctions !== undefined) { - bodyParams["stepFunctions"] = serializeAws_restJson1_1StepFunctionsAction( - input.stepFunctions, - context - ); - } - return bodyParams; + return { + ...(input.cloudwatchAlarm !== undefined && { + cloudwatchAlarm: serializeAws_restJson1_1CloudwatchAlarmAction( + input.cloudwatchAlarm, + context + ) + }), + ...(input.cloudwatchMetric !== undefined && { + cloudwatchMetric: serializeAws_restJson1_1CloudwatchMetricAction( + input.cloudwatchMetric, + context + ) + }), + ...(input.dynamoDB !== undefined && { + dynamoDB: serializeAws_restJson1_1DynamoDBAction(input.dynamoDB, context) + }), + ...(input.dynamoDBv2 !== undefined && { + dynamoDBv2: serializeAws_restJson1_1DynamoDBv2Action( + input.dynamoDBv2, + context + ) + }), + ...(input.elasticsearch !== undefined && { + elasticsearch: serializeAws_restJson1_1ElasticsearchAction( + input.elasticsearch, + context + ) + }), + ...(input.firehose !== undefined && { + firehose: serializeAws_restJson1_1FirehoseAction(input.firehose, context) + }), + ...(input.http !== undefined && { + http: serializeAws_restJson1_1HttpAction(input.http, context) + }), + ...(input.iotAnalytics !== undefined && { + iotAnalytics: serializeAws_restJson1_1IotAnalyticsAction( + input.iotAnalytics, + context + ) + }), + ...(input.iotEvents !== undefined && { + iotEvents: serializeAws_restJson1_1IotEventsAction( + input.iotEvents, + context + ) + }), + ...(input.iotSiteWise !== undefined && { + iotSiteWise: serializeAws_restJson1_1IotSiteWiseAction( + input.iotSiteWise, + context + ) + }), + ...(input.kinesis !== undefined && { + kinesis: serializeAws_restJson1_1KinesisAction(input.kinesis, context) + }), + ...(input.lambda !== undefined && { + lambda: serializeAws_restJson1_1LambdaAction(input.lambda, context) + }), + ...(input.republish !== undefined && { + republish: serializeAws_restJson1_1RepublishAction( + input.republish, + context + ) + }), + ...(input.s3 !== undefined && { + s3: serializeAws_restJson1_1S3Action(input.s3, context) + }), + ...(input.salesforce !== undefined && { + salesforce: serializeAws_restJson1_1SalesforceAction( + input.salesforce, + context + ) + }), + ...(input.sns !== undefined && { + sns: serializeAws_restJson1_1SnsAction(input.sns, context) + }), + ...(input.sqs !== undefined && { + sqs: serializeAws_restJson1_1SqsAction(input.sqs, context) + }), + ...(input.stepFunctions !== undefined && { + stepFunctions: serializeAws_restJson1_1StepFunctionsAction( + input.stepFunctions, + context + ) + }) + }; }; const serializeAws_restJson1_1ActionList = ( @@ -32192,37 +32167,32 @@ const serializeAws_restJson1_1AssetPropertyTimestamp = ( input: AssetPropertyTimestamp, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.offsetInNanos !== undefined) { - bodyParams["offsetInNanos"] = input.offsetInNanos; - } - if (input.timeInSeconds !== undefined) { - bodyParams["timeInSeconds"] = input.timeInSeconds; - } - return bodyParams; + return { + ...(input.offsetInNanos !== undefined && { + offsetInNanos: input.offsetInNanos + }), + ...(input.timeInSeconds !== undefined && { + timeInSeconds: input.timeInSeconds + }) + }; }; const serializeAws_restJson1_1AssetPropertyValue = ( input: AssetPropertyValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.quality !== undefined) { - bodyParams["quality"] = input.quality; - } - if (input.timestamp !== undefined) { - bodyParams["timestamp"] = serializeAws_restJson1_1AssetPropertyTimestamp( - input.timestamp, - context - ); - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_restJson1_1AssetPropertyVariant( - input.value, - context - ); - } - return bodyParams; + return { + ...(input.quality !== undefined && { quality: input.quality }), + ...(input.timestamp !== undefined && { + timestamp: serializeAws_restJson1_1AssetPropertyTimestamp( + input.timestamp, + context + ) + }), + ...(input.value !== undefined && { + value: serializeAws_restJson1_1AssetPropertyVariant(input.value, context) + }) + }; }; const serializeAws_restJson1_1AssetPropertyValueList = ( @@ -32238,161 +32208,114 @@ const serializeAws_restJson1_1AssetPropertyVariant = ( input: AssetPropertyVariant, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.booleanValue !== undefined) { - bodyParams["booleanValue"] = input.booleanValue; - } - if (input.doubleValue !== undefined) { - bodyParams["doubleValue"] = input.doubleValue; - } - if (input.integerValue !== undefined) { - bodyParams["integerValue"] = input.integerValue; - } - if (input.stringValue !== undefined) { - bodyParams["stringValue"] = input.stringValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CloudwatchAlarmAction = ( input: CloudwatchAlarmAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.alarmName !== undefined) { - bodyParams["alarmName"] = input.alarmName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.stateReason !== undefined) { - bodyParams["stateReason"] = input.stateReason; - } - if (input.stateValue !== undefined) { - bodyParams["stateValue"] = input.stateValue; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CloudwatchMetricAction = ( input: CloudwatchMetricAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.metricNamespace !== undefined) { - bodyParams["metricNamespace"] = input.metricNamespace; - } - if (input.metricTimestamp !== undefined) { - bodyParams["metricTimestamp"] = input.metricTimestamp; - } - if (input.metricUnit !== undefined) { - bodyParams["metricUnit"] = input.metricUnit; - } - if (input.metricValue !== undefined) { - bodyParams["metricValue"] = input.metricValue; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DynamoDBAction = ( input: DynamoDBAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hashKeyField !== undefined) { - bodyParams["hashKeyField"] = input.hashKeyField; - } - if (input.hashKeyType !== undefined) { - bodyParams["hashKeyType"] = input.hashKeyType; - } - if (input.hashKeyValue !== undefined) { - bodyParams["hashKeyValue"] = input.hashKeyValue; - } - if (input.operation !== undefined) { - bodyParams["operation"] = input.operation; - } - if (input.payloadField !== undefined) { - bodyParams["payloadField"] = input.payloadField; - } - if (input.rangeKeyField !== undefined) { - bodyParams["rangeKeyField"] = input.rangeKeyField; - } - if (input.rangeKeyType !== undefined) { - bodyParams["rangeKeyType"] = input.rangeKeyType; - } - if (input.rangeKeyValue !== undefined) { - bodyParams["rangeKeyValue"] = input.rangeKeyValue; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.tableName !== undefined) { - bodyParams["tableName"] = input.tableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DynamoDBv2Action = ( input: DynamoDBv2Action, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.putItem !== undefined) { - bodyParams["putItem"] = serializeAws_restJson1_1PutItemInput( - input.putItem, - context - ); - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.putItem !== undefined && { + putItem: serializeAws_restJson1_1PutItemInput(input.putItem, context) + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1ElasticsearchAction = ( input: ElasticsearchAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endpoint !== undefined) { - bodyParams["endpoint"] = input.endpoint; - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.index !== undefined) { - bodyParams["index"] = input.index; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1FirehoseAction = ( input: FirehoseAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deliveryStreamName !== undefined) { - bodyParams["deliveryStreamName"] = input.deliveryStreamName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.separator !== undefined) { - bodyParams["separator"] = input.separator; - } - return bodyParams; + return { + ...(input.deliveryStreamName !== undefined && { + deliveryStreamName: input.deliveryStreamName + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.separator !== undefined && { separator: input.separator }) + }; }; const serializeAws_restJson1_1HeaderList = ( @@ -32408,202 +32331,149 @@ const serializeAws_restJson1_1HttpAction = ( input: HttpAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.auth !== undefined) { - bodyParams["auth"] = serializeAws_restJson1_1HttpAuthorization( - input.auth, - context - ); - } - if (input.confirmationUrl !== undefined) { - bodyParams["confirmationUrl"] = input.confirmationUrl; - } - if (input.headers !== undefined) { - bodyParams["headers"] = serializeAws_restJson1_1HeaderList( - input.headers, - context - ); - } - if (input.url !== undefined) { - bodyParams["url"] = input.url; - } - return bodyParams; + return { + ...(input.auth !== undefined && { + auth: serializeAws_restJson1_1HttpAuthorization(input.auth, context) + }), + ...(input.confirmationUrl !== undefined && { + confirmationUrl: input.confirmationUrl + }), + ...(input.headers !== undefined && { + headers: serializeAws_restJson1_1HeaderList(input.headers, context) + }), + ...(input.url !== undefined && { url: input.url }) + }; }; const serializeAws_restJson1_1HttpActionHeader = ( input: HttpActionHeader, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1HttpAuthorization = ( input: HttpAuthorization, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.sigv4 !== undefined) { - bodyParams["sigv4"] = serializeAws_restJson1_1SigV4Authorization( - input.sigv4, - context - ); - } - return bodyParams; + return { + ...(input.sigv4 !== undefined && { + sigv4: serializeAws_restJson1_1SigV4Authorization(input.sigv4, context) + }) + }; }; const serializeAws_restJson1_1HttpUrlDestinationConfiguration = ( input: HttpUrlDestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.confirmationUrl !== undefined) { - bodyParams["confirmationUrl"] = input.confirmationUrl; - } - return bodyParams; + return { + ...(input.confirmationUrl !== undefined && { + confirmationUrl: input.confirmationUrl + }) + }; }; const serializeAws_restJson1_1IotAnalyticsAction = ( input: IotAnalyticsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.channelArn !== undefined) { - bodyParams["channelArn"] = input.channelArn; - } - if (input.channelName !== undefined) { - bodyParams["channelName"] = input.channelName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.channelArn !== undefined && { channelArn: input.channelArn }), + ...(input.channelName !== undefined && { channelName: input.channelName }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1IotEventsAction = ( input: IotEventsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inputName !== undefined) { - bodyParams["inputName"] = input.inputName; - } - if (input.messageId !== undefined) { - bodyParams["messageId"] = input.messageId; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.inputName !== undefined && { inputName: input.inputName }), + ...(input.messageId !== undefined && { messageId: input.messageId }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1IotSiteWiseAction = ( input: IotSiteWiseAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.putAssetPropertyValueEntries !== undefined) { - bodyParams[ - "putAssetPropertyValueEntries" - ] = serializeAws_restJson1_1PutAssetPropertyValueEntryList( - input.putAssetPropertyValueEntries, - context - ); - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.putAssetPropertyValueEntries !== undefined && { + putAssetPropertyValueEntries: serializeAws_restJson1_1PutAssetPropertyValueEntryList( + input.putAssetPropertyValueEntries, + context + ) + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1KinesisAction = ( input: KinesisAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.partitionKey !== undefined) { - bodyParams["partitionKey"] = input.partitionKey; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.streamName !== undefined) { - bodyParams["streamName"] = input.streamName; - } - return bodyParams; + return { + ...(input.partitionKey !== undefined && { + partitionKey: input.partitionKey + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.streamName !== undefined && { streamName: input.streamName }) + }; }; const serializeAws_restJson1_1LambdaAction = ( input: LambdaAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.functionArn !== undefined) { - bodyParams["functionArn"] = input.functionArn; - } - return bodyParams; + return { + ...(input.functionArn !== undefined && { functionArn: input.functionArn }) + }; }; const serializeAws_restJson1_1LogTarget = ( input: LogTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.targetName !== undefined) { - bodyParams["targetName"] = input.targetName; - } - if (input.targetType !== undefined) { - bodyParams["targetType"] = input.targetType; - } - return bodyParams; + return { + ...(input.targetName !== undefined && { targetName: input.targetName }), + ...(input.targetType !== undefined && { targetType: input.targetType }) + }; }; const serializeAws_restJson1_1LoggingOptionsPayload = ( input: LoggingOptionsPayload, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logLevel !== undefined) { - bodyParams["logLevel"] = input.logLevel; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.logLevel !== undefined && { logLevel: input.logLevel }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1PutAssetPropertyValueEntry = ( input: PutAssetPropertyValueEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assetId !== undefined) { - bodyParams["assetId"] = input.assetId; - } - if (input.entryId !== undefined) { - bodyParams["entryId"] = input.entryId; - } - if (input.propertyAlias !== undefined) { - bodyParams["propertyAlias"] = input.propertyAlias; - } - if (input.propertyId !== undefined) { - bodyParams["propertyId"] = input.propertyId; - } - if (input.propertyValues !== undefined) { - bodyParams[ - "propertyValues" - ] = serializeAws_restJson1_1AssetPropertyValueList( - input.propertyValues, - context - ); - } - return bodyParams; + 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_restJson1_1AssetPropertyValueList( + input.propertyValues, + context + ) + }) + }; }; const serializeAws_restJson1_1PutAssetPropertyValueEntryList = ( @@ -32619,195 +32489,142 @@ const serializeAws_restJson1_1PutItemInput = ( input: PutItemInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tableName !== undefined) { - bodyParams["tableName"] = input.tableName; - } - return bodyParams; + return { + ...(input.tableName !== undefined && { tableName: input.tableName }) + }; }; const serializeAws_restJson1_1RepublishAction = ( input: RepublishAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.qos !== undefined) { - bodyParams["qos"] = input.qos; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.topic !== undefined) { - bodyParams["topic"] = input.topic; - } - return bodyParams; + return { + ...(input.qos !== undefined && { qos: input.qos }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.topic !== undefined && { topic: input.topic }) + }; }; const serializeAws_restJson1_1S3Action = ( input: S3Action, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - if (input.cannedAcl !== undefined) { - bodyParams["cannedAcl"] = input.cannedAcl; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1SalesforceAction = ( input: SalesforceAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.token !== undefined) { - bodyParams["token"] = input.token; - } - if (input.url !== undefined) { - bodyParams["url"] = input.url; - } - return bodyParams; + return { + ...(input.token !== undefined && { token: input.token }), + ...(input.url !== undefined && { url: input.url }) + }; }; const serializeAws_restJson1_1SigV4Authorization = ( input: SigV4Authorization, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.serviceName !== undefined) { - bodyParams["serviceName"] = input.serviceName; - } - if (input.signingRegion !== undefined) { - bodyParams["signingRegion"] = input.signingRegion; - } - return bodyParams; + return { + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.serviceName !== undefined && { serviceName: input.serviceName }), + ...(input.signingRegion !== undefined && { + signingRegion: input.signingRegion + }) + }; }; const serializeAws_restJson1_1SnsAction = ( input: SnsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.messageFormat !== undefined) { - bodyParams["messageFormat"] = input.messageFormat; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.targetArn !== undefined) { - bodyParams["targetArn"] = input.targetArn; - } - return bodyParams; + return { + ...(input.messageFormat !== undefined && { + messageFormat: input.messageFormat + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.targetArn !== undefined && { targetArn: input.targetArn }) + }; }; const serializeAws_restJson1_1SqsAction = ( input: SqsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.queueUrl !== undefined) { - bodyParams["queueUrl"] = input.queueUrl; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.useBase64 !== undefined) { - bodyParams["useBase64"] = input.useBase64; - } - return bodyParams; + return { + ...(input.queueUrl !== undefined && { queueUrl: input.queueUrl }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.useBase64 !== undefined && { useBase64: input.useBase64 }) + }; }; const serializeAws_restJson1_1StepFunctionsAction = ( input: StepFunctionsAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.executionNamePrefix !== undefined) { - bodyParams["executionNamePrefix"] = input.executionNamePrefix; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.stateMachineName !== undefined) { - bodyParams["stateMachineName"] = input.stateMachineName; - } - return bodyParams; + return { + ...(input.executionNamePrefix !== undefined && { + executionNamePrefix: input.executionNamePrefix + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.stateMachineName !== undefined && { + stateMachineName: input.stateMachineName + }) + }; }; const serializeAws_restJson1_1TopicRuleDestinationConfiguration = ( input: TopicRuleDestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.httpUrlConfiguration !== undefined) { - bodyParams[ - "httpUrlConfiguration" - ] = serializeAws_restJson1_1HttpUrlDestinationConfiguration( - input.httpUrlConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.httpUrlConfiguration !== undefined && { + httpUrlConfiguration: serializeAws_restJson1_1HttpUrlDestinationConfiguration( + input.httpUrlConfiguration, + context + ) + }) + }; }; const serializeAws_restJson1_1TopicRulePayload = ( input: TopicRulePayload, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actions !== undefined) { - bodyParams["actions"] = serializeAws_restJson1_1ActionList( - input.actions, - context - ); - } - if (input.awsIotSqlVersion !== undefined) { - bodyParams["awsIotSqlVersion"] = input.awsIotSqlVersion; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.errorAction !== undefined) { - bodyParams["errorAction"] = serializeAws_restJson1_1Action( - input.errorAction, - context - ); - } - if (input.ruleDisabled !== undefined) { - bodyParams["ruleDisabled"] = input.ruleDisabled; - } - if (input.sql !== undefined) { - bodyParams["sql"] = input.sql; - } - return bodyParams; + return { + ...(input.actions !== undefined && { + actions: serializeAws_restJson1_1ActionList(input.actions, context) + }), + ...(input.awsIotSqlVersion !== undefined && { + awsIotSqlVersion: input.awsIotSqlVersion + }), + ...(input.description !== undefined && { description: input.description }), + ...(input.errorAction !== undefined && { + errorAction: serializeAws_restJson1_1Action(input.errorAction, context) + }), + ...(input.ruleDisabled !== undefined && { + ruleDisabled: input.ruleDisabled + }), + ...(input.sql !== undefined && { sql: input.sql }) + }; }; const serializeAws_restJson1_1AuthInfo = ( input: AuthInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionType !== undefined) { - bodyParams["actionType"] = input.actionType; - } - if (input.resources !== undefined) { - bodyParams["resources"] = serializeAws_restJson1_1Resources( - input.resources, - context - ); - } - return bodyParams; + return { + ...(input.actionType !== undefined && { actionType: input.actionType }), + ...(input.resources !== undefined && { + resources: serializeAws_restJson1_1Resources(input.resources, context) + }) + }; }; const serializeAws_restJson1_1AuthInfos = ( @@ -32821,31 +32638,26 @@ const serializeAws_restJson1_1AuthorizerConfig = ( input: AuthorizerConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.allowAuthorizerOverride !== undefined) { - bodyParams["allowAuthorizerOverride"] = input.allowAuthorizerOverride; - } - if (input.defaultAuthorizerName !== undefined) { - bodyParams["defaultAuthorizerName"] = input.defaultAuthorizerName; - } - return bodyParams; + return { + ...(input.allowAuthorizerOverride !== undefined && { + allowAuthorizerOverride: input.allowAuthorizerOverride + }), + ...(input.defaultAuthorizerName !== undefined && { + defaultAuthorizerName: input.defaultAuthorizerName + }) + }; }; const serializeAws_restJson1_1HttpContext = ( input: HttpContext, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.headers !== undefined) { - bodyParams["headers"] = serializeAws_restJson1_1HttpHeaders( - input.headers, - context - ); - } - if (input.queryString !== undefined) { - bodyParams["queryString"] = input.queryString; - } - return bodyParams; + return { + ...(input.headers !== undefined && { + headers: serializeAws_restJson1_1HttpHeaders(input.headers, context) + }), + ...(input.queryString !== undefined && { queryString: input.queryString }) + }; }; const serializeAws_restJson1_1HttpHeaders = ( @@ -32862,17 +32674,13 @@ const serializeAws_restJson1_1MqttContext = ( input: MqttContext, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientId !== undefined) { - bodyParams["clientId"] = input.clientId; - } - if (input.password !== undefined) { - bodyParams["password"] = context.base64Encoder(input.password); - } - if (input.username !== undefined) { - bodyParams["username"] = input.username; - } - return bodyParams; + return { + ...(input.clientId !== undefined && { clientId: input.clientId }), + ...(input.password !== undefined && { + password: context.base64Encoder(input.password) + }), + ...(input.username !== undefined && { username: input.username }) + }; }; const serializeAws_restJson1_1Parameters = ( @@ -32899,14 +32707,12 @@ const serializeAws_restJson1_1RegistrationConfig = ( input: RegistrationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.templateBody !== undefined) { - bodyParams["templateBody"] = input.templateBody; - } - return bodyParams; + return { + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.templateBody !== undefined && { + templateBody: input.templateBody + }) + }; }; const serializeAws_restJson1_1Resources = ( @@ -32927,25 +32733,19 @@ const serializeAws_restJson1_1TlsContext = ( input: TlsContext, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.serverName !== undefined) { - bodyParams["serverName"] = input.serverName; - } - return bodyParams; + return { + ...(input.serverName !== undefined && { serverName: input.serverName }) + }; }; const serializeAws_restJson1_1Field = ( input: Field, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_restJson1_1Fields = ( @@ -32966,84 +32766,73 @@ const serializeAws_restJson1_1ThingGroupIndexingConfiguration = ( input: ThingGroupIndexingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.customFields !== undefined) { - bodyParams["customFields"] = serializeAws_restJson1_1Fields( - input.customFields, - context - ); - } - if (input.managedFields !== undefined) { - bodyParams["managedFields"] = serializeAws_restJson1_1Fields( - input.managedFields, - context - ); - } - if (input.thingGroupIndexingMode !== undefined) { - bodyParams["thingGroupIndexingMode"] = input.thingGroupIndexingMode; - } - return bodyParams; + return { + ...(input.customFields !== undefined && { + customFields: serializeAws_restJson1_1Fields(input.customFields, context) + }), + ...(input.managedFields !== undefined && { + managedFields: serializeAws_restJson1_1Fields( + input.managedFields, + context + ) + }), + ...(input.thingGroupIndexingMode !== undefined && { + thingGroupIndexingMode: input.thingGroupIndexingMode + }) + }; }; const serializeAws_restJson1_1ThingIndexingConfiguration = ( input: ThingIndexingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.customFields !== undefined) { - bodyParams["customFields"] = serializeAws_restJson1_1Fields( - input.customFields, - context - ); - } - if (input.managedFields !== undefined) { - bodyParams["managedFields"] = serializeAws_restJson1_1Fields( - input.managedFields, - context - ); - } - if (input.thingConnectivityIndexingMode !== undefined) { - bodyParams["thingConnectivityIndexingMode"] = - input.thingConnectivityIndexingMode; - } - if (input.thingIndexingMode !== undefined) { - bodyParams["thingIndexingMode"] = input.thingIndexingMode; - } - return bodyParams; + return { + ...(input.customFields !== undefined && { + customFields: serializeAws_restJson1_1Fields(input.customFields, context) + }), + ...(input.managedFields !== undefined && { + managedFields: serializeAws_restJson1_1Fields( + input.managedFields, + context + ) + }), + ...(input.thingConnectivityIndexingMode !== undefined && { + thingConnectivityIndexingMode: input.thingConnectivityIndexingMode + }), + ...(input.thingIndexingMode !== undefined && { + thingIndexingMode: input.thingIndexingMode + }) + }; }; const serializeAws_restJson1_1AbortConfig = ( input: AbortConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.criteriaList !== undefined) { - bodyParams["criteriaList"] = serializeAws_restJson1_1AbortCriteriaList( - input.criteriaList, - context - ); - } - return bodyParams; + return { + ...(input.criteriaList !== undefined && { + criteriaList: serializeAws_restJson1_1AbortCriteriaList( + input.criteriaList, + context + ) + }) + }; }; const serializeAws_restJson1_1AbortCriteria = ( input: AbortCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = input.action; - } - if (input.failureType !== undefined) { - bodyParams["failureType"] = input.failureType; - } - if (input.minNumberOfExecutedThings !== undefined) { - bodyParams["minNumberOfExecutedThings"] = input.minNumberOfExecutedThings; - } - if (input.thresholdPercentage !== undefined) { - bodyParams["thresholdPercentage"] = input.thresholdPercentage; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1AbortCriteriaList = ( @@ -33059,41 +32848,37 @@ const serializeAws_restJson1_1ExponentialRolloutRate = ( input: ExponentialRolloutRate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.baseRatePerMinute !== undefined) { - bodyParams["baseRatePerMinute"] = input.baseRatePerMinute; - } - if (input.incrementFactor !== undefined) { - bodyParams["incrementFactor"] = input.incrementFactor; - } - if (input.rateIncreaseCriteria !== undefined) { - bodyParams[ - "rateIncreaseCriteria" - ] = serializeAws_restJson1_1RateIncreaseCriteria( - input.rateIncreaseCriteria, - context - ); - } - return bodyParams; + return { + ...(input.baseRatePerMinute !== undefined && { + baseRatePerMinute: input.baseRatePerMinute + }), + ...(input.incrementFactor !== undefined && { + incrementFactor: input.incrementFactor + }), + ...(input.rateIncreaseCriteria !== undefined && { + rateIncreaseCriteria: serializeAws_restJson1_1RateIncreaseCriteria( + input.rateIncreaseCriteria, + context + ) + }) + }; }; const serializeAws_restJson1_1JobExecutionsRolloutConfig = ( input: JobExecutionsRolloutConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.exponentialRate !== undefined) { - bodyParams[ - "exponentialRate" - ] = serializeAws_restJson1_1ExponentialRolloutRate( - input.exponentialRate, - context - ); - } - if (input.maximumPerMinute !== undefined) { - bodyParams["maximumPerMinute"] = input.maximumPerMinute; - } - return bodyParams; + return { + ...(input.exponentialRate !== undefined && { + exponentialRate: serializeAws_restJson1_1ExponentialRolloutRate( + input.exponentialRate, + context + ) + }), + ...(input.maximumPerMinute !== undefined && { + maximumPerMinute: input.maximumPerMinute + }) + }; }; const serializeAws_restJson1_1JobTargets = ( @@ -33107,39 +32892,37 @@ const serializeAws_restJson1_1PresignedUrlConfig = ( input: PresignedUrlConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expiresInSec !== undefined) { - bodyParams["expiresInSec"] = input.expiresInSec; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.expiresInSec !== undefined && { + expiresInSec: input.expiresInSec + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1RateIncreaseCriteria = ( input: RateIncreaseCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.numberOfNotifiedThings !== undefined) { - bodyParams["numberOfNotifiedThings"] = input.numberOfNotifiedThings; - } - if (input.numberOfSucceededThings !== undefined) { - bodyParams["numberOfSucceededThings"] = input.numberOfSucceededThings; - } - return bodyParams; + return { + ...(input.numberOfNotifiedThings !== undefined && { + numberOfNotifiedThings: input.numberOfNotifiedThings + }), + ...(input.numberOfSucceededThings !== undefined && { + numberOfSucceededThings: input.numberOfSucceededThings + }) + }; }; const serializeAws_restJson1_1TimeoutConfig = ( input: TimeoutConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inProgressTimeoutInMinutes !== undefined) { - bodyParams["inProgressTimeoutInMinutes"] = input.inProgressTimeoutInMinutes; - } - return bodyParams; + return { + ...(input.inProgressTimeoutInMinutes !== undefined && { + inProgressTimeoutInMinutes: input.inProgressTimeoutInMinutes + }) + }; }; const serializeAws_restJson1_1DetailsMap = ( @@ -33176,166 +32959,152 @@ const serializeAws_restJson1_1AwsJobExecutionsRolloutConfig = ( input: AwsJobExecutionsRolloutConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maximumPerMinute !== undefined) { - bodyParams["maximumPerMinute"] = input.maximumPerMinute; - } - return bodyParams; + return { + ...(input.maximumPerMinute !== undefined && { + maximumPerMinute: input.maximumPerMinute + }) + }; }; const serializeAws_restJson1_1AwsJobPresignedUrlConfig = ( input: AwsJobPresignedUrlConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expiresInSec !== undefined) { - bodyParams["expiresInSec"] = input.expiresInSec; - } - return bodyParams; + return { + ...(input.expiresInSec !== undefined && { + expiresInSec: input.expiresInSec + }) + }; }; const serializeAws_restJson1_1CodeSigning = ( input: CodeSigning, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.awsSignerJobId !== undefined) { - bodyParams["awsSignerJobId"] = input.awsSignerJobId; - } - if (input.customCodeSigning !== undefined) { - bodyParams["customCodeSigning"] = serializeAws_restJson1_1CustomCodeSigning( - input.customCodeSigning, - context - ); - } - if (input.startSigningJobParameter !== undefined) { - bodyParams[ - "startSigningJobParameter" - ] = serializeAws_restJson1_1StartSigningJobParameter( - input.startSigningJobParameter, - context - ); - } - return bodyParams; + return { + ...(input.awsSignerJobId !== undefined && { + awsSignerJobId: input.awsSignerJobId + }), + ...(input.customCodeSigning !== undefined && { + customCodeSigning: serializeAws_restJson1_1CustomCodeSigning( + input.customCodeSigning, + context + ) + }), + ...(input.startSigningJobParameter !== undefined && { + startSigningJobParameter: serializeAws_restJson1_1StartSigningJobParameter( + input.startSigningJobParameter, + context + ) + }) + }; }; const serializeAws_restJson1_1CodeSigningCertificateChain = ( input: CodeSigningCertificateChain, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateName !== undefined) { - bodyParams["certificateName"] = input.certificateName; - } - if (input.inlineDocument !== undefined) { - bodyParams["inlineDocument"] = input.inlineDocument; - } - return bodyParams; + return { + ...(input.certificateName !== undefined && { + certificateName: input.certificateName + }), + ...(input.inlineDocument !== undefined && { + inlineDocument: input.inlineDocument + }) + }; }; const serializeAws_restJson1_1CodeSigningSignature = ( input: CodeSigningSignature, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inlineDocument !== undefined) { - bodyParams["inlineDocument"] = context.base64Encoder(input.inlineDocument); - } - return bodyParams; + return { + ...(input.inlineDocument !== undefined && { + inlineDocument: context.base64Encoder(input.inlineDocument) + }) + }; }; const serializeAws_restJson1_1CustomCodeSigning = ( input: CustomCodeSigning, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateChain !== undefined) { - bodyParams[ - "certificateChain" - ] = serializeAws_restJson1_1CodeSigningCertificateChain( - input.certificateChain, - context - ); - } - if (input.hashAlgorithm !== undefined) { - bodyParams["hashAlgorithm"] = input.hashAlgorithm; - } - if (input.signature !== undefined) { - bodyParams["signature"] = serializeAws_restJson1_1CodeSigningSignature( - input.signature, - context - ); - } - if (input.signatureAlgorithm !== undefined) { - bodyParams["signatureAlgorithm"] = input.signatureAlgorithm; - } - return bodyParams; + return { + ...(input.certificateChain !== undefined && { + certificateChain: serializeAws_restJson1_1CodeSigningCertificateChain( + input.certificateChain, + context + ) + }), + ...(input.hashAlgorithm !== undefined && { + hashAlgorithm: input.hashAlgorithm + }), + ...(input.signature !== undefined && { + signature: serializeAws_restJson1_1CodeSigningSignature( + input.signature, + context + ) + }), + ...(input.signatureAlgorithm !== undefined && { + signatureAlgorithm: input.signatureAlgorithm + }) + }; }; const serializeAws_restJson1_1Destination = ( input: Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3Destination !== undefined) { - bodyParams["s3Destination"] = serializeAws_restJson1_1S3Destination( - input.s3Destination, - context - ); - } - return bodyParams; + return { + ...(input.s3Destination !== undefined && { + s3Destination: serializeAws_restJson1_1S3Destination( + input.s3Destination, + context + ) + }) + }; }; const serializeAws_restJson1_1FileLocation = ( input: FileLocation, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.s3Location !== undefined) { - bodyParams["s3Location"] = serializeAws_restJson1_1S3Location( - input.s3Location, - context - ); - } - if (input.stream !== undefined) { - bodyParams["stream"] = serializeAws_restJson1_1_Stream( - input.stream, - context - ); - } - return bodyParams; + context: __SerdeContext +): any => { + return { + ...(input.s3Location !== undefined && { + s3Location: serializeAws_restJson1_1S3Location(input.s3Location, context) + }), + ...(input.stream !== undefined && { + stream: serializeAws_restJson1_1_Stream(input.stream, context) + }) + }; }; const serializeAws_restJson1_1OTAUpdateFile = ( input: OTAUpdateFile, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_restJson1_1AttributesMap( - input.attributes, - context - ); - } - if (input.codeSigning !== undefined) { - bodyParams["codeSigning"] = serializeAws_restJson1_1CodeSigning( - input.codeSigning, - context - ); - } - if (input.fileLocation !== undefined) { - bodyParams["fileLocation"] = serializeAws_restJson1_1FileLocation( - input.fileLocation, - context - ); - } - if (input.fileName !== undefined) { - bodyParams["fileName"] = input.fileName; - } - if (input.fileVersion !== undefined) { - bodyParams["fileVersion"] = input.fileVersion; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1AttributesMap( + input.attributes, + context + ) + }), + ...(input.codeSigning !== undefined && { + codeSigning: serializeAws_restJson1_1CodeSigning( + input.codeSigning, + context + ) + }), + ...(input.fileLocation !== undefined && { + fileLocation: serializeAws_restJson1_1FileLocation( + input.fileLocation, + context + ) + }), + ...(input.fileName !== undefined && { fileName: input.fileName }), + ...(input.fileVersion !== undefined && { fileVersion: input.fileVersion }) + }; }; const serializeAws_restJson1_1OTAUpdateFiles = ( @@ -33358,70 +33127,58 @@ const serializeAws_restJson1_1S3Destination = ( input: S3Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.prefix !== undefined && { prefix: input.prefix }) + }; }; const serializeAws_restJson1_1SigningProfileParameter = ( input: SigningProfileParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateArn !== undefined) { - bodyParams["certificateArn"] = input.certificateArn; - } - if (input.certificatePathOnDevice !== undefined) { - bodyParams["certificatePathOnDevice"] = input.certificatePathOnDevice; - } - if (input.platform !== undefined) { - bodyParams["platform"] = input.platform; - } - return bodyParams; + return { + ...(input.certificateArn !== undefined && { + certificateArn: input.certificateArn + }), + ...(input.certificatePathOnDevice !== undefined && { + certificatePathOnDevice: input.certificatePathOnDevice + }), + ...(input.platform !== undefined && { platform: input.platform }) + }; }; const serializeAws_restJson1_1StartSigningJobParameter = ( input: StartSigningJobParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1Destination( - input.destination, - context - ); - } - if (input.signingProfileName !== undefined) { - bodyParams["signingProfileName"] = input.signingProfileName; - } - if (input.signingProfileParameter !== undefined) { - bodyParams[ - "signingProfileParameter" - ] = serializeAws_restJson1_1SigningProfileParameter( - input.signingProfileParameter, - context - ); - } - return bodyParams; + return { + ...(input.destination !== undefined && { + destination: serializeAws_restJson1_1Destination( + input.destination, + context + ) + }), + ...(input.signingProfileName !== undefined && { + signingProfileName: input.signingProfileName + }), + ...(input.signingProfileParameter !== undefined && { + signingProfileParameter: serializeAws_restJson1_1SigningProfileParameter( + input.signingProfileParameter, + context + ) + }) + }; }; const serializeAws_restJson1_1_Stream = ( input: _Stream, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fileId !== undefined) { - bodyParams["fileId"] = input.fileId; - } - if (input.streamId !== undefined) { - bodyParams["streamId"] = input.streamId; - } - return bodyParams; + return { + ...(input.fileId !== undefined && { fileId: input.fileId }), + ...(input.streamId !== undefined && { streamId: input.streamId }) + }; }; const serializeAws_restJson1_1Targets = ( @@ -33435,17 +33192,12 @@ const serializeAws_restJson1_1AttributePayload = ( input: AttributePayload, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_restJson1_1Attributes( - input.attributes, - context - ); - } - if (input.merge !== undefined) { - bodyParams["merge"] = input.merge; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1Attributes(input.attributes, context) + }), + ...(input.merge !== undefined && { merge: input.merge }) + }; }; const serializeAws_restJson1_1Attributes = ( @@ -33462,11 +33214,11 @@ const serializeAws_restJson1_1BillingGroupProperties = ( input: BillingGroupProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.billingGroupDescription !== undefined) { - bodyParams["billingGroupDescription"] = input.billingGroupDescription; - } - return bodyParams; + return { + ...(input.billingGroupDescription !== undefined && { + billingGroupDescription: input.billingGroupDescription + }) + }; }; const serializeAws_restJson1_1SearchableAttributes = ( @@ -33487,145 +33239,127 @@ const serializeAws_restJson1_1ThingGroupProperties = ( input: ThingGroupProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributePayload !== undefined) { - bodyParams["attributePayload"] = serializeAws_restJson1_1AttributePayload( - input.attributePayload, - context - ); - } - if (input.thingGroupDescription !== undefined) { - bodyParams["thingGroupDescription"] = input.thingGroupDescription; - } - return bodyParams; + return { + ...(input.attributePayload !== undefined && { + attributePayload: serializeAws_restJson1_1AttributePayload( + input.attributePayload, + context + ) + }), + ...(input.thingGroupDescription !== undefined && { + thingGroupDescription: input.thingGroupDescription + }) + }; }; const serializeAws_restJson1_1ThingTypeProperties = ( input: ThingTypeProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.searchableAttributes !== undefined) { - bodyParams[ - "searchableAttributes" - ] = serializeAws_restJson1_1SearchableAttributes( - input.searchableAttributes, - context - ); - } - if (input.thingTypeDescription !== undefined) { - bodyParams["thingTypeDescription"] = input.thingTypeDescription; - } - return bodyParams; + return { + ...(input.searchableAttributes !== undefined && { + searchableAttributes: serializeAws_restJson1_1SearchableAttributes( + input.searchableAttributes, + context + ) + }), + ...(input.thingTypeDescription !== undefined && { + thingTypeDescription: input.thingTypeDescription + }) + }; }; const serializeAws_restJson1_1AddThingsToThingGroupParams = ( input: AddThingsToThingGroupParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.overrideDynamicGroups !== undefined) { - bodyParams["overrideDynamicGroups"] = input.overrideDynamicGroups; - } - if (input.thingGroupNames !== undefined) { - bodyParams["thingGroupNames"] = serializeAws_restJson1_1ThingGroupNames( - input.thingGroupNames, - context - ); - } - return bodyParams; + return { + ...(input.overrideDynamicGroups !== undefined && { + overrideDynamicGroups: input.overrideDynamicGroups + }), + ...(input.thingGroupNames !== undefined && { + thingGroupNames: serializeAws_restJson1_1ThingGroupNames( + input.thingGroupNames, + context + ) + }) + }; }; const serializeAws_restJson1_1EnableIoTLoggingParams = ( input: EnableIoTLoggingParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logLevel !== undefined) { - bodyParams["logLevel"] = input.logLevel; - } - if (input.roleArnForLogging !== undefined) { - bodyParams["roleArnForLogging"] = input.roleArnForLogging; - } - return bodyParams; + return { + ...(input.logLevel !== undefined && { logLevel: input.logLevel }), + ...(input.roleArnForLogging !== undefined && { + roleArnForLogging: input.roleArnForLogging + }) + }; }; const serializeAws_restJson1_1MitigationActionParams = ( input: MitigationActionParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addThingsToThingGroupParams !== undefined) { - bodyParams[ - "addThingsToThingGroupParams" - ] = serializeAws_restJson1_1AddThingsToThingGroupParams( - input.addThingsToThingGroupParams, - context - ); - } - if (input.enableIoTLoggingParams !== undefined) { - bodyParams[ - "enableIoTLoggingParams" - ] = serializeAws_restJson1_1EnableIoTLoggingParams( - input.enableIoTLoggingParams, - context - ); - } - if (input.publishFindingToSnsParams !== undefined) { - bodyParams[ - "publishFindingToSnsParams" - ] = serializeAws_restJson1_1PublishFindingToSnsParams( - input.publishFindingToSnsParams, - context - ); - } - if (input.replaceDefaultPolicyVersionParams !== undefined) { - bodyParams[ - "replaceDefaultPolicyVersionParams" - ] = serializeAws_restJson1_1ReplaceDefaultPolicyVersionParams( - input.replaceDefaultPolicyVersionParams, - context - ); - } - if (input.updateCACertificateParams !== undefined) { - bodyParams[ - "updateCACertificateParams" - ] = serializeAws_restJson1_1UpdateCACertificateParams( - input.updateCACertificateParams, - context - ); - } - if (input.updateDeviceCertificateParams !== undefined) { - bodyParams[ - "updateDeviceCertificateParams" - ] = serializeAws_restJson1_1UpdateDeviceCertificateParams( - input.updateDeviceCertificateParams, - context - ); - } - return bodyParams; + return { + ...(input.addThingsToThingGroupParams !== undefined && { + addThingsToThingGroupParams: serializeAws_restJson1_1AddThingsToThingGroupParams( + input.addThingsToThingGroupParams, + context + ) + }), + ...(input.enableIoTLoggingParams !== undefined && { + enableIoTLoggingParams: serializeAws_restJson1_1EnableIoTLoggingParams( + input.enableIoTLoggingParams, + context + ) + }), + ...(input.publishFindingToSnsParams !== undefined && { + publishFindingToSnsParams: serializeAws_restJson1_1PublishFindingToSnsParams( + input.publishFindingToSnsParams, + context + ) + }), + ...(input.replaceDefaultPolicyVersionParams !== undefined && { + replaceDefaultPolicyVersionParams: serializeAws_restJson1_1ReplaceDefaultPolicyVersionParams( + input.replaceDefaultPolicyVersionParams, + context + ) + }), + ...(input.updateCACertificateParams !== undefined && { + updateCACertificateParams: serializeAws_restJson1_1UpdateCACertificateParams( + input.updateCACertificateParams, + context + ) + }), + ...(input.updateDeviceCertificateParams !== undefined && { + updateDeviceCertificateParams: serializeAws_restJson1_1UpdateDeviceCertificateParams( + input.updateDeviceCertificateParams, + context + ) + }) + }; }; const serializeAws_restJson1_1PublishFindingToSnsParams = ( input: PublishFindingToSnsParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.topicArn !== undefined) { - bodyParams["topicArn"] = input.topicArn; - } - return bodyParams; + return { + ...(input.topicArn !== undefined && { topicArn: input.topicArn }) + }; }; const serializeAws_restJson1_1ReplaceDefaultPolicyVersionParams = ( input: ReplaceDefaultPolicyVersionParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.templateName !== undefined) { - bodyParams["templateName"] = input.templateName; - } - return bodyParams; + return { + ...(input.templateName !== undefined && { + templateName: input.templateName + }) + }; }; const serializeAws_restJson1_1ThingGroupNames = ( @@ -33639,33 +33373,27 @@ const serializeAws_restJson1_1UpdateCACertificateParams = ( input: UpdateCACertificateParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = input.action; - } - return bodyParams; + return { + ...(input.action !== undefined && { action: input.action }) + }; }; const serializeAws_restJson1_1UpdateDeviceCertificateParams = ( input: UpdateDeviceCertificateParams, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.action !== undefined) { - bodyParams["action"] = input.action; - } - return bodyParams; + return { + ...(input.action !== undefined && { action: input.action }) + }; }; const serializeAws_restJson1_1AuditCheckConfiguration = ( input: AuditCheckConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - return bodyParams; + return { + ...(input.enabled !== undefined && { enabled: input.enabled }) + }; }; const serializeAws_restJson1_1AuditCheckConfigurations = ( @@ -33711,42 +33439,29 @@ const serializeAws_restJson1_1AuditMitigationActionsTaskTarget = ( input: AuditMitigationActionsTaskTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.auditCheckToReasonCodeFilter !== undefined) { - bodyParams[ - "auditCheckToReasonCodeFilter" - ] = serializeAws_restJson1_1AuditCheckToReasonCodeFilter( - input.auditCheckToReasonCodeFilter, - context - ); - } - if (input.auditTaskId !== undefined) { - bodyParams["auditTaskId"] = input.auditTaskId; - } - if (input.findingIds !== undefined) { - bodyParams["findingIds"] = serializeAws_restJson1_1FindingIds( - input.findingIds, - context - ); - } - return bodyParams; + return { + ...(input.auditCheckToReasonCodeFilter !== undefined && { + auditCheckToReasonCodeFilter: serializeAws_restJson1_1AuditCheckToReasonCodeFilter( + input.auditCheckToReasonCodeFilter, + context + ) + }), + ...(input.auditTaskId !== undefined && { auditTaskId: input.auditTaskId }), + ...(input.findingIds !== undefined && { + findingIds: serializeAws_restJson1_1FindingIds(input.findingIds, context) + }) + }; }; const serializeAws_restJson1_1AuditNotificationTarget = ( input: AuditNotificationTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.targetArn !== undefined) { - bodyParams["targetArn"] = input.targetArn; - } - return bodyParams; + return { + ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }), + ...(input.targetArn !== undefined && { targetArn: input.targetArn }) + }; }; const serializeAws_restJson1_1AuditNotificationTargetConfigurations = ( @@ -33780,14 +33495,12 @@ const serializeAws_restJson1_1PolicyVersionIdentifier = ( input: PolicyVersionIdentifier, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.policyName !== undefined) { - bodyParams["policyName"] = input.policyName; - } - if (input.policyVersionId !== undefined) { - bodyParams["policyVersionId"] = input.policyVersionId; - } - return bodyParams; + return { + ...(input.policyName !== undefined && { policyName: input.policyName }), + ...(input.policyVersionId !== undefined && { + policyVersionId: input.policyVersionId + }) + }; }; const serializeAws_restJson1_1ReasonForNonComplianceCodes = ( @@ -33801,37 +33514,29 @@ const serializeAws_restJson1_1ResourceIdentifier = ( input: ResourceIdentifier, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.account !== undefined) { - bodyParams["account"] = input.account; - } - if (input.caCertificateId !== undefined) { - bodyParams["caCertificateId"] = input.caCertificateId; - } - if (input.clientId !== undefined) { - bodyParams["clientId"] = input.clientId; - } - if (input.cognitoIdentityPoolId !== undefined) { - bodyParams["cognitoIdentityPoolId"] = input.cognitoIdentityPoolId; - } - if (input.deviceCertificateId !== undefined) { - bodyParams["deviceCertificateId"] = input.deviceCertificateId; - } - if (input.iamRoleArn !== undefined) { - bodyParams["iamRoleArn"] = input.iamRoleArn; - } - if (input.policyVersionIdentifier !== undefined) { - bodyParams[ - "policyVersionIdentifier" - ] = serializeAws_restJson1_1PolicyVersionIdentifier( - input.policyVersionIdentifier, - context - ); - } - if (input.roleAliasArn !== undefined) { - bodyParams["roleAliasArn"] = input.roleAliasArn; - } - return bodyParams; + 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_restJson1_1PolicyVersionIdentifier( + input.policyVersionIdentifier, + context + ) + }), + ...(input.roleAliasArn !== undefined && { + roleAliasArn: input.roleAliasArn + }) + }; }; const serializeAws_restJson1_1TargetAuditCheckNames = ( @@ -33852,14 +33557,12 @@ const serializeAws_restJson1_1AlertTarget = ( input: AlertTarget, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.alertTargetArn !== undefined) { - bodyParams["alertTargetArn"] = input.alertTargetArn; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.alertTargetArn !== undefined && { + alertTargetArn: input.alertTargetArn + }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1AlertTargets = ( @@ -33876,56 +33579,45 @@ const serializeAws_restJson1_1Behavior = ( input: Behavior, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.criteria !== undefined) { - bodyParams["criteria"] = serializeAws_restJson1_1BehaviorCriteria( - input.criteria, - context - ); - } - if (input.metric !== undefined) { - bodyParams["metric"] = input.metric; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.criteria !== undefined && { + criteria: serializeAws_restJson1_1BehaviorCriteria( + input.criteria, + context + ) + }), + ...(input.metric !== undefined && { metric: input.metric }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1BehaviorCriteria = ( input: BehaviorCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.comparisonOperator !== undefined) { - bodyParams["comparisonOperator"] = input.comparisonOperator; - } - if (input.consecutiveDatapointsToAlarm !== undefined) { - bodyParams["consecutiveDatapointsToAlarm"] = - input.consecutiveDatapointsToAlarm; - } - if (input.consecutiveDatapointsToClear !== undefined) { - bodyParams["consecutiveDatapointsToClear"] = - input.consecutiveDatapointsToClear; - } - if (input.durationSeconds !== undefined) { - bodyParams["durationSeconds"] = input.durationSeconds; - } - if (input.statisticalThreshold !== undefined) { - bodyParams[ - "statisticalThreshold" - ] = serializeAws_restJson1_1StatisticalThreshold( - input.statisticalThreshold, - context - ); - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_restJson1_1MetricValue( - input.value, - context - ); - } - return bodyParams; + 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_restJson1_1StatisticalThreshold( + input.statisticalThreshold, + context + ) + }), + ...(input.value !== undefined && { + value: serializeAws_restJson1_1MetricValue(input.value, context) + }) + }; }; const serializeAws_restJson1_1Behaviors = ( @@ -33946,17 +33638,15 @@ const serializeAws_restJson1_1MetricValue = ( input: MetricValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cidrs !== undefined) { - bodyParams["cidrs"] = serializeAws_restJson1_1Cidrs(input.cidrs, context); - } - if (input.count !== undefined) { - bodyParams["count"] = input.count; - } - if (input.ports !== undefined) { - bodyParams["ports"] = serializeAws_restJson1_1Ports(input.ports, context); - } - return bodyParams; + return { + ...(input.cidrs !== undefined && { + cidrs: serializeAws_restJson1_1Cidrs(input.cidrs, context) + }), + ...(input.count !== undefined && { count: input.count }), + ...(input.ports !== undefined && { + ports: serializeAws_restJson1_1Ports(input.ports, context) + }) + }; }; const serializeAws_restJson1_1Ports = ( @@ -33970,28 +33660,21 @@ const serializeAws_restJson1_1StatisticalThreshold = ( input: StatisticalThreshold, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.statistic !== undefined) { - bodyParams["statistic"] = input.statistic; - } - return bodyParams; + return { + ...(input.statistic !== undefined && { statistic: input.statistic }) + }; }; const serializeAws_restJson1_1StreamFile = ( input: StreamFile, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fileId !== undefined) { - bodyParams["fileId"] = input.fileId; - } - if (input.s3Location !== undefined) { - bodyParams["s3Location"] = serializeAws_restJson1_1S3Location( - input.s3Location, - context - ); - } - return bodyParams; + return { + ...(input.fileId !== undefined && { fileId: input.fileId }), + ...(input.s3Location !== undefined && { + s3Location: serializeAws_restJson1_1S3Location(input.s3Location, context) + }) + }; }; const serializeAws_restJson1_1StreamFiles = ( @@ -34005,17 +33688,11 @@ const serializeAws_restJson1_1S3Location = ( input: S3Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.key !== undefined && { key: input.key }), + ...(input.version !== undefined && { version: input.version }) + }; }; const deserializeAws_restJson1_1Configuration = ( diff --git a/clients/client-iotanalytics/protocols/Aws_restJson1_1.ts b/clients/client-iotanalytics/protocols/Aws_restJson1_1.ts index d0b025bf1222..e50fa29ee0d2 100644 --- a/clients/client-iotanalytics/protocols/Aws_restJson1_1.ts +++ b/clients/client-iotanalytics/protocols/Aws_restJson1_1.ts @@ -5329,20 +5329,16 @@ const serializeAws_restJson1_1AddAttributesActivity = ( input: AddAttributesActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_restJson1_1AttributeNameMapping( - input.attributes, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1AttributeNameMapping( + input.attributes, + context + ) + }), + ...(input.name !== undefined && { name: input.name }), + ...(input.next !== undefined && { next: input.next }) + }; }; const serializeAws_restJson1_1AttributeNameMapping = ( @@ -5366,128 +5362,95 @@ const serializeAws_restJson1_1ChannelActivity = ( input: ChannelActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.channelName !== undefined) { - bodyParams["channelName"] = input.channelName; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + return { + ...(input.channelName !== undefined && { channelName: input.channelName }), + ...(input.name !== undefined && { name: input.name }), + ...(input.next !== undefined && { next: input.next }) + }; }; const serializeAws_restJson1_1ChannelStorage = ( input: ChannelStorage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.customerManagedS3 !== undefined) { - bodyParams[ - "customerManagedS3" - ] = serializeAws_restJson1_1CustomerManagedChannelS3Storage( - input.customerManagedS3, - context - ); - } - if (input.serviceManagedS3 !== undefined) { - bodyParams[ - "serviceManagedS3" - ] = serializeAws_restJson1_1ServiceManagedChannelS3Storage( - input.serviceManagedS3, - context - ); - } - return bodyParams; + return { + ...(input.customerManagedS3 !== undefined && { + customerManagedS3: serializeAws_restJson1_1CustomerManagedChannelS3Storage( + input.customerManagedS3, + context + ) + }), + ...(input.serviceManagedS3 !== undefined && { + serviceManagedS3: serializeAws_restJson1_1ServiceManagedChannelS3Storage( + input.serviceManagedS3, + context + ) + }) + }; }; const serializeAws_restJson1_1ContainerDatasetAction = ( input: ContainerDatasetAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.executionRoleArn !== undefined) { - bodyParams["executionRoleArn"] = input.executionRoleArn; - } - if (input.image !== undefined) { - bodyParams["image"] = input.image; - } - if (input.resourceConfiguration !== undefined) { - bodyParams[ - "resourceConfiguration" - ] = serializeAws_restJson1_1ResourceConfiguration( - input.resourceConfiguration, - context - ); - } - if (input.variables !== undefined) { - bodyParams["variables"] = serializeAws_restJson1_1Variables( - input.variables, - context - ); - } - return bodyParams; + return { + ...(input.executionRoleArn !== undefined && { + executionRoleArn: input.executionRoleArn + }), + ...(input.image !== undefined && { image: input.image }), + ...(input.resourceConfiguration !== undefined && { + resourceConfiguration: serializeAws_restJson1_1ResourceConfiguration( + input.resourceConfiguration, + context + ) + }), + ...(input.variables !== undefined && { + variables: serializeAws_restJson1_1Variables(input.variables, context) + }) + }; }; const serializeAws_restJson1_1CustomerManagedChannelS3Storage = ( input: CustomerManagedChannelS3Storage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.keyPrefix !== undefined) { - bodyParams["keyPrefix"] = input.keyPrefix; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.keyPrefix !== undefined && { keyPrefix: input.keyPrefix }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1CustomerManagedDatastoreS3Storage = ( input: CustomerManagedDatastoreS3Storage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.keyPrefix !== undefined) { - bodyParams["keyPrefix"] = input.keyPrefix; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.keyPrefix !== undefined && { keyPrefix: input.keyPrefix }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1DatasetAction = ( input: DatasetAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.actionName !== undefined) { - bodyParams["actionName"] = input.actionName; - } - if (input.containerAction !== undefined) { - bodyParams[ - "containerAction" - ] = serializeAws_restJson1_1ContainerDatasetAction( - input.containerAction, - context - ); - } - if (input.queryAction !== undefined) { - bodyParams["queryAction"] = serializeAws_restJson1_1SqlQueryDatasetAction( - input.queryAction, - context - ); - } - return bodyParams; + return { + ...(input.actionName !== undefined && { actionName: input.actionName }), + ...(input.containerAction !== undefined && { + containerAction: serializeAws_restJson1_1ContainerDatasetAction( + input.containerAction, + context + ) + }), + ...(input.queryAction !== undefined && { + queryAction: serializeAws_restJson1_1SqlQueryDatasetAction( + input.queryAction, + context + ) + }) + }; }; const serializeAws_restJson1_1DatasetActions = ( @@ -5503,43 +5466,35 @@ const serializeAws_restJson1_1DatasetContentDeliveryDestination = ( input: DatasetContentDeliveryDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.iotEventsDestinationConfiguration !== undefined) { - bodyParams[ - "iotEventsDestinationConfiguration" - ] = serializeAws_restJson1_1IotEventsDestinationConfiguration( - input.iotEventsDestinationConfiguration, - context - ); - } - if (input.s3DestinationConfiguration !== undefined) { - bodyParams[ - "s3DestinationConfiguration" - ] = serializeAws_restJson1_1S3DestinationConfiguration( - input.s3DestinationConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.iotEventsDestinationConfiguration !== undefined && { + iotEventsDestinationConfiguration: serializeAws_restJson1_1IotEventsDestinationConfiguration( + input.iotEventsDestinationConfiguration, + context + ) + }), + ...(input.s3DestinationConfiguration !== undefined && { + s3DestinationConfiguration: serializeAws_restJson1_1S3DestinationConfiguration( + input.s3DestinationConfiguration, + context + ) + }) + }; }; const serializeAws_restJson1_1DatasetContentDeliveryRule = ( input: DatasetContentDeliveryRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destination !== undefined) { - bodyParams[ - "destination" - ] = serializeAws_restJson1_1DatasetContentDeliveryDestination( - input.destination, - context - ); - } - if (input.entryName !== undefined) { - bodyParams["entryName"] = input.entryName; - } - return bodyParams; + return { + ...(input.destination !== undefined && { + destination: serializeAws_restJson1_1DatasetContentDeliveryDestination( + input.destination, + context + ) + }), + ...(input.entryName !== undefined && { entryName: input.entryName }) + }; }; const serializeAws_restJson1_1DatasetContentDeliveryRules = ( @@ -5555,31 +5510,23 @@ const serializeAws_restJson1_1DatasetContentVersionValue = ( input: DatasetContentVersionValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetName !== undefined) { - bodyParams["datasetName"] = input.datasetName; - } - return bodyParams; + return { + ...(input.datasetName !== undefined && { datasetName: input.datasetName }) + }; }; const serializeAws_restJson1_1DatasetTrigger = ( input: DatasetTrigger, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataset !== undefined) { - bodyParams["dataset"] = serializeAws_restJson1_1TriggeringDataset( - input.dataset, - context - ); - } - if (input.schedule !== undefined) { - bodyParams["schedule"] = serializeAws_restJson1_1Schedule( - input.schedule, - context - ); - } - return bodyParams; + return { + ...(input.dataset !== undefined && { + dataset: serializeAws_restJson1_1TriggeringDataset(input.dataset, context) + }), + ...(input.schedule !== undefined && { + schedule: serializeAws_restJson1_1Schedule(input.schedule, context) + }) + }; }; const serializeAws_restJson1_1DatasetTriggers = ( @@ -5595,200 +5542,140 @@ const serializeAws_restJson1_1DatastoreActivity = ( input: DatastoreActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datastoreName !== undefined) { - bodyParams["datastoreName"] = input.datastoreName; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.datastoreName !== undefined && { + datastoreName: input.datastoreName + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1DatastoreStorage = ( input: DatastoreStorage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.customerManagedS3 !== undefined) { - bodyParams[ - "customerManagedS3" - ] = serializeAws_restJson1_1CustomerManagedDatastoreS3Storage( - input.customerManagedS3, - context - ); - } - if (input.serviceManagedS3 !== undefined) { - bodyParams[ - "serviceManagedS3" - ] = serializeAws_restJson1_1ServiceManagedDatastoreS3Storage( - input.serviceManagedS3, - context - ); - } - return bodyParams; + return { + ...(input.customerManagedS3 !== undefined && { + customerManagedS3: serializeAws_restJson1_1CustomerManagedDatastoreS3Storage( + input.customerManagedS3, + context + ) + }), + ...(input.serviceManagedS3 !== undefined && { + serviceManagedS3: serializeAws_restJson1_1ServiceManagedDatastoreS3Storage( + input.serviceManagedS3, + context + ) + }) + }; }; const serializeAws_restJson1_1DeltaTime = ( input: DeltaTime, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.offsetSeconds !== undefined) { - bodyParams["offsetSeconds"] = input.offsetSeconds; - } - if (input.timeExpression !== undefined) { - bodyParams["timeExpression"] = input.timeExpression; - } - return bodyParams; + return { + ...(input.offsetSeconds !== undefined && { + offsetSeconds: input.offsetSeconds + }), + ...(input.timeExpression !== undefined && { + timeExpression: input.timeExpression + }) + }; }; const serializeAws_restJson1_1DeviceRegistryEnrichActivity = ( input: DeviceRegistryEnrichActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attribute !== undefined) { - bodyParams["attribute"] = input.attribute; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.thingName !== undefined) { - bodyParams["thingName"] = input.thingName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DeviceShadowEnrichActivity = ( input: DeviceShadowEnrichActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attribute !== undefined) { - bodyParams["attribute"] = input.attribute; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.thingName !== undefined) { - bodyParams["thingName"] = input.thingName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1FilterActivity = ( input: FilterActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filter !== undefined) { - bodyParams["filter"] = input.filter; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + return { + ...(input.filter !== undefined && { filter: input.filter }), + ...(input.name !== undefined && { name: input.name }), + ...(input.next !== undefined && { next: input.next }) + }; }; const serializeAws_restJson1_1GlueConfiguration = ( input: GlueConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.databaseName !== undefined) { - bodyParams["databaseName"] = input.databaseName; - } - if (input.tableName !== undefined) { - bodyParams["tableName"] = input.tableName; - } - return bodyParams; + return { + ...(input.databaseName !== undefined && { + databaseName: input.databaseName + }), + ...(input.tableName !== undefined && { tableName: input.tableName }) + }; }; const serializeAws_restJson1_1IotEventsDestinationConfiguration = ( input: IotEventsDestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.inputName !== undefined) { - bodyParams["inputName"] = input.inputName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.inputName !== undefined && { inputName: input.inputName }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1LambdaActivity = ( input: LambdaActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.batchSize !== undefined) { - bodyParams["batchSize"] = input.batchSize; - } - if (input.lambdaName !== undefined) { - bodyParams["lambdaName"] = input.lambdaName; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1LoggingOptions = ( input: LoggingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.enabled !== undefined) { - bodyParams["enabled"] = input.enabled; - } - if (input.level !== undefined) { - bodyParams["level"] = input.level; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.enabled !== undefined && { enabled: input.enabled }), + ...(input.level !== undefined && { level: input.level }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1MathActivity = ( input: MathActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attribute !== undefined) { - bodyParams["attribute"] = input.attribute; - } - if (input.math !== undefined) { - bodyParams["math"] = input.math; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1MessagePayloads = ( @@ -5802,11 +5689,9 @@ const serializeAws_restJson1_1OutputFileUriValue = ( input: OutputFileUriValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fileName !== undefined) { - bodyParams["fileName"] = input.fileName; - } - return bodyParams; + return { + ...(input.fileName !== undefined && { fileName: input.fileName }) + }; }; const serializeAws_restJson1_1PipelineActivities = ( @@ -5822,90 +5707,67 @@ const serializeAws_restJson1_1PipelineActivity = ( input: PipelineActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addAttributes !== undefined) { - bodyParams["addAttributes"] = serializeAws_restJson1_1AddAttributesActivity( - input.addAttributes, - context - ); - } - if (input.channel !== undefined) { - bodyParams["channel"] = serializeAws_restJson1_1ChannelActivity( - input.channel, - context - ); - } - if (input.datastore !== undefined) { - bodyParams["datastore"] = serializeAws_restJson1_1DatastoreActivity( - input.datastore, - context - ); - } - if (input.deviceRegistryEnrich !== undefined) { - bodyParams[ - "deviceRegistryEnrich" - ] = serializeAws_restJson1_1DeviceRegistryEnrichActivity( - input.deviceRegistryEnrich, - context - ); - } - if (input.deviceShadowEnrich !== undefined) { - bodyParams[ - "deviceShadowEnrich" - ] = serializeAws_restJson1_1DeviceShadowEnrichActivity( - input.deviceShadowEnrich, - context - ); - } - if (input.filter !== undefined) { - bodyParams["filter"] = serializeAws_restJson1_1FilterActivity( - input.filter, - context - ); - } - if (input.lambda !== undefined) { - bodyParams["lambda"] = serializeAws_restJson1_1LambdaActivity( - input.lambda, - context - ); - } - if (input.math !== undefined) { - bodyParams["math"] = serializeAws_restJson1_1MathActivity( - input.math, - context - ); - } - if (input.removeAttributes !== undefined) { - bodyParams[ - "removeAttributes" - ] = serializeAws_restJson1_1RemoveAttributesActivity( - input.removeAttributes, - context - ); - } - if (input.selectAttributes !== undefined) { - bodyParams[ - "selectAttributes" - ] = serializeAws_restJson1_1SelectAttributesActivity( - input.selectAttributes, - context - ); - } - return bodyParams; + return { + ...(input.addAttributes !== undefined && { + addAttributes: serializeAws_restJson1_1AddAttributesActivity( + input.addAttributes, + context + ) + }), + ...(input.channel !== undefined && { + channel: serializeAws_restJson1_1ChannelActivity(input.channel, context) + }), + ...(input.datastore !== undefined && { + datastore: serializeAws_restJson1_1DatastoreActivity( + input.datastore, + context + ) + }), + ...(input.deviceRegistryEnrich !== undefined && { + deviceRegistryEnrich: serializeAws_restJson1_1DeviceRegistryEnrichActivity( + input.deviceRegistryEnrich, + context + ) + }), + ...(input.deviceShadowEnrich !== undefined && { + deviceShadowEnrich: serializeAws_restJson1_1DeviceShadowEnrichActivity( + input.deviceShadowEnrich, + context + ) + }), + ...(input.filter !== undefined && { + filter: serializeAws_restJson1_1FilterActivity(input.filter, context) + }), + ...(input.lambda !== undefined && { + lambda: serializeAws_restJson1_1LambdaActivity(input.lambda, context) + }), + ...(input.math !== undefined && { + math: serializeAws_restJson1_1MathActivity(input.math, context) + }), + ...(input.removeAttributes !== undefined && { + removeAttributes: serializeAws_restJson1_1RemoveAttributesActivity( + input.removeAttributes, + context + ) + }), + ...(input.selectAttributes !== undefined && { + selectAttributes: serializeAws_restJson1_1SelectAttributesActivity( + input.selectAttributes, + context + ) + }) + }; }; const serializeAws_restJson1_1QueryFilter = ( input: QueryFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deltaTime !== undefined) { - bodyParams["deltaTime"] = serializeAws_restJson1_1DeltaTime( - input.deltaTime, - context - ); - } - return bodyParams; + return { + ...(input.deltaTime !== undefined && { + deltaTime: serializeAws_restJson1_1DeltaTime(input.deltaTime, context) + }) + }; }; const serializeAws_restJson1_1QueryFilters = ( @@ -5921,149 +5783,118 @@ const serializeAws_restJson1_1RemoveAttributesActivity = ( input: RemoveAttributesActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_restJson1_1AttributeNames( - input.attributes, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1AttributeNames( + input.attributes, + context + ) + }), + ...(input.name !== undefined && { name: input.name }), + ...(input.next !== undefined && { next: input.next }) + }; }; const serializeAws_restJson1_1ResourceConfiguration = ( input: ResourceConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.computeType !== undefined) { - bodyParams["computeType"] = input.computeType; - } - if (input.volumeSizeInGB !== undefined) { - bodyParams["volumeSizeInGB"] = input.volumeSizeInGB; - } - return bodyParams; + return { + ...(input.computeType !== undefined && { computeType: input.computeType }), + ...(input.volumeSizeInGB !== undefined && { + volumeSizeInGB: input.volumeSizeInGB + }) + }; }; const serializeAws_restJson1_1RetentionPeriod = ( input: RetentionPeriod, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.numberOfDays !== undefined) { - bodyParams["numberOfDays"] = input.numberOfDays; - } - if (input.unlimited !== undefined) { - bodyParams["unlimited"] = input.unlimited; - } - return bodyParams; + return { + ...(input.numberOfDays !== undefined && { + numberOfDays: input.numberOfDays + }), + ...(input.unlimited !== undefined && { unlimited: input.unlimited }) + }; }; const serializeAws_restJson1_1S3DestinationConfiguration = ( input: S3DestinationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.glueConfiguration !== undefined) { - bodyParams["glueConfiguration"] = serializeAws_restJson1_1GlueConfiguration( - input.glueConfiguration, - context - ); - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.glueConfiguration !== undefined && { + glueConfiguration: serializeAws_restJson1_1GlueConfiguration( + input.glueConfiguration, + context + ) + }), + ...(input.key !== undefined && { key: input.key }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_restJson1_1Schedule = ( input: Schedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.expression !== undefined) { - bodyParams["expression"] = input.expression; - } - return bodyParams; + return { + ...(input.expression !== undefined && { expression: input.expression }) + }; }; const serializeAws_restJson1_1SelectAttributesActivity = ( input: SelectAttributesActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributes !== undefined) { - bodyParams["attributes"] = serializeAws_restJson1_1AttributeNames( - input.attributes, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.next !== undefined) { - bodyParams["next"] = input.next; - } - return bodyParams; + return { + ...(input.attributes !== undefined && { + attributes: serializeAws_restJson1_1AttributeNames( + input.attributes, + context + ) + }), + ...(input.name !== undefined && { name: input.name }), + ...(input.next !== undefined && { next: input.next }) + }; }; const serializeAws_restJson1_1ServiceManagedChannelS3Storage = ( input: ServiceManagedChannelS3Storage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1ServiceManagedDatastoreS3Storage = ( input: ServiceManagedDatastoreS3Storage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1SqlQueryDatasetAction = ( input: SqlQueryDatasetAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_restJson1_1QueryFilters( - input.filters, - context - ); - } - if (input.sqlQuery !== undefined) { - bodyParams["sqlQuery"] = input.sqlQuery; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_restJson1_1QueryFilters(input.filters, context) + }), + ...(input.sqlQuery !== undefined && { sqlQuery: input.sqlQuery }) + }; }; const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1TagList = ( @@ -6077,44 +5908,32 @@ const serializeAws_restJson1_1TriggeringDataset = ( input: TriggeringDataset, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1Variable = ( input: Variable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetContentVersionValue !== undefined) { - bodyParams[ - "datasetContentVersionValue" - ] = serializeAws_restJson1_1DatasetContentVersionValue( - input.datasetContentVersionValue, - context - ); - } - if (input.doubleValue !== undefined) { - bodyParams["doubleValue"] = input.doubleValue; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.outputFileUriValue !== undefined) { - bodyParams[ - "outputFileUriValue" - ] = serializeAws_restJson1_1OutputFileUriValue( - input.outputFileUriValue, - context - ); - } - if (input.stringValue !== undefined) { - bodyParams["stringValue"] = input.stringValue; - } - return bodyParams; + return { + ...(input.datasetContentVersionValue !== undefined && { + datasetContentVersionValue: serializeAws_restJson1_1DatasetContentVersionValue( + input.datasetContentVersionValue, + context + ) + }), + ...(input.doubleValue !== undefined && { doubleValue: input.doubleValue }), + ...(input.name !== undefined && { name: input.name }), + ...(input.outputFileUriValue !== undefined && { + outputFileUriValue: serializeAws_restJson1_1OutputFileUriValue( + input.outputFileUriValue, + context + ) + }), + ...(input.stringValue !== undefined && { stringValue: input.stringValue }) + }; }; const serializeAws_restJson1_1Variables = ( @@ -6128,28 +5947,22 @@ const serializeAws_restJson1_1VersioningConfiguration = ( input: VersioningConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxVersions !== undefined) { - bodyParams["maxVersions"] = input.maxVersions; - } - if (input.unlimited !== undefined) { - bodyParams["unlimited"] = input.unlimited; - } - return bodyParams; + return { + ...(input.maxVersions !== undefined && { maxVersions: input.maxVersions }), + ...(input.unlimited !== undefined && { unlimited: input.unlimited }) + }; }; const serializeAws_restJson1_1Message = ( input: Message, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.messageId !== undefined) { - bodyParams["messageId"] = input.messageId; - } - if (input.payload !== undefined) { - bodyParams["payload"] = context.base64Encoder(input.payload); - } - return bodyParams; + return { + ...(input.messageId !== undefined && { messageId: input.messageId }), + ...(input.payload !== undefined && { + payload: context.base64Encoder(input.payload) + }) + }; }; const serializeAws_restJson1_1Messages = ( diff --git a/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts b/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts index 3287ce6176d7..177a4542ac65 100644 --- a/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts +++ b/clients/client-iotsecuretunneling/protocols/Aws_json1_1.ts @@ -612,96 +612,75 @@ const serializeAws_json1_1CloseTunnelRequest = ( input: CloseTunnelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.delete !== undefined) { - bodyParams["delete"] = input.delete; - } - if (input.tunnelId !== undefined) { - bodyParams["tunnelId"] = input.tunnelId; - } - return bodyParams; + return { + ...(input.delete !== undefined && { delete: input.delete }), + ...(input.tunnelId !== undefined && { tunnelId: input.tunnelId }) + }; }; const serializeAws_json1_1DescribeTunnelRequest = ( input: DescribeTunnelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tunnelId !== undefined) { - bodyParams["tunnelId"] = input.tunnelId; - } - return bodyParams; + return { + ...(input.tunnelId !== undefined && { tunnelId: input.tunnelId }) + }; }; const serializeAws_json1_1DestinationConfig = ( input: DestinationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.services !== undefined) { - bodyParams["services"] = serializeAws_json1_1ServiceList( - input.services, - context - ); - } - if (input.thingName !== undefined) { - bodyParams["thingName"] = input.thingName; - } - return bodyParams; + return { + ...(input.services !== undefined && { + services: serializeAws_json1_1ServiceList(input.services, context) + }), + ...(input.thingName !== undefined && { thingName: input.thingName }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1ListTunnelsRequest = ( input: ListTunnelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.thingName !== undefined) { - bodyParams["thingName"] = input.thingName; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.thingName !== undefined && { thingName: input.thingName }) + }; }; const serializeAws_json1_1OpenTunnelRequest = ( input: OpenTunnelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.destinationConfig !== undefined) { - bodyParams["destinationConfig"] = serializeAws_json1_1DestinationConfig( - input.destinationConfig, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.timeoutConfig !== undefined) { - bodyParams["timeoutConfig"] = serializeAws_json1_1TimeoutConfig( - input.timeoutConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ServiceList = ( @@ -712,14 +691,10 @@ const serializeAws_json1_1ServiceList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -740,42 +715,35 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1TimeoutConfig = ( input: TimeoutConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxLifetimeTimeoutMinutes !== undefined) { - bodyParams["maxLifetimeTimeoutMinutes"] = input.maxLifetimeTimeoutMinutes; - } - return bodyParams; + return { + ...(input.maxLifetimeTimeoutMinutes !== undefined && { + maxLifetimeTimeoutMinutes: input.maxLifetimeTimeoutMinutes + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) + }) + }; }; const deserializeAws_json1_1CloseTunnelResponse = ( diff --git a/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts b/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts index 10dcf87158a0..dd94d8a6413f 100644 --- a/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts +++ b/clients/client-iotthingsgraph/protocols/Aws_json1_1.ts @@ -4210,575 +4210,458 @@ const serializeAws_json1_1AssociateEntityToThingRequest = ( input: AssociateEntityToThingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.entityId !== undefined) { - bodyParams["entityId"] = input.entityId; - } - if (input.namespaceVersion !== undefined) { - bodyParams["namespaceVersion"] = input.namespaceVersion; - } - if (input.thingName !== undefined) { - bodyParams["thingName"] = input.thingName; - } - return bodyParams; + return { + ...(input.entityId !== undefined && { entityId: input.entityId }), + ...(input.namespaceVersion !== undefined && { + namespaceVersion: input.namespaceVersion + }), + ...(input.thingName !== undefined && { thingName: input.thingName }) + }; }; const serializeAws_json1_1CreateFlowTemplateRequest = ( input: CreateFlowTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.compatibleNamespaceVersion !== undefined) { - bodyParams["compatibleNamespaceVersion"] = input.compatibleNamespaceVersion; - } - if (input.definition !== undefined) { - bodyParams["definition"] = serializeAws_json1_1DefinitionDocument( - input.definition, - context - ); - } - return bodyParams; + return { + ...(input.compatibleNamespaceVersion !== undefined && { + compatibleNamespaceVersion: input.compatibleNamespaceVersion + }), + ...(input.definition !== undefined && { + definition: serializeAws_json1_1DefinitionDocument( + input.definition, + context + ) + }) + }; }; const serializeAws_json1_1CreateSystemInstanceRequest = ( input: CreateSystemInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.definition !== undefined) { - bodyParams["definition"] = serializeAws_json1_1DefinitionDocument( - input.definition, - context - ); - } - if (input.flowActionsRoleArn !== undefined) { - bodyParams["flowActionsRoleArn"] = input.flowActionsRoleArn; - } - if (input.greengrassGroupName !== undefined) { - bodyParams["greengrassGroupName"] = input.greengrassGroupName; - } - if (input.metricsConfiguration !== undefined) { - bodyParams[ - "metricsConfiguration" - ] = serializeAws_json1_1MetricsConfiguration( - input.metricsConfiguration, - context - ); - } - if (input.s3BucketName !== undefined) { - bodyParams["s3BucketName"] = input.s3BucketName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.target !== undefined) { - bodyParams["target"] = input.target; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateSystemTemplateRequest = ( input: CreateSystemTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.compatibleNamespaceVersion !== undefined) { - bodyParams["compatibleNamespaceVersion"] = input.compatibleNamespaceVersion; - } - if (input.definition !== undefined) { - bodyParams["definition"] = serializeAws_json1_1DefinitionDocument( - input.definition, - context - ); - } - return bodyParams; + return { + ...(input.compatibleNamespaceVersion !== undefined && { + compatibleNamespaceVersion: input.compatibleNamespaceVersion + }), + ...(input.definition !== undefined && { + definition: serializeAws_json1_1DefinitionDocument( + input.definition, + context + ) + }) + }; }; const serializeAws_json1_1DeleteFlowTemplateRequest = ( input: DeleteFlowTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DeleteNamespaceRequest = ( input: DeleteNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DeleteSystemInstanceRequest = ( input: DeleteSystemInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DeleteSystemTemplateRequest = ( input: DeleteSystemTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DeploySystemInstanceRequest = ( input: DeploySystemInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DeprecateFlowTemplateRequest = ( input: DeprecateFlowTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DeprecateSystemTemplateRequest = ( input: DeprecateSystemTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1DescribeNamespaceRequest = ( input: DescribeNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.namespaceName !== undefined) { - bodyParams["namespaceName"] = input.namespaceName; - } - return bodyParams; + return { + ...(input.namespaceName !== undefined && { + namespaceName: input.namespaceName + }) + }; }; const serializeAws_json1_1DissociateEntityFromThingRequest = ( input: DissociateEntityFromThingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.entityType !== undefined) { - bodyParams["entityType"] = input.entityType; - } - if (input.thingName !== undefined) { - bodyParams["thingName"] = input.thingName; - } - return bodyParams; + return { + ...(input.entityType !== undefined && { entityType: input.entityType }), + ...(input.thingName !== undefined && { thingName: input.thingName }) + }; }; const serializeAws_json1_1GetEntitiesRequest = ( input: GetEntitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ids !== undefined) { - bodyParams["ids"] = serializeAws_json1_1Urns(input.ids, context); - } - if (input.namespaceVersion !== undefined) { - bodyParams["namespaceVersion"] = input.namespaceVersion; - } - return bodyParams; + return { + ...(input.ids !== undefined && { + ids: serializeAws_json1_1Urns(input.ids, context) + }), + ...(input.namespaceVersion !== undefined && { + namespaceVersion: input.namespaceVersion + }) + }; }; const serializeAws_json1_1GetFlowTemplateRequest = ( input: GetFlowTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.revisionNumber !== undefined) { - bodyParams["revisionNumber"] = input.revisionNumber; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.revisionNumber !== undefined && { + revisionNumber: input.revisionNumber + }) + }; }; const serializeAws_json1_1GetFlowTemplateRevisionsRequest = ( input: GetFlowTemplateRevisionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetNamespaceDeletionStatusRequest = ( input: GetNamespaceDeletionStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetSystemInstanceRequest = ( input: GetSystemInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1GetSystemTemplateRequest = ( input: GetSystemTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.revisionNumber !== undefined) { - bodyParams["revisionNumber"] = input.revisionNumber; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.revisionNumber !== undefined && { + revisionNumber: input.revisionNumber + }) + }; }; const serializeAws_json1_1GetSystemTemplateRevisionsRequest = ( input: GetSystemTemplateRevisionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetUploadStatusRequest = ( input: GetUploadStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.uploadId !== undefined) { - bodyParams["uploadId"] = input.uploadId; - } - return bodyParams; + return { + ...(input.uploadId !== undefined && { uploadId: input.uploadId }) + }; }; const serializeAws_json1_1ListFlowExecutionMessagesRequest = ( input: ListFlowExecutionMessagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.flowExecutionId !== undefined) { - bodyParams["flowExecutionId"] = input.flowExecutionId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.flowExecutionId !== undefined && { + flowExecutionId: input.flowExecutionId + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_1SearchEntitiesRequest = ( input: SearchEntitiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.entityTypes !== undefined) { - bodyParams["entityTypes"] = serializeAws_json1_1EntityTypes( - input.entityTypes, - context - ); - } - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1EntityFilters( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.namespaceVersion !== undefined) { - bodyParams["namespaceVersion"] = input.namespaceVersion; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SearchFlowExecutionsRequest = ( input: SearchFlowExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.flowExecutionId !== undefined) { - bodyParams["flowExecutionId"] = input.flowExecutionId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - if (input.systemInstanceId !== undefined) { - bodyParams["systemInstanceId"] = input.systemInstanceId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1SearchFlowTemplatesRequest = ( input: SearchFlowTemplatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1FlowTemplateFilters( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_json1_1FlowTemplateFilters(input.filters, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1SearchSystemInstancesRequest = ( input: SearchSystemInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1SystemInstanceFilters( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_json1_1SystemInstanceFilters(input.filters, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1SearchSystemTemplatesRequest = ( input: SearchSystemTemplatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.filters !== undefined) { - bodyParams["filters"] = serializeAws_json1_1SystemTemplateFilters( - input.filters, - context - ); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.filters !== undefined && { + filters: serializeAws_json1_1SystemTemplateFilters(input.filters, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1SearchThingsRequest = ( input: SearchThingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.entityId !== undefined) { - bodyParams["entityId"] = input.entityId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.namespaceVersion !== undefined) { - bodyParams["namespaceVersion"] = input.namespaceVersion; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1UndeploySystemInstanceRequest = ( input: UndeploySystemInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateFlowTemplateRequest = ( input: UpdateFlowTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.compatibleNamespaceVersion !== undefined) { - bodyParams["compatibleNamespaceVersion"] = input.compatibleNamespaceVersion; - } - if (input.definition !== undefined) { - bodyParams["definition"] = serializeAws_json1_1DefinitionDocument( - input.definition, - context - ); - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.compatibleNamespaceVersion !== undefined && { + compatibleNamespaceVersion: input.compatibleNamespaceVersion + }), + ...(input.definition !== undefined && { + definition: serializeAws_json1_1DefinitionDocument( + input.definition, + context + ) + }), + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1UpdateSystemTemplateRequest = ( input: UpdateSystemTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.compatibleNamespaceVersion !== undefined) { - bodyParams["compatibleNamespaceVersion"] = input.compatibleNamespaceVersion; - } - if (input.definition !== undefined) { - bodyParams["definition"] = serializeAws_json1_1DefinitionDocument( - input.definition, - context - ); - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - return bodyParams; + return { + ...(input.compatibleNamespaceVersion !== undefined && { + compatibleNamespaceVersion: input.compatibleNamespaceVersion + }), + ...(input.definition !== undefined && { + definition: serializeAws_json1_1DefinitionDocument( + input.definition, + context + ) + }), + ...(input.id !== undefined && { id: input.id }) + }; }; const serializeAws_json1_1UploadEntityDefinitionsRequest = ( input: UploadEntityDefinitionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.deprecateExistingEntities !== undefined) { - bodyParams["deprecateExistingEntities"] = input.deprecateExistingEntities; - } - if (input.document !== undefined) { - bodyParams["document"] = serializeAws_json1_1DefinitionDocument( - input.document, - context - ); - } - if (input.syncWithPublicNamespace !== undefined) { - bodyParams["syncWithPublicNamespace"] = input.syncWithPublicNamespace; - } - return bodyParams; + return { + ...(input.deprecateExistingEntities !== undefined && { + deprecateExistingEntities: input.deprecateExistingEntities + }), + ...(input.document !== undefined && { + document: serializeAws_json1_1DefinitionDocument(input.document, context) + }), + ...(input.syncWithPublicNamespace !== undefined && { + syncWithPublicNamespace: input.syncWithPublicNamespace + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -4799,14 +4682,10 @@ const serializeAws_json1_1DefinitionDocument = ( input: DefinitionDocument, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - if (input.text !== undefined) { - bodyParams["text"] = input.text; - } - return bodyParams; + return { + ...(input.language !== undefined && { language: input.language }), + ...(input.text !== undefined && { text: input.text }) + }; }; const serializeAws_json1_1Urns = ( @@ -4820,17 +4699,12 @@ const serializeAws_json1_1EntityFilter = ( input: EntityFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_json1_1EntityFilterValues( - input.value, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { + value: serializeAws_json1_1EntityFilterValues(input.value, context) + }) + }; }; const serializeAws_json1_1EntityFilterValues = ( @@ -4858,17 +4732,12 @@ const serializeAws_json1_1FlowTemplateFilter = ( input: FlowTemplateFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_json1_1FlowTemplateFilterValues( - input.value, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { + value: serializeAws_json1_1FlowTemplateFilterValues(input.value, context) + }) + }; }; const serializeAws_json1_1FlowTemplateFilterValues = ( @@ -4891,31 +4760,29 @@ const serializeAws_json1_1MetricsConfiguration = ( input: MetricsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cloudMetricEnabled !== undefined) { - bodyParams["cloudMetricEnabled"] = input.cloudMetricEnabled; - } - if (input.metricRuleRoleArn !== undefined) { - bodyParams["metricRuleRoleArn"] = input.metricRuleRoleArn; - } - return bodyParams; + return { + ...(input.cloudMetricEnabled !== undefined && { + cloudMetricEnabled: input.cloudMetricEnabled + }), + ...(input.metricRuleRoleArn !== undefined && { + metricRuleRoleArn: input.metricRuleRoleArn + }) + }; }; const serializeAws_json1_1SystemInstanceFilter = ( input: SystemInstanceFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_json1_1SystemInstanceFilterValues( - input.value, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { + value: serializeAws_json1_1SystemInstanceFilterValues( + input.value, + context + ) + }) + }; }; const serializeAws_json1_1SystemInstanceFilterValues = ( @@ -4938,17 +4805,15 @@ const serializeAws_json1_1SystemTemplateFilter = ( input: SystemTemplateFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_json1_1SystemTemplateFilterValues( - input.value, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { + value: serializeAws_json1_1SystemTemplateFilterValues( + input.value, + context + ) + }) + }; }; const serializeAws_json1_1SystemTemplateFilterValues = ( diff --git a/clients/client-kafka/protocols/Aws_restJson1_1.ts b/clients/client-kafka/protocols/Aws_restJson1_1.ts index 57dca8568e09..a45087f585f9 100644 --- a/clients/client-kafka/protocols/Aws_restJson1_1.ts +++ b/clients/client-kafka/protocols/Aws_restJson1_1.ts @@ -3341,215 +3341,203 @@ const serializeAws_restJson1_1BrokerEBSVolumeInfo = ( input: BrokerEBSVolumeInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KafkaBrokerNodeId !== undefined) { - bodyParams["kafkaBrokerNodeId"] = input.KafkaBrokerNodeId; - } - if (input.VolumeSizeGB !== undefined) { - bodyParams["volumeSizeGB"] = input.VolumeSizeGB; - } - return bodyParams; + return { + ...(input.KafkaBrokerNodeId !== undefined && { + kafkaBrokerNodeId: input.KafkaBrokerNodeId + }), + ...(input.VolumeSizeGB !== undefined && { + volumeSizeGB: input.VolumeSizeGB + }) + }; }; const serializeAws_restJson1_1BrokerNodeGroupInfo = ( input: BrokerNodeGroupInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BrokerAZDistribution !== undefined) { - bodyParams["brokerAZDistribution"] = input.BrokerAZDistribution; - } - if (input.ClientSubnets !== undefined) { - bodyParams["clientSubnets"] = serializeAws_restJson1_1__listOf__string( - input.ClientSubnets, - context - ); - } - if (input.InstanceType !== undefined) { - bodyParams["instanceType"] = input.InstanceType; - } - if (input.SecurityGroups !== undefined) { - bodyParams["securityGroups"] = serializeAws_restJson1_1__listOf__string( - input.SecurityGroups, - context - ); - } - if (input.StorageInfo !== undefined) { - bodyParams["storageInfo"] = serializeAws_restJson1_1StorageInfo( - input.StorageInfo, - context - ); - } - return bodyParams; + return { + ...(input.BrokerAZDistribution !== undefined && { + brokerAZDistribution: input.BrokerAZDistribution + }), + ...(input.ClientSubnets !== undefined && { + clientSubnets: serializeAws_restJson1_1__listOf__string( + input.ClientSubnets, + context + ) + }), + ...(input.InstanceType !== undefined && { + instanceType: input.InstanceType + }), + ...(input.SecurityGroups !== undefined && { + securityGroups: serializeAws_restJson1_1__listOf__string( + input.SecurityGroups, + context + ) + }), + ...(input.StorageInfo !== undefined && { + storageInfo: serializeAws_restJson1_1StorageInfo( + input.StorageInfo, + context + ) + }) + }; }; const serializeAws_restJson1_1ClientAuthentication = ( input: ClientAuthentication, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Tls !== undefined) { - bodyParams["tls"] = serializeAws_restJson1_1Tls(input.Tls, context); - } - return bodyParams; + return { + ...(input.Tls !== undefined && { + tls: serializeAws_restJson1_1Tls(input.Tls, context) + }) + }; }; const serializeAws_restJson1_1ConfigurationInfo = ( input: ConfigurationInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["arn"] = input.Arn; - } - if (input.Revision !== undefined) { - bodyParams["revision"] = input.Revision; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { arn: input.Arn }), + ...(input.Revision !== undefined && { revision: input.Revision }) + }; }; const serializeAws_restJson1_1EBSStorageInfo = ( input: EBSStorageInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeSize !== undefined) { - bodyParams["volumeSize"] = input.VolumeSize; - } - return bodyParams; + return { + ...(input.VolumeSize !== undefined && { volumeSize: input.VolumeSize }) + }; }; const serializeAws_restJson1_1EncryptionAtRest = ( input: EncryptionAtRest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataVolumeKMSKeyId !== undefined) { - bodyParams["dataVolumeKMSKeyId"] = input.DataVolumeKMSKeyId; - } - return bodyParams; + return { + ...(input.DataVolumeKMSKeyId !== undefined && { + dataVolumeKMSKeyId: input.DataVolumeKMSKeyId + }) + }; }; const serializeAws_restJson1_1EncryptionInTransit = ( input: EncryptionInTransit, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientBroker !== undefined) { - bodyParams["clientBroker"] = input.ClientBroker; - } - if (input.InCluster !== undefined) { - bodyParams["inCluster"] = input.InCluster; - } - return bodyParams; + return { + ...(input.ClientBroker !== undefined && { + clientBroker: input.ClientBroker + }), + ...(input.InCluster !== undefined && { inCluster: input.InCluster }) + }; }; const serializeAws_restJson1_1EncryptionInfo = ( input: EncryptionInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionAtRest !== undefined) { - bodyParams["encryptionAtRest"] = serializeAws_restJson1_1EncryptionAtRest( - input.EncryptionAtRest, - context - ); - } - if (input.EncryptionInTransit !== undefined) { - bodyParams[ - "encryptionInTransit" - ] = serializeAws_restJson1_1EncryptionInTransit( - input.EncryptionInTransit, - context - ); - } - return bodyParams; + return { + ...(input.EncryptionAtRest !== undefined && { + encryptionAtRest: serializeAws_restJson1_1EncryptionAtRest( + input.EncryptionAtRest, + context + ) + }), + ...(input.EncryptionInTransit !== undefined && { + encryptionInTransit: serializeAws_restJson1_1EncryptionInTransit( + input.EncryptionInTransit, + context + ) + }) + }; }; const serializeAws_restJson1_1JmxExporterInfo = ( input: JmxExporterInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnabledInBroker !== undefined) { - bodyParams["enabledInBroker"] = input.EnabledInBroker; - } - return bodyParams; + return { + ...(input.EnabledInBroker !== undefined && { + enabledInBroker: input.EnabledInBroker + }) + }; }; const serializeAws_restJson1_1NodeExporterInfo = ( input: NodeExporterInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnabledInBroker !== undefined) { - bodyParams["enabledInBroker"] = input.EnabledInBroker; - } - return bodyParams; + return { + ...(input.EnabledInBroker !== undefined && { + enabledInBroker: input.EnabledInBroker + }) + }; }; const serializeAws_restJson1_1OpenMonitoringInfo = ( input: OpenMonitoringInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Prometheus !== undefined) { - bodyParams["prometheus"] = serializeAws_restJson1_1PrometheusInfo( - input.Prometheus, - context - ); - } - return bodyParams; + return { + ...(input.Prometheus !== undefined && { + prometheus: serializeAws_restJson1_1PrometheusInfo( + input.Prometheus, + context + ) + }) + }; }; const serializeAws_restJson1_1PrometheusInfo = ( input: PrometheusInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JmxExporter !== undefined) { - bodyParams["jmxExporter"] = serializeAws_restJson1_1JmxExporterInfo( - input.JmxExporter, - context - ); - } - if (input.NodeExporter !== undefined) { - bodyParams["nodeExporter"] = serializeAws_restJson1_1NodeExporterInfo( - input.NodeExporter, - context - ); - } - return bodyParams; + return { + ...(input.JmxExporter !== undefined && { + jmxExporter: serializeAws_restJson1_1JmxExporterInfo( + input.JmxExporter, + context + ) + }), + ...(input.NodeExporter !== undefined && { + nodeExporter: serializeAws_restJson1_1NodeExporterInfo( + input.NodeExporter, + context + ) + }) + }; }; const serializeAws_restJson1_1StorageInfo = ( input: StorageInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EbsStorageInfo !== undefined) { - bodyParams["ebsStorageInfo"] = serializeAws_restJson1_1EBSStorageInfo( - input.EbsStorageInfo, - context - ); - } - return bodyParams; + return { + ...(input.EbsStorageInfo !== undefined && { + ebsStorageInfo: serializeAws_restJson1_1EBSStorageInfo( + input.EbsStorageInfo, + context + ) + }) + }; }; const serializeAws_restJson1_1Tls = ( input: Tls, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateAuthorityArnList !== undefined) { - bodyParams[ - "certificateAuthorityArnList" - ] = serializeAws_restJson1_1__listOf__string( - input.CertificateAuthorityArnList, - context - ); - } - return bodyParams; + return { + ...(input.CertificateAuthorityArnList !== undefined && { + certificateAuthorityArnList: serializeAws_restJson1_1__listOf__string( + input.CertificateAuthorityArnList, + context + ) + }) + }; }; const serializeAws_restJson1_1__listOfBrokerEBSVolumeInfo = ( diff --git a/clients/client-kendra/protocols/Aws_json1_1.ts b/clients/client-kendra/protocols/Aws_json1_1.ts index 9884344f9bfd..0481f3be9a40 100644 --- a/clients/client-kendra/protocols/Aws_json1_1.ts +++ b/clients/client-kendra/protocols/Aws_json1_1.ts @@ -2908,90 +2908,79 @@ const serializeAws_json1_1AccessControlListConfiguration = ( input: AccessControlListConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyPath !== undefined) { - bodyParams["KeyPath"] = input.KeyPath; - } - return bodyParams; + return { + ...(input.KeyPath !== undefined && { KeyPath: input.KeyPath }) + }; }; const serializeAws_json1_1AclConfiguration = ( input: AclConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowedGroupsColumnName !== undefined) { - bodyParams["AllowedGroupsColumnName"] = input.AllowedGroupsColumnName; - } - return bodyParams; + return { + ...(input.AllowedGroupsColumnName !== undefined && { + AllowedGroupsColumnName: input.AllowedGroupsColumnName + }) + }; }; const serializeAws_json1_1AttributeFilter = ( input: AttributeFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AndAllFilters !== undefined) { - bodyParams["AndAllFilters"] = serializeAws_json1_1AttributeFilterList( - input.AndAllFilters, - context - ); - } - if (input.ContainsAll !== undefined) { - bodyParams["ContainsAll"] = serializeAws_json1_1DocumentAttribute( - input.ContainsAll, - context - ); - } - if (input.ContainsAny !== undefined) { - bodyParams["ContainsAny"] = serializeAws_json1_1DocumentAttribute( - input.ContainsAny, - context - ); - } - if (input.EqualsTo !== undefined) { - bodyParams["EqualsTo"] = serializeAws_json1_1DocumentAttribute( - input.EqualsTo, - context - ); - } - if (input.GreaterThan !== undefined) { - bodyParams["GreaterThan"] = serializeAws_json1_1DocumentAttribute( - input.GreaterThan, - context - ); - } - if (input.GreaterThanOrEquals !== undefined) { - bodyParams["GreaterThanOrEquals"] = serializeAws_json1_1DocumentAttribute( - input.GreaterThanOrEquals, - context - ); - } - if (input.LessThan !== undefined) { - bodyParams["LessThan"] = serializeAws_json1_1DocumentAttribute( - input.LessThan, - context - ); - } - if (input.LessThanOrEquals !== undefined) { - bodyParams["LessThanOrEquals"] = serializeAws_json1_1DocumentAttribute( - input.LessThanOrEquals, - context - ); - } - if (input.NotFilter !== undefined) { - bodyParams["NotFilter"] = serializeAws_json1_1AttributeFilter( - input.NotFilter, - context - ); - } - if (input.OrAllFilters !== undefined) { - bodyParams["OrAllFilters"] = serializeAws_json1_1AttributeFilterList( - input.OrAllFilters, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AttributeFilterList = ( @@ -3007,37 +2996,28 @@ const serializeAws_json1_1BatchDeleteDocumentRequest = ( input: BatchDeleteDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentIdList !== undefined) { - bodyParams["DocumentIdList"] = serializeAws_json1_1DocumentIdList( - input.DocumentIdList, - context - ); - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - return bodyParams; + return { + ...(input.DocumentIdList !== undefined && { + DocumentIdList: serializeAws_json1_1DocumentIdList( + input.DocumentIdList, + context + ) + }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }) + }; }; const serializeAws_json1_1BatchPutDocumentRequest = ( input: BatchPutDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Documents !== undefined) { - bodyParams["Documents"] = serializeAws_json1_1DocumentList( - input.Documents, - context - ); - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.Documents !== undefined && { + Documents: serializeAws_json1_1DocumentList(input.Documents, context) + }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_json1_1ChangeDetectingColumns = ( @@ -3051,14 +3031,12 @@ const serializeAws_json1_1ClickFeedback = ( input: ClickFeedback, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClickTime !== undefined) { - bodyParams["ClickTime"] = Math.round(input.ClickTime.getTime() / 1000); - } - if (input.ResultId !== undefined) { - bodyParams["ResultId"] = input.ResultId; - } - return bodyParams; + return { + ...(input.ClickTime !== undefined && { + ClickTime: Math.round(input.ClickTime.getTime() / 1000) + }), + ...(input.ResultId !== undefined && { ResultId: input.ResultId }) + }; }; const serializeAws_json1_1ClickFeedbackList = ( @@ -3072,168 +3050,126 @@ const serializeAws_json1_1ColumnConfiguration = ( input: ColumnConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeDetectingColumns !== undefined) { - bodyParams[ - "ChangeDetectingColumns" - ] = serializeAws_json1_1ChangeDetectingColumns( - input.ChangeDetectingColumns, - context - ); - } - if (input.DocumentDataColumnName !== undefined) { - bodyParams["DocumentDataColumnName"] = input.DocumentDataColumnName; - } - if (input.DocumentIdColumnName !== undefined) { - bodyParams["DocumentIdColumnName"] = input.DocumentIdColumnName; - } - if (input.DocumentTitleColumnName !== undefined) { - bodyParams["DocumentTitleColumnName"] = input.DocumentTitleColumnName; - } - if (input.FieldMappings !== undefined) { - bodyParams[ - "FieldMappings" - ] = serializeAws_json1_1DataSourceToIndexFieldMappingList( - input.FieldMappings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ConnectionConfiguration = ( input: ConnectionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatabaseHost !== undefined) { - bodyParams["DatabaseHost"] = input.DatabaseHost; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.DatabasePort !== undefined) { - bodyParams["DatabasePort"] = input.DatabasePort; - } - if (input.SecretArn !== undefined) { - bodyParams["SecretArn"] = input.SecretArn; - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateDataSourceRequest = ( input: CreateDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = serializeAws_json1_1DataSourceConfiguration( - input.Configuration, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(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.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1CreateFaqRequest = ( input: CreateFaqRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.S3Path !== undefined) { - bodyParams["S3Path"] = serializeAws_json1_1S3Path(input.S3Path, context); - } - return bodyParams; + return { + ...(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.S3Path !== undefined && { + S3Path: serializeAws_json1_1S3Path(input.S3Path, context) + }) + }; }; const serializeAws_json1_1CreateIndexRequest = ( input: CreateIndexRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.ServerSideEncryptionConfiguration !== undefined) { - bodyParams[ - "ServerSideEncryptionConfiguration" - ] = serializeAws_json1_1ServerSideEncryptionConfiguration( - input.ServerSideEncryptionConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.ServerSideEncryptionConfiguration !== undefined && { + ServerSideEncryptionConfiguration: serializeAws_json1_1ServerSideEncryptionConfiguration( + input.ServerSideEncryptionConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1DataSourceConfiguration = ( input: DataSourceConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatabaseConfiguration !== undefined) { - bodyParams[ - "DatabaseConfiguration" - ] = serializeAws_json1_1DatabaseConfiguration( - input.DatabaseConfiguration, - context - ); - } - if (input.S3Configuration !== undefined) { - bodyParams[ - "S3Configuration" - ] = serializeAws_json1_1S3DataSourceConfiguration( - input.S3Configuration, - context - ); - } - if (input.SharePointConfiguration !== undefined) { - bodyParams[ - "SharePointConfiguration" - ] = serializeAws_json1_1SharePointConfiguration( - input.SharePointConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.DatabaseConfiguration !== undefined && { + DatabaseConfiguration: serializeAws_json1_1DatabaseConfiguration( + input.DatabaseConfiguration, + context + ) + }), + ...(input.S3Configuration !== undefined && { + S3Configuration: serializeAws_json1_1S3DataSourceConfiguration( + input.S3Configuration, + context + ) + }), + ...(input.SharePointConfiguration !== undefined && { + SharePointConfiguration: serializeAws_json1_1SharePointConfiguration( + input.SharePointConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1DataSourceInclusionsExclusionsStrings = ( @@ -3247,17 +3183,17 @@ const serializeAws_json1_1DataSourceToIndexFieldMapping = ( input: DataSourceToIndexFieldMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSourceFieldName !== undefined) { - bodyParams["DataSourceFieldName"] = input.DataSourceFieldName; - } - if (input.DateFieldFormat !== undefined) { - bodyParams["DateFieldFormat"] = input.DateFieldFormat; - } - if (input.IndexFieldName !== undefined) { - bodyParams["IndexFieldName"] = input.IndexFieldName; - } - return bodyParams; + return { + ...(input.DataSourceFieldName !== undefined && { + DataSourceFieldName: input.DataSourceFieldName + }), + ...(input.DateFieldFormat !== undefined && { + DateFieldFormat: input.DateFieldFormat + }), + ...(input.IndexFieldName !== undefined && { + IndexFieldName: input.IndexFieldName + }) + }; }; const serializeAws_json1_1DataSourceToIndexFieldMappingList = ( @@ -3273,175 +3209,141 @@ const serializeAws_json1_1DataSourceVpcConfiguration = ( input: DataSourceVpcConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIdList( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIdList( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIdList( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIdList(input.SubnetIds, context) + }) + }; }; const serializeAws_json1_1DatabaseConfiguration = ( input: DatabaseConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AclConfiguration !== undefined) { - bodyParams["AclConfiguration"] = serializeAws_json1_1AclConfiguration( - input.AclConfiguration, - context - ); - } - if (input.ColumnConfiguration !== undefined) { - bodyParams["ColumnConfiguration"] = serializeAws_json1_1ColumnConfiguration( - input.ColumnConfiguration, - context - ); - } - if (input.ConnectionConfiguration !== undefined) { - bodyParams[ - "ConnectionConfiguration" - ] = serializeAws_json1_1ConnectionConfiguration( - input.ConnectionConfiguration, - context - ); - } - if (input.DatabaseEngineType !== undefined) { - bodyParams["DatabaseEngineType"] = input.DatabaseEngineType; - } - if (input.VpcConfiguration !== undefined) { - bodyParams[ - "VpcConfiguration" - ] = serializeAws_json1_1DataSourceVpcConfiguration( - input.VpcConfiguration, - context - ); - } - return bodyParams; + 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.VpcConfiguration !== undefined && { + VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration( + input.VpcConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1DeleteFaqRequest = ( input: DeleteFaqRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }) + }; }; const serializeAws_json1_1DeleteIndexRequest = ( input: DeleteIndexRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeDataSourceRequest = ( input: DescribeDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }) + }; }; const serializeAws_json1_1DescribeFaqRequest = ( input: DescribeFaqRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }) + }; }; const serializeAws_json1_1DescribeIndexRequest = ( input: DescribeIndexRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1Document = ( input: Document, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessControlList !== undefined) { - bodyParams["AccessControlList"] = serializeAws_json1_1PrincipalList( - input.AccessControlList, - context - ); - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1DocumentAttributeList( - input.Attributes, - context - ); - } - if (input.Blob !== undefined) { - bodyParams["Blob"] = context.base64Encoder(input.Blob); - } - if (input.ContentType !== undefined) { - bodyParams["ContentType"] = input.ContentType; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.S3Path !== undefined) { - bodyParams["S3Path"] = serializeAws_json1_1S3Path(input.S3Path, context); - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DocumentAttribute = ( input: DocumentAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = serializeAws_json1_1DocumentAttributeValue( - input.Value, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { + Value: serializeAws_json1_1DocumentAttributeValue(input.Value, context) + }) + }; }; const serializeAws_json1_1DocumentAttributeKeyList = ( @@ -3471,25 +3373,19 @@ const serializeAws_json1_1DocumentAttributeValue = ( input: DocumentAttributeValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DateValue !== undefined) { - bodyParams["DateValue"] = Math.round(input.DateValue.getTime() / 1000); - } - if (input.LongValue !== undefined) { - bodyParams["LongValue"] = input.LongValue; - } - if (input.StringListValue !== undefined) { - bodyParams[ - "StringListValue" - ] = serializeAws_json1_1DocumentAttributeStringListValue( - input.StringListValue, - context - ); - } - if (input.StringValue !== undefined) { - bodyParams["StringValue"] = input.StringValue; - } - return bodyParams; + return { + ...(input.DateValue !== undefined && { + DateValue: Math.round(input.DateValue.getTime() / 1000) + }), + ...(input.LongValue !== undefined && { LongValue: input.LongValue }), + ...(input.StringListValue !== undefined && { + StringListValue: serializeAws_json1_1DocumentAttributeStringListValue( + input.StringListValue, + context + ) + }), + ...(input.StringValue !== undefined && { StringValue: input.StringValue }) + }; }; const serializeAws_json1_1DocumentIdList = ( @@ -3510,23 +3406,16 @@ const serializeAws_json1_1DocumentMetadataConfiguration = ( input: DocumentMetadataConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Relevance !== undefined) { - bodyParams["Relevance"] = serializeAws_json1_1Relevance( - input.Relevance, - context - ); - } - if (input.Search !== undefined) { - bodyParams["Search"] = serializeAws_json1_1Search(input.Search, context); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DocumentMetadataConfigurationList = ( @@ -3542,22 +3431,20 @@ const serializeAws_json1_1DocumentsMetadataConfiguration = ( input: DocumentsMetadataConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Prefix !== undefined) { - bodyParams["S3Prefix"] = input.S3Prefix; - } - return bodyParams; + return { + ...(input.S3Prefix !== undefined && { S3Prefix: input.S3Prefix }) + }; }; const serializeAws_json1_1Facet = ( input: Facet, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentAttributeKey !== undefined) { - bodyParams["DocumentAttributeKey"] = input.DocumentAttributeKey; - } - return bodyParams; + return { + ...(input.DocumentAttributeKey !== undefined && { + DocumentAttributeKey: input.DocumentAttributeKey + }) + }; }; const serializeAws_json1_1FacetList = ( @@ -3571,94 +3458,64 @@ const serializeAws_json1_1ListDataSourceSyncJobsRequest = ( input: ListDataSourceSyncJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StartTimeFilter !== undefined) { - bodyParams["StartTimeFilter"] = serializeAws_json1_1TimeRange( - input.StartTimeFilter, - context - ); - } - if (input.StatusFilter !== undefined) { - bodyParams["StatusFilter"] = input.StatusFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListDataSourcesRequest = ( input: ListDataSourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListFaqsRequest = ( input: ListFaqsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.IndexId !== undefined && { IndexId: input.IndexId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListIndicesRequest = ( input: ListIndicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1Principal = ( input: Principal, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Access !== undefined) { - bodyParams["Access"] = input.Access; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Access !== undefined && { Access: input.Access }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1PrincipalList = ( @@ -3672,80 +3529,60 @@ const serializeAws_json1_1QueryRequest = ( input: QueryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeFilter !== undefined) { - bodyParams["AttributeFilter"] = serializeAws_json1_1AttributeFilter( - input.AttributeFilter, - context - ); - } - if (input.Facets !== undefined) { - bodyParams["Facets"] = serializeAws_json1_1FacetList(input.Facets, context); - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.PageNumber !== undefined) { - bodyParams["PageNumber"] = input.PageNumber; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.QueryResultTypeFilter !== undefined) { - bodyParams["QueryResultTypeFilter"] = input.QueryResultTypeFilter; - } - if (input.QueryText !== undefined) { - bodyParams["QueryText"] = input.QueryText; - } - if (input.RequestedDocumentAttributes !== undefined) { - bodyParams[ - "RequestedDocumentAttributes" - ] = serializeAws_json1_1DocumentAttributeKeyList( - input.RequestedDocumentAttributes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1Relevance = ( input: Relevance, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.Freshness !== undefined) { - bodyParams["Freshness"] = input.Freshness; - } - if (input.Importance !== undefined) { - bodyParams["Importance"] = input.Importance; - } - if (input.RankOrder !== undefined) { - bodyParams["RankOrder"] = input.RankOrder; - } - if (input.ValueImportanceMap !== undefined) { - bodyParams["ValueImportanceMap"] = serializeAws_json1_1ValueImportanceMap( - input.ValueImportanceMap, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RelevanceFeedback = ( input: RelevanceFeedback, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RelevanceValue !== undefined) { - bodyParams["RelevanceValue"] = input.RelevanceValue; - } - if (input.ResultId !== undefined) { - bodyParams["ResultId"] = input.ResultId; - } - return bodyParams; + return { + ...(input.RelevanceValue !== undefined && { + RelevanceValue: input.RelevanceValue + }), + ...(input.ResultId !== undefined && { ResultId: input.ResultId }) + }; }; const serializeAws_json1_1RelevanceFeedbackList = ( @@ -3761,74 +3598,54 @@ const serializeAws_json1_1S3DataSourceConfiguration = ( input: S3DataSourceConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessControlListConfiguration !== undefined) { - bodyParams[ - "AccessControlListConfiguration" - ] = serializeAws_json1_1AccessControlListConfiguration( - input.AccessControlListConfiguration, - context - ); - } - if (input.BucketName !== undefined) { - bodyParams["BucketName"] = input.BucketName; - } - if (input.DocumentsMetadataConfiguration !== undefined) { - bodyParams[ - "DocumentsMetadataConfiguration" - ] = serializeAws_json1_1DocumentsMetadataConfiguration( - input.DocumentsMetadataConfiguration, - context - ); - } - if (input.ExclusionPatterns !== undefined) { - bodyParams[ - "ExclusionPatterns" - ] = serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.ExclusionPatterns, - context - ); - } - if (input.InclusionPrefixes !== undefined) { - bodyParams[ - "InclusionPrefixes" - ] = serializeAws_json1_1DataSourceInclusionsExclusionsStrings( - input.InclusionPrefixes, - context - ); - } - return bodyParams; + 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.InclusionPrefixes !== undefined && { + InclusionPrefixes: serializeAws_json1_1DataSourceInclusionsExclusionsStrings( + input.InclusionPrefixes, + context + ) + }) + }; }; const serializeAws_json1_1S3Path = ( input: S3Path, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Key !== undefined && { Key: input.Key }) + }; }; const serializeAws_json1_1Search = ( input: Search, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Displayable !== undefined) { - bodyParams["Displayable"] = input.Displayable; - } - if (input.Facetable !== undefined) { - bodyParams["Facetable"] = input.Facetable; - } - if (input.Searchable !== undefined) { - bodyParams["Searchable"] = input.Searchable; - } - return bodyParams; + return { + ...(input.Displayable !== undefined && { Displayable: input.Displayable }), + ...(input.Facetable !== undefined && { Facetable: input.Facetable }), + ...(input.Searchable !== undefined && { Searchable: input.Searchable }) + }; }; const serializeAws_json1_1SecurityGroupIdList = ( @@ -3842,53 +3659,42 @@ const serializeAws_json1_1ServerSideEncryptionConfiguration = ( input: ServerSideEncryptionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }) + }; }; const serializeAws_json1_1SharePointConfiguration = ( input: SharePointConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CrawlAttachments !== undefined) { - bodyParams["CrawlAttachments"] = input.CrawlAttachments; - } - if (input.DocumentTitleFieldName !== undefined) { - bodyParams["DocumentTitleFieldName"] = input.DocumentTitleFieldName; - } - if (input.FieldMappings !== undefined) { - bodyParams[ - "FieldMappings" - ] = serializeAws_json1_1DataSourceToIndexFieldMappingList( - input.FieldMappings, - context - ); - } - if (input.SecretArn !== undefined) { - bodyParams["SecretArn"] = input.SecretArn; - } - if (input.SharePointVersion !== undefined) { - bodyParams["SharePointVersion"] = input.SharePointVersion; - } - if (input.Urls !== undefined) { - bodyParams["Urls"] = serializeAws_json1_1SharePointUrlList( - input.Urls, - context - ); - } - if (input.VpcConfiguration !== undefined) { - bodyParams[ - "VpcConfiguration" - ] = serializeAws_json1_1DataSourceVpcConfiguration( - input.VpcConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.CrawlAttachments !== undefined && { + CrawlAttachments: input.CrawlAttachments + }), + ...(input.DocumentTitleFieldName !== undefined && { + DocumentTitleFieldName: input.DocumentTitleFieldName + }), + ...(input.FieldMappings !== undefined && { + FieldMappings: serializeAws_json1_1DataSourceToIndexFieldMappingList( + input.FieldMappings, + context + ) + }), + ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }), + ...(input.SharePointVersion !== undefined && { + SharePointVersion: input.SharePointVersion + }), + ...(input.Urls !== undefined && { + Urls: serializeAws_json1_1SharePointUrlList(input.Urls, context) + }), + ...(input.VpcConfiguration !== undefined && { + VpcConfiguration: serializeAws_json1_1DataSourceVpcConfiguration( + input.VpcConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1SharePointUrlList = ( @@ -3902,56 +3708,42 @@ const serializeAws_json1_1StartDataSourceSyncJobRequest = ( input: StartDataSourceSyncJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }) + }; }; const serializeAws_json1_1StopDataSourceSyncJobRequest = ( input: StopDataSourceSyncJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.IndexId !== undefined && { IndexId: input.IndexId }) + }; }; const serializeAws_json1_1SubmitFeedbackRequest = ( input: SubmitFeedbackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClickFeedbackItems !== undefined) { - bodyParams["ClickFeedbackItems"] = serializeAws_json1_1ClickFeedbackList( - input.ClickFeedbackItems, - context - ); - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.QueryId !== undefined) { - bodyParams["QueryId"] = input.QueryId; - } - if (input.RelevanceFeedbackItems !== undefined) { - bodyParams[ - "RelevanceFeedbackItems" - ] = serializeAws_json1_1RelevanceFeedbackList( - input.RelevanceFeedbackItems, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SubnetIdList = ( @@ -3965,74 +3757,52 @@ const serializeAws_json1_1TimeRange = ( input: TimeRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + return { + ...(input.EndTime !== undefined && { + EndTime: Math.round(input.EndTime.getTime() / 1000) + }), + ...(input.StartTime !== undefined && { + StartTime: Math.round(input.StartTime.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UpdateDataSourceRequest = ( input: UpdateDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = serializeAws_json1_1DataSourceConfiguration( - input.Configuration, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.IndexId !== undefined) { - bodyParams["IndexId"] = input.IndexId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateIndexRequest = ( input: UpdateIndexRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DocumentMetadataConfigurationUpdates !== undefined) { - bodyParams[ - "DocumentMetadataConfigurationUpdates" - ] = serializeAws_json1_1DocumentMetadataConfigurationList( - input.DocumentMetadataConfigurationUpdates, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(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 }) + }; }; const serializeAws_json1_1ValueImportanceMap = ( 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 3176cd11a01d..2bd4c55924ff 100644 --- a/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics-v2/protocols/Aws_json1_1.ts @@ -3656,387 +3656,349 @@ const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionRequest = ( input: AddApplicationCloudWatchLoggingOptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOption !== undefined) { - bodyParams[ - "CloudWatchLoggingOption" - ] = serializeAws_json1_1CloudWatchLoggingOption( - input.CloudWatchLoggingOption, - context - ); - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CloudWatchLoggingOption !== undefined && { + CloudWatchLoggingOption: serializeAws_json1_1CloudWatchLoggingOption( + input.CloudWatchLoggingOption, + context + ) + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }) + }; }; const serializeAws_json1_1AddApplicationInputProcessingConfigurationRequest = ( input: AddApplicationInputProcessingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - if (input.InputProcessingConfiguration !== undefined) { - bodyParams[ - "InputProcessingConfiguration" - ] = serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AddApplicationInputRequest = ( input: AddApplicationInputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.Input !== undefined) { - bodyParams["Input"] = serializeAws_json1_1Input(input.Input, context); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.Input !== undefined && { + Input: serializeAws_json1_1Input(input.Input, context) + }) + }; }; const serializeAws_json1_1AddApplicationOutputRequest = ( input: AddApplicationOutputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.Output !== undefined) { - bodyParams["Output"] = serializeAws_json1_1Output(input.Output, context); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.Output !== undefined && { + Output: serializeAws_json1_1Output(input.Output, context) + }) + }; }; const serializeAws_json1_1AddApplicationReferenceDataSourceRequest = ( input: AddApplicationReferenceDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.ReferenceDataSource !== undefined) { - bodyParams["ReferenceDataSource"] = serializeAws_json1_1ReferenceDataSource( - input.ReferenceDataSource, - context - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.ReferenceDataSource !== undefined && { + ReferenceDataSource: serializeAws_json1_1ReferenceDataSource( + input.ReferenceDataSource, + context + ) + }) + }; }; const serializeAws_json1_1AddApplicationVpcConfigurationRequest = ( input: AddApplicationVpcConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.VpcConfiguration !== undefined) { - bodyParams["VpcConfiguration"] = serializeAws_json1_1VpcConfiguration( - input.VpcConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.VpcConfiguration !== undefined && { + VpcConfiguration: serializeAws_json1_1VpcConfiguration( + input.VpcConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1ApplicationCodeConfiguration = ( input: ApplicationCodeConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeContent !== undefined) { - bodyParams["CodeContent"] = serializeAws_json1_1CodeContent( - input.CodeContent, - context - ); - } - if (input.CodeContentType !== undefined) { - bodyParams["CodeContentType"] = input.CodeContentType; - } - return bodyParams; + return { + ...(input.CodeContent !== undefined && { + CodeContent: serializeAws_json1_1CodeContent(input.CodeContent, context) + }), + ...(input.CodeContentType !== undefined && { + CodeContentType: input.CodeContentType + }) + }; }; const serializeAws_json1_1ApplicationCodeConfigurationUpdate = ( input: ApplicationCodeConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeContentTypeUpdate !== undefined) { - bodyParams["CodeContentTypeUpdate"] = input.CodeContentTypeUpdate; - } - if (input.CodeContentUpdate !== undefined) { - bodyParams["CodeContentUpdate"] = serializeAws_json1_1CodeContentUpdate( - input.CodeContentUpdate, - context - ); - } - return bodyParams; + return { + ...(input.CodeContentTypeUpdate !== undefined && { + CodeContentTypeUpdate: input.CodeContentTypeUpdate + }), + ...(input.CodeContentUpdate !== undefined && { + CodeContentUpdate: serializeAws_json1_1CodeContentUpdate( + input.CodeContentUpdate, + context + ) + }) + }; }; const serializeAws_json1_1ApplicationConfiguration = ( input: ApplicationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationCodeConfiguration !== undefined) { - bodyParams[ - "ApplicationCodeConfiguration" - ] = serializeAws_json1_1ApplicationCodeConfiguration( - input.ApplicationCodeConfiguration, - context - ); - } - if (input.ApplicationSnapshotConfiguration !== undefined) { - bodyParams[ - "ApplicationSnapshotConfiguration" - ] = serializeAws_json1_1ApplicationSnapshotConfiguration( - input.ApplicationSnapshotConfiguration, - context - ); - } - if (input.EnvironmentProperties !== undefined) { - bodyParams[ - "EnvironmentProperties" - ] = serializeAws_json1_1EnvironmentProperties( - input.EnvironmentProperties, - context - ); - } - if (input.FlinkApplicationConfiguration !== undefined) { - bodyParams[ - "FlinkApplicationConfiguration" - ] = serializeAws_json1_1FlinkApplicationConfiguration( - input.FlinkApplicationConfiguration, - context - ); - } - if (input.SqlApplicationConfiguration !== undefined) { - bodyParams[ - "SqlApplicationConfiguration" - ] = serializeAws_json1_1SqlApplicationConfiguration( - input.SqlApplicationConfiguration, - context - ); - } - if (input.VpcConfigurations !== undefined) { - bodyParams["VpcConfigurations"] = serializeAws_json1_1VpcConfigurations( - input.VpcConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ApplicationConfigurationUpdate = ( input: ApplicationConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationCodeConfigurationUpdate !== undefined) { - bodyParams[ - "ApplicationCodeConfigurationUpdate" - ] = serializeAws_json1_1ApplicationCodeConfigurationUpdate( - input.ApplicationCodeConfigurationUpdate, - context - ); - } - if (input.ApplicationSnapshotConfigurationUpdate !== undefined) { - bodyParams[ - "ApplicationSnapshotConfigurationUpdate" - ] = serializeAws_json1_1ApplicationSnapshotConfigurationUpdate( - input.ApplicationSnapshotConfigurationUpdate, - context - ); - } - if (input.EnvironmentPropertyUpdates !== undefined) { - bodyParams[ - "EnvironmentPropertyUpdates" - ] = serializeAws_json1_1EnvironmentPropertyUpdates( - input.EnvironmentPropertyUpdates, - context - ); - } - if (input.FlinkApplicationConfigurationUpdate !== undefined) { - bodyParams[ - "FlinkApplicationConfigurationUpdate" - ] = serializeAws_json1_1FlinkApplicationConfigurationUpdate( - input.FlinkApplicationConfigurationUpdate, - context - ); - } - if (input.SqlApplicationConfigurationUpdate !== undefined) { - bodyParams[ - "SqlApplicationConfigurationUpdate" - ] = serializeAws_json1_1SqlApplicationConfigurationUpdate( - input.SqlApplicationConfigurationUpdate, - context - ); - } - if (input.VpcConfigurationUpdates !== undefined) { - bodyParams[ - "VpcConfigurationUpdates" - ] = serializeAws_json1_1VpcConfigurationUpdates( - input.VpcConfigurationUpdates, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ApplicationRestoreConfiguration = ( input: ApplicationRestoreConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationRestoreType !== undefined) { - bodyParams["ApplicationRestoreType"] = input.ApplicationRestoreType; - } - if (input.SnapshotName !== undefined) { - bodyParams["SnapshotName"] = input.SnapshotName; - } - return bodyParams; + return { + ...(input.ApplicationRestoreType !== undefined && { + ApplicationRestoreType: input.ApplicationRestoreType + }), + ...(input.SnapshotName !== undefined && { + SnapshotName: input.SnapshotName + }) + }; }; const serializeAws_json1_1ApplicationSnapshotConfiguration = ( input: ApplicationSnapshotConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnapshotsEnabled !== undefined) { - bodyParams["SnapshotsEnabled"] = input.SnapshotsEnabled; - } - return bodyParams; + return { + ...(input.SnapshotsEnabled !== undefined && { + SnapshotsEnabled: input.SnapshotsEnabled + }) + }; }; const serializeAws_json1_1ApplicationSnapshotConfigurationUpdate = ( input: ApplicationSnapshotConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnapshotsEnabledUpdate !== undefined) { - bodyParams["SnapshotsEnabledUpdate"] = input.SnapshotsEnabledUpdate; - } - return bodyParams; + return { + ...(input.SnapshotsEnabledUpdate !== undefined && { + SnapshotsEnabledUpdate: input.SnapshotsEnabledUpdate + }) + }; }; const serializeAws_json1_1CSVMappingParameters = ( input: CSVMappingParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordColumnDelimiter !== undefined) { - bodyParams["RecordColumnDelimiter"] = input.RecordColumnDelimiter; - } - if (input.RecordRowDelimiter !== undefined) { - bodyParams["RecordRowDelimiter"] = input.RecordRowDelimiter; - } - return bodyParams; + return { + ...(input.RecordColumnDelimiter !== undefined && { + RecordColumnDelimiter: input.RecordColumnDelimiter + }), + ...(input.RecordRowDelimiter !== undefined && { + RecordRowDelimiter: input.RecordRowDelimiter + }) + }; }; const serializeAws_json1_1CheckpointConfiguration = ( input: CheckpointConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CheckpointInterval !== undefined) { - bodyParams["CheckpointInterval"] = input.CheckpointInterval; - } - if (input.CheckpointingEnabled !== undefined) { - bodyParams["CheckpointingEnabled"] = input.CheckpointingEnabled; - } - if (input.ConfigurationType !== undefined) { - bodyParams["ConfigurationType"] = input.ConfigurationType; - } - if (input.MinPauseBetweenCheckpoints !== undefined) { - bodyParams["MinPauseBetweenCheckpoints"] = input.MinPauseBetweenCheckpoints; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CheckpointConfigurationUpdate = ( input: CheckpointConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CheckpointIntervalUpdate !== undefined) { - bodyParams["CheckpointIntervalUpdate"] = input.CheckpointIntervalUpdate; - } - if (input.CheckpointingEnabledUpdate !== undefined) { - bodyParams["CheckpointingEnabledUpdate"] = input.CheckpointingEnabledUpdate; - } - if (input.ConfigurationTypeUpdate !== undefined) { - bodyParams["ConfigurationTypeUpdate"] = input.ConfigurationTypeUpdate; - } - if (input.MinPauseBetweenCheckpointsUpdate !== undefined) { - bodyParams["MinPauseBetweenCheckpointsUpdate"] = - input.MinPauseBetweenCheckpointsUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CloudWatchLoggingOption = ( input: CloudWatchLoggingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogStreamARN !== undefined) { - bodyParams["LogStreamARN"] = input.LogStreamARN; - } - return bodyParams; + return { + ...(input.LogStreamARN !== undefined && { + LogStreamARN: input.LogStreamARN + }) + }; }; const serializeAws_json1_1CloudWatchLoggingOptionUpdate = ( input: CloudWatchLoggingOptionUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLoggingOptionId !== undefined) { - bodyParams["CloudWatchLoggingOptionId"] = input.CloudWatchLoggingOptionId; - } - if (input.LogStreamARNUpdate !== undefined) { - bodyParams["LogStreamARNUpdate"] = input.LogStreamARNUpdate; - } - return bodyParams; + return { + ...(input.CloudWatchLoggingOptionId !== undefined && { + CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId + }), + ...(input.LogStreamARNUpdate !== undefined && { + LogStreamARNUpdate: input.LogStreamARNUpdate + }) + }; }; const serializeAws_json1_1CloudWatchLoggingOptionUpdates = ( @@ -4061,607 +4023,537 @@ const serializeAws_json1_1CodeContent = ( input: CodeContent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3ContentLocation !== undefined) { - bodyParams["S3ContentLocation"] = serializeAws_json1_1S3ContentLocation( - input.S3ContentLocation, - context - ); - } - if (input.TextContent !== undefined) { - bodyParams["TextContent"] = input.TextContent; - } - if (input.ZipFileContent !== undefined) { - bodyParams["ZipFileContent"] = context.base64Encoder(input.ZipFileContent); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CodeContentUpdate = ( input: CodeContentUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3ContentLocationUpdate !== undefined) { - bodyParams[ - "S3ContentLocationUpdate" - ] = serializeAws_json1_1S3ContentLocationUpdate( - input.S3ContentLocationUpdate, - context - ); - } - if (input.TextContentUpdate !== undefined) { - bodyParams["TextContentUpdate"] = input.TextContentUpdate; - } - if (input.ZipFileContentUpdate !== undefined) { - bodyParams["ZipFileContentUpdate"] = context.base64Encoder( - input.ZipFileContentUpdate - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateApplicationRequest = ( input: CreateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationConfiguration !== undefined) { - bodyParams[ - "ApplicationConfiguration" - ] = serializeAws_json1_1ApplicationConfiguration( - input.ApplicationConfiguration, - context - ); - } - if (input.ApplicationDescription !== undefined) { - bodyParams["ApplicationDescription"] = input.ApplicationDescription; - } - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.RuntimeEnvironment !== undefined) { - bodyParams["RuntimeEnvironment"] = input.RuntimeEnvironment; - } - if (input.ServiceExecutionRole !== undefined) { - bodyParams["ServiceExecutionRole"] = input.ServiceExecutionRole; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateApplicationSnapshotRequest = ( input: CreateApplicationSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.SnapshotName !== undefined) { - bodyParams["SnapshotName"] = input.SnapshotName; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.SnapshotName !== undefined && { + SnapshotName: input.SnapshotName + }) + }; }; const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionRequest = ( input: DeleteApplicationCloudWatchLoggingOptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOptionId !== undefined) { - bodyParams["CloudWatchLoggingOptionId"] = input.CloudWatchLoggingOptionId; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CloudWatchLoggingOptionId !== undefined && { + CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }) + }; }; const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationRequest = ( input: DeleteApplicationInputProcessingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.InputId !== undefined && { InputId: input.InputId }) + }; }; const serializeAws_json1_1DeleteApplicationOutputRequest = ( input: DeleteApplicationOutputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.OutputId !== undefined) { - bodyParams["OutputId"] = input.OutputId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.OutputId !== undefined && { OutputId: input.OutputId }) + }; }; const serializeAws_json1_1DeleteApplicationReferenceDataSourceRequest = ( input: DeleteApplicationReferenceDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.ReferenceId !== undefined) { - bodyParams["ReferenceId"] = input.ReferenceId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.ReferenceId !== undefined && { ReferenceId: input.ReferenceId }) + }; }; const serializeAws_json1_1DeleteApplicationRequest = ( input: DeleteApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CreateTimestamp !== undefined) { - bodyParams["CreateTimestamp"] = Math.round( - input.CreateTimestamp.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CreateTimestamp !== undefined && { + CreateTimestamp: Math.round(input.CreateTimestamp.getTime() / 1000) + }) + }; }; const serializeAws_json1_1DeleteApplicationSnapshotRequest = ( input: DeleteApplicationSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.SnapshotCreationTimestamp !== undefined) { - bodyParams["SnapshotCreationTimestamp"] = Math.round( - input.SnapshotCreationTimestamp.getTime() / 1000 - ); - } - if (input.SnapshotName !== undefined) { - bodyParams["SnapshotName"] = input.SnapshotName; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.SnapshotCreationTimestamp !== undefined && { + SnapshotCreationTimestamp: Math.round( + input.SnapshotCreationTimestamp.getTime() / 1000 + ) + }), + ...(input.SnapshotName !== undefined && { + SnapshotName: input.SnapshotName + }) + }; }; const serializeAws_json1_1DeleteApplicationVpcConfigurationRequest = ( input: DeleteApplicationVpcConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.VpcConfigurationId !== undefined) { - bodyParams["VpcConfigurationId"] = input.VpcConfigurationId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.VpcConfigurationId !== undefined && { + VpcConfigurationId: input.VpcConfigurationId + }) + }; }; const serializeAws_json1_1DescribeApplicationRequest = ( input: DescribeApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.IncludeAdditionalDetails !== undefined) { - bodyParams["IncludeAdditionalDetails"] = input.IncludeAdditionalDetails; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.IncludeAdditionalDetails !== undefined && { + IncludeAdditionalDetails: input.IncludeAdditionalDetails + }) + }; }; const serializeAws_json1_1DescribeApplicationSnapshotRequest = ( input: DescribeApplicationSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.SnapshotName !== undefined) { - bodyParams["SnapshotName"] = input.SnapshotName; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.SnapshotName !== undefined && { + SnapshotName: input.SnapshotName + }) + }; }; const serializeAws_json1_1DestinationSchema = ( input: DestinationSchema, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordFormatType !== undefined) { - bodyParams["RecordFormatType"] = input.RecordFormatType; - } - return bodyParams; + return { + ...(input.RecordFormatType !== undefined && { + RecordFormatType: input.RecordFormatType + }) + }; }; const serializeAws_json1_1DiscoverInputSchemaRequest = ( input: DiscoverInputSchemaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputProcessingConfiguration !== undefined) { - bodyParams[ - "InputProcessingConfiguration" - ] = serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ); - } - if (input.InputStartingPositionConfiguration !== undefined) { - bodyParams[ - "InputStartingPositionConfiguration" - ] = serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ); - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.S3Configuration !== undefined) { - bodyParams["S3Configuration"] = serializeAws_json1_1S3Configuration( - input.S3Configuration, - context - ); - } - if (input.ServiceExecutionRole !== undefined) { - bodyParams["ServiceExecutionRole"] = input.ServiceExecutionRole; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EnvironmentProperties = ( input: EnvironmentProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PropertyGroups !== undefined) { - bodyParams["PropertyGroups"] = serializeAws_json1_1PropertyGroups( - input.PropertyGroups, - context - ); - } - return bodyParams; + return { + ...(input.PropertyGroups !== undefined && { + PropertyGroups: serializeAws_json1_1PropertyGroups( + input.PropertyGroups, + context + ) + }) + }; }; const serializeAws_json1_1EnvironmentPropertyUpdates = ( input: EnvironmentPropertyUpdates, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PropertyGroups !== undefined) { - bodyParams["PropertyGroups"] = serializeAws_json1_1PropertyGroups( - input.PropertyGroups, - context - ); - } - return bodyParams; + return { + ...(input.PropertyGroups !== undefined && { + PropertyGroups: serializeAws_json1_1PropertyGroups( + input.PropertyGroups, + context + ) + }) + }; }; const serializeAws_json1_1FlinkApplicationConfiguration = ( input: FlinkApplicationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CheckpointConfiguration !== undefined) { - bodyParams[ - "CheckpointConfiguration" - ] = serializeAws_json1_1CheckpointConfiguration( - input.CheckpointConfiguration, - context - ); - } - if (input.MonitoringConfiguration !== undefined) { - bodyParams[ - "MonitoringConfiguration" - ] = serializeAws_json1_1MonitoringConfiguration( - input.MonitoringConfiguration, - context - ); - } - if (input.ParallelismConfiguration !== undefined) { - bodyParams[ - "ParallelismConfiguration" - ] = serializeAws_json1_1ParallelismConfiguration( - input.ParallelismConfiguration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1FlinkApplicationConfigurationUpdate = ( input: FlinkApplicationConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CheckpointConfigurationUpdate !== undefined) { - bodyParams[ - "CheckpointConfigurationUpdate" - ] = serializeAws_json1_1CheckpointConfigurationUpdate( - input.CheckpointConfigurationUpdate, - context - ); - } - if (input.MonitoringConfigurationUpdate !== undefined) { - bodyParams[ - "MonitoringConfigurationUpdate" - ] = serializeAws_json1_1MonitoringConfigurationUpdate( - input.MonitoringConfigurationUpdate, - context - ); - } - if (input.ParallelismConfigurationUpdate !== undefined) { - bodyParams[ - "ParallelismConfigurationUpdate" - ] = serializeAws_json1_1ParallelismConfigurationUpdate( - input.ParallelismConfigurationUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1FlinkRunConfiguration = ( input: FlinkRunConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowNonRestoredState !== undefined) { - bodyParams["AllowNonRestoredState"] = input.AllowNonRestoredState; - } - return bodyParams; + return { + ...(input.AllowNonRestoredState !== undefined && { + AllowNonRestoredState: input.AllowNonRestoredState + }) + }; }; const serializeAws_json1_1Input = ( input: Input, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputParallelism !== undefined) { - bodyParams["InputParallelism"] = serializeAws_json1_1InputParallelism( - input.InputParallelism, - context - ); - } - if (input.InputProcessingConfiguration !== undefined) { - bodyParams[ - "InputProcessingConfiguration" - ] = serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ); - } - if (input.InputSchema !== undefined) { - bodyParams["InputSchema"] = serializeAws_json1_1SourceSchema( - input.InputSchema, - context - ); - } - if (input.KinesisFirehoseInput !== undefined) { - bodyParams[ - "KinesisFirehoseInput" - ] = serializeAws_json1_1KinesisFirehoseInput( - input.KinesisFirehoseInput, - context - ); - } - if (input.KinesisStreamsInput !== undefined) { - bodyParams["KinesisStreamsInput"] = serializeAws_json1_1KinesisStreamsInput( - input.KinesisStreamsInput, - context - ); - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1InputLambdaProcessor = ( input: InputLambdaProcessor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1InputLambdaProcessorUpdate = ( input: InputLambdaProcessorUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }) + }; }; const serializeAws_json1_1InputParallelism = ( input: InputParallelism, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Count !== undefined) { - bodyParams["Count"] = input.Count; - } - return bodyParams; + return { + ...(input.Count !== undefined && { Count: input.Count }) + }; }; const serializeAws_json1_1InputParallelismUpdate = ( input: InputParallelismUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CountUpdate !== undefined) { - bodyParams["CountUpdate"] = input.CountUpdate; - } - return bodyParams; + return { + ...(input.CountUpdate !== undefined && { CountUpdate: input.CountUpdate }) + }; }; const serializeAws_json1_1InputProcessingConfiguration = ( input: InputProcessingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputLambdaProcessor !== undefined) { - bodyParams[ - "InputLambdaProcessor" - ] = serializeAws_json1_1InputLambdaProcessor( - input.InputLambdaProcessor, - context - ); - } - return bodyParams; + return { + ...(input.InputLambdaProcessor !== undefined && { + InputLambdaProcessor: serializeAws_json1_1InputLambdaProcessor( + input.InputLambdaProcessor, + context + ) + }) + }; }; const serializeAws_json1_1InputProcessingConfigurationUpdate = ( input: InputProcessingConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputLambdaProcessorUpdate !== undefined) { - bodyParams[ - "InputLambdaProcessorUpdate" - ] = serializeAws_json1_1InputLambdaProcessorUpdate( - input.InputLambdaProcessorUpdate, - context - ); - } - return bodyParams; + return { + ...(input.InputLambdaProcessorUpdate !== undefined && { + InputLambdaProcessorUpdate: serializeAws_json1_1InputLambdaProcessorUpdate( + input.InputLambdaProcessorUpdate, + context + ) + }) + }; }; const serializeAws_json1_1InputSchemaUpdate = ( input: InputSchemaUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordColumnUpdates !== undefined) { - bodyParams["RecordColumnUpdates"] = serializeAws_json1_1RecordColumns( - input.RecordColumnUpdates, - context - ); - } - if (input.RecordEncodingUpdate !== undefined) { - bodyParams["RecordEncodingUpdate"] = input.RecordEncodingUpdate; - } - if (input.RecordFormatUpdate !== undefined) { - bodyParams["RecordFormatUpdate"] = serializeAws_json1_1RecordFormat( - input.RecordFormatUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1InputStartingPositionConfiguration = ( input: InputStartingPositionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputStartingPosition !== undefined) { - bodyParams["InputStartingPosition"] = input.InputStartingPosition; - } - return bodyParams; + return { + ...(input.InputStartingPosition !== undefined && { + InputStartingPosition: input.InputStartingPosition + }) + }; }; const serializeAws_json1_1InputUpdate = ( input: InputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - if (input.InputParallelismUpdate !== undefined) { - bodyParams[ - "InputParallelismUpdate" - ] = serializeAws_json1_1InputParallelismUpdate( - input.InputParallelismUpdate, - context - ); - } - if (input.InputProcessingConfigurationUpdate !== undefined) { - bodyParams[ - "InputProcessingConfigurationUpdate" - ] = serializeAws_json1_1InputProcessingConfigurationUpdate( - input.InputProcessingConfigurationUpdate, - context - ); - } - if (input.InputSchemaUpdate !== undefined) { - bodyParams["InputSchemaUpdate"] = serializeAws_json1_1InputSchemaUpdate( - input.InputSchemaUpdate, - context - ); - } - if (input.KinesisFirehoseInputUpdate !== undefined) { - bodyParams[ - "KinesisFirehoseInputUpdate" - ] = serializeAws_json1_1KinesisFirehoseInputUpdate( - input.KinesisFirehoseInputUpdate, - context - ); - } - if (input.KinesisStreamsInputUpdate !== undefined) { - bodyParams[ - "KinesisStreamsInputUpdate" - ] = serializeAws_json1_1KinesisStreamsInputUpdate( - input.KinesisStreamsInputUpdate, - context - ); - } - if (input.NamePrefixUpdate !== undefined) { - bodyParams["NamePrefixUpdate"] = input.NamePrefixUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1InputUpdates = ( @@ -4682,304 +4574,262 @@ const serializeAws_json1_1JSONMappingParameters = ( input: JSONMappingParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordRowPath !== undefined) { - bodyParams["RecordRowPath"] = input.RecordRowPath; - } - return bodyParams; + return { + ...(input.RecordRowPath !== undefined && { + RecordRowPath: input.RecordRowPath + }) + }; }; const serializeAws_json1_1KinesisFirehoseInput = ( input: KinesisFirehoseInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1KinesisFirehoseInputUpdate = ( input: KinesisFirehoseInputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }) + }; }; const serializeAws_json1_1KinesisFirehoseOutput = ( input: KinesisFirehoseOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1KinesisFirehoseOutputUpdate = ( input: KinesisFirehoseOutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }) + }; }; const serializeAws_json1_1KinesisStreamsInput = ( input: KinesisStreamsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1KinesisStreamsInputUpdate = ( input: KinesisStreamsInputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }) + }; }; const serializeAws_json1_1KinesisStreamsOutput = ( input: KinesisStreamsOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1KinesisStreamsOutputUpdate = ( input: KinesisStreamsOutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }) + }; }; const serializeAws_json1_1LambdaOutput = ( input: LambdaOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1LambdaOutputUpdate = ( input: LambdaOutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }) + }; }; const serializeAws_json1_1ListApplicationSnapshotsRequest = ( input: ListApplicationSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListApplicationsRequest = ( input: ListApplicationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1MappingParameters = ( input: MappingParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CSVMappingParameters !== undefined) { - bodyParams[ - "CSVMappingParameters" - ] = serializeAws_json1_1CSVMappingParameters( - input.CSVMappingParameters, - context - ); - } - if (input.JSONMappingParameters !== undefined) { - bodyParams[ - "JSONMappingParameters" - ] = serializeAws_json1_1JSONMappingParameters( - input.JSONMappingParameters, - context - ); - } - return bodyParams; + return { + ...(input.CSVMappingParameters !== undefined && { + CSVMappingParameters: serializeAws_json1_1CSVMappingParameters( + input.CSVMappingParameters, + context + ) + }), + ...(input.JSONMappingParameters !== undefined && { + JSONMappingParameters: serializeAws_json1_1JSONMappingParameters( + input.JSONMappingParameters, + context + ) + }) + }; }; const serializeAws_json1_1MonitoringConfiguration = ( input: MonitoringConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationType !== undefined) { - bodyParams["ConfigurationType"] = input.ConfigurationType; - } - if (input.LogLevel !== undefined) { - bodyParams["LogLevel"] = input.LogLevel; - } - if (input.MetricsLevel !== undefined) { - bodyParams["MetricsLevel"] = input.MetricsLevel; - } - return bodyParams; + return { + ...(input.ConfigurationType !== undefined && { + ConfigurationType: input.ConfigurationType + }), + ...(input.LogLevel !== undefined && { LogLevel: input.LogLevel }), + ...(input.MetricsLevel !== undefined && { + MetricsLevel: input.MetricsLevel + }) + }; }; const serializeAws_json1_1MonitoringConfigurationUpdate = ( input: MonitoringConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationTypeUpdate !== undefined) { - bodyParams["ConfigurationTypeUpdate"] = input.ConfigurationTypeUpdate; - } - if (input.LogLevelUpdate !== undefined) { - bodyParams["LogLevelUpdate"] = input.LogLevelUpdate; - } - if (input.MetricsLevelUpdate !== undefined) { - bodyParams["MetricsLevelUpdate"] = input.MetricsLevelUpdate; - } - return bodyParams; + return { + ...(input.ConfigurationTypeUpdate !== undefined && { + ConfigurationTypeUpdate: input.ConfigurationTypeUpdate + }), + ...(input.LogLevelUpdate !== undefined && { + LogLevelUpdate: input.LogLevelUpdate + }), + ...(input.MetricsLevelUpdate !== undefined && { + MetricsLevelUpdate: input.MetricsLevelUpdate + }) + }; }; const serializeAws_json1_1Output = ( input: Output, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationSchema !== undefined) { - bodyParams["DestinationSchema"] = serializeAws_json1_1DestinationSchema( - input.DestinationSchema, - context - ); - } - if (input.KinesisFirehoseOutput !== undefined) { - bodyParams[ - "KinesisFirehoseOutput" - ] = serializeAws_json1_1KinesisFirehoseOutput( - input.KinesisFirehoseOutput, - context - ); - } - if (input.KinesisStreamsOutput !== undefined) { - bodyParams[ - "KinesisStreamsOutput" - ] = serializeAws_json1_1KinesisStreamsOutput( - input.KinesisStreamsOutput, - context - ); - } - if (input.LambdaOutput !== undefined) { - bodyParams["LambdaOutput"] = serializeAws_json1_1LambdaOutput( - input.LambdaOutput, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1OutputUpdate = ( input: OutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationSchemaUpdate !== undefined) { - bodyParams[ - "DestinationSchemaUpdate" - ] = serializeAws_json1_1DestinationSchema( - input.DestinationSchemaUpdate, - context - ); - } - if (input.KinesisFirehoseOutputUpdate !== undefined) { - bodyParams[ - "KinesisFirehoseOutputUpdate" - ] = serializeAws_json1_1KinesisFirehoseOutputUpdate( - input.KinesisFirehoseOutputUpdate, - context - ); - } - if (input.KinesisStreamsOutputUpdate !== undefined) { - bodyParams[ - "KinesisStreamsOutputUpdate" - ] = serializeAws_json1_1KinesisStreamsOutputUpdate( - input.KinesisStreamsOutputUpdate, - context - ); - } - if (input.LambdaOutputUpdate !== undefined) { - bodyParams["LambdaOutputUpdate"] = serializeAws_json1_1LambdaOutputUpdate( - input.LambdaOutputUpdate, - context - ); - } - if (input.NameUpdate !== undefined) { - bodyParams["NameUpdate"] = input.NameUpdate; - } - if (input.OutputId !== undefined) { - bodyParams["OutputId"] = input.OutputId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1OutputUpdates = ( @@ -5000,57 +4850,52 @@ const serializeAws_json1_1ParallelismConfiguration = ( input: ParallelismConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoScalingEnabled !== undefined) { - bodyParams["AutoScalingEnabled"] = input.AutoScalingEnabled; - } - if (input.ConfigurationType !== undefined) { - bodyParams["ConfigurationType"] = input.ConfigurationType; - } - if (input.Parallelism !== undefined) { - bodyParams["Parallelism"] = input.Parallelism; - } - if (input.ParallelismPerKPU !== undefined) { - bodyParams["ParallelismPerKPU"] = input.ParallelismPerKPU; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ParallelismConfigurationUpdate = ( input: ParallelismConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoScalingEnabledUpdate !== undefined) { - bodyParams["AutoScalingEnabledUpdate"] = input.AutoScalingEnabledUpdate; - } - if (input.ConfigurationTypeUpdate !== undefined) { - bodyParams["ConfigurationTypeUpdate"] = input.ConfigurationTypeUpdate; - } - if (input.ParallelismPerKPUUpdate !== undefined) { - bodyParams["ParallelismPerKPUUpdate"] = input.ParallelismPerKPUUpdate; - } - if (input.ParallelismUpdate !== undefined) { - bodyParams["ParallelismUpdate"] = input.ParallelismUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1PropertyGroup = ( input: PropertyGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PropertyGroupId !== undefined) { - bodyParams["PropertyGroupId"] = input.PropertyGroupId; - } - if (input.PropertyMap !== undefined) { - bodyParams["PropertyMap"] = serializeAws_json1_1PropertyMap( - input.PropertyMap, - context - ); - } - return bodyParams; + return { + ...(input.PropertyGroupId !== undefined && { + PropertyGroupId: input.PropertyGroupId + }), + ...(input.PropertyMap !== undefined && { + PropertyMap: serializeAws_json1_1PropertyMap(input.PropertyMap, context) + }) + }; }; const serializeAws_json1_1PropertyGroups = ( @@ -5074,17 +4919,11 @@ const serializeAws_json1_1RecordColumn = ( input: RecordColumn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Mapping !== undefined) { - bodyParams["Mapping"] = input.Mapping; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SqlType !== undefined) { - bodyParams["SqlType"] = input.SqlType; - } - return bodyParams; + return { + ...(input.Mapping !== undefined && { Mapping: input.Mapping }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SqlType !== undefined && { SqlType: input.SqlType }) + }; }; const serializeAws_json1_1RecordColumns = ( @@ -5098,70 +4937,62 @@ const serializeAws_json1_1RecordFormat = ( input: RecordFormat, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MappingParameters !== undefined) { - bodyParams["MappingParameters"] = serializeAws_json1_1MappingParameters( - input.MappingParameters, - context - ); - } - if (input.RecordFormatType !== undefined) { - bodyParams["RecordFormatType"] = input.RecordFormatType; - } - return bodyParams; + return { + ...(input.MappingParameters !== undefined && { + MappingParameters: serializeAws_json1_1MappingParameters( + input.MappingParameters, + context + ) + }), + ...(input.RecordFormatType !== undefined && { + RecordFormatType: input.RecordFormatType + }) + }; }; const serializeAws_json1_1ReferenceDataSource = ( input: ReferenceDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReferenceSchema !== undefined) { - bodyParams["ReferenceSchema"] = serializeAws_json1_1SourceSchema( - input.ReferenceSchema, - context - ); - } - if (input.S3ReferenceDataSource !== undefined) { - bodyParams[ - "S3ReferenceDataSource" - ] = serializeAws_json1_1S3ReferenceDataSource( - input.S3ReferenceDataSource, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ReferenceDataSourceUpdate = ( input: ReferenceDataSourceUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReferenceId !== undefined) { - bodyParams["ReferenceId"] = input.ReferenceId; - } - if (input.ReferenceSchemaUpdate !== undefined) { - bodyParams["ReferenceSchemaUpdate"] = serializeAws_json1_1SourceSchema( - input.ReferenceSchemaUpdate, - context - ); - } - if (input.S3ReferenceDataSourceUpdate !== undefined) { - bodyParams[ - "S3ReferenceDataSourceUpdate" - ] = serializeAws_json1_1S3ReferenceDataSourceUpdate( - input.S3ReferenceDataSourceUpdate, - context - ); - } - if (input.TableNameUpdate !== undefined) { - bodyParams["TableNameUpdate"] = input.TableNameUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ReferenceDataSourceUpdates = ( @@ -5186,132 +5017,110 @@ const serializeAws_json1_1RunConfiguration = ( input: RunConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationRestoreConfiguration !== undefined) { - bodyParams[ - "ApplicationRestoreConfiguration" - ] = serializeAws_json1_1ApplicationRestoreConfiguration( - input.ApplicationRestoreConfiguration, - context - ); - } - if (input.FlinkRunConfiguration !== undefined) { - bodyParams[ - "FlinkRunConfiguration" - ] = serializeAws_json1_1FlinkRunConfiguration( - input.FlinkRunConfiguration, - context - ); - } - if (input.SqlRunConfigurations !== undefined) { - bodyParams[ - "SqlRunConfigurations" - ] = serializeAws_json1_1SqlRunConfigurations( - input.SqlRunConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RunConfigurationUpdate = ( input: RunConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationRestoreConfiguration !== undefined) { - bodyParams[ - "ApplicationRestoreConfiguration" - ] = serializeAws_json1_1ApplicationRestoreConfiguration( - input.ApplicationRestoreConfiguration, - context - ); - } - if (input.FlinkRunConfiguration !== undefined) { - bodyParams[ - "FlinkRunConfiguration" - ] = serializeAws_json1_1FlinkRunConfiguration( - input.FlinkRunConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.ApplicationRestoreConfiguration !== undefined && { + ApplicationRestoreConfiguration: serializeAws_json1_1ApplicationRestoreConfiguration( + input.ApplicationRestoreConfiguration, + context + ) + }), + ...(input.FlinkRunConfiguration !== undefined && { + FlinkRunConfiguration: serializeAws_json1_1FlinkRunConfiguration( + input.FlinkRunConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1S3Configuration = ( input: S3Configuration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.FileKey !== undefined) { - bodyParams["FileKey"] = input.FileKey; - } - return bodyParams; + return { + ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && { FileKey: input.FileKey }) + }; }; const serializeAws_json1_1S3ContentLocation = ( input: S3ContentLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.FileKey !== undefined) { - bodyParams["FileKey"] = input.FileKey; - } - if (input.ObjectVersion !== undefined) { - bodyParams["ObjectVersion"] = input.ObjectVersion; - } - return bodyParams; + return { + ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && { FileKey: input.FileKey }), + ...(input.ObjectVersion !== undefined && { + ObjectVersion: input.ObjectVersion + }) + }; }; const serializeAws_json1_1S3ContentLocationUpdate = ( input: S3ContentLocationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARNUpdate !== undefined) { - bodyParams["BucketARNUpdate"] = input.BucketARNUpdate; - } - if (input.FileKeyUpdate !== undefined) { - bodyParams["FileKeyUpdate"] = input.FileKeyUpdate; - } - if (input.ObjectVersionUpdate !== undefined) { - bodyParams["ObjectVersionUpdate"] = input.ObjectVersionUpdate; - } - return bodyParams; + return { + ...(input.BucketARNUpdate !== undefined && { + BucketARNUpdate: input.BucketARNUpdate + }), + ...(input.FileKeyUpdate !== undefined && { + FileKeyUpdate: input.FileKeyUpdate + }), + ...(input.ObjectVersionUpdate !== undefined && { + ObjectVersionUpdate: input.ObjectVersionUpdate + }) + }; }; const serializeAws_json1_1S3ReferenceDataSource = ( input: S3ReferenceDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.FileKey !== undefined) { - bodyParams["FileKey"] = input.FileKey; - } - return bodyParams; + return { + ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && { FileKey: input.FileKey }) + }; }; const serializeAws_json1_1S3ReferenceDataSourceUpdate = ( input: S3ReferenceDataSourceUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARNUpdate !== undefined) { - bodyParams["BucketARNUpdate"] = input.BucketARNUpdate; - } - if (input.FileKeyUpdate !== undefined) { - bodyParams["FileKeyUpdate"] = input.FileKeyUpdate; - } - return bodyParams; + return { + ...(input.BucketARNUpdate !== undefined && { + BucketARNUpdate: input.BucketARNUpdate + }), + ...(input.FileKeyUpdate !== undefined && { + FileKeyUpdate: input.FileKeyUpdate + }) + }; }; const serializeAws_json1_1SecurityGroupIds = ( @@ -5325,92 +5134,84 @@ const serializeAws_json1_1SourceSchema = ( input: SourceSchema, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordColumns !== undefined) { - bodyParams["RecordColumns"] = serializeAws_json1_1RecordColumns( - input.RecordColumns, - context - ); - } - if (input.RecordEncoding !== undefined) { - bodyParams["RecordEncoding"] = input.RecordEncoding; - } - if (input.RecordFormat !== undefined) { - bodyParams["RecordFormat"] = serializeAws_json1_1RecordFormat( - input.RecordFormat, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SqlApplicationConfiguration = ( input: SqlApplicationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Inputs !== undefined) { - bodyParams["Inputs"] = serializeAws_json1_1Inputs(input.Inputs, context); - } - if (input.Outputs !== undefined) { - bodyParams["Outputs"] = serializeAws_json1_1Outputs(input.Outputs, context); - } - if (input.ReferenceDataSources !== undefined) { - bodyParams[ - "ReferenceDataSources" - ] = serializeAws_json1_1ReferenceDataSources( - input.ReferenceDataSources, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SqlApplicationConfigurationUpdate = ( input: SqlApplicationConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputUpdates !== undefined) { - bodyParams["InputUpdates"] = serializeAws_json1_1InputUpdates( - input.InputUpdates, - context - ); - } - if (input.OutputUpdates !== undefined) { - bodyParams["OutputUpdates"] = serializeAws_json1_1OutputUpdates( - input.OutputUpdates, - context - ); - } - if (input.ReferenceDataSourceUpdates !== undefined) { - bodyParams[ - "ReferenceDataSourceUpdates" - ] = serializeAws_json1_1ReferenceDataSourceUpdates( - input.ReferenceDataSourceUpdates, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SqlRunConfiguration = ( input: SqlRunConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - if (input.InputStartingPositionConfiguration !== undefined) { - bodyParams[ - "InputStartingPositionConfiguration" - ] = serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.InputId !== undefined && { InputId: input.InputId }), + ...(input.InputStartingPositionConfiguration !== undefined && { + InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( + input.InputStartingPositionConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1SqlRunConfigurations = ( @@ -5426,28 +5227,28 @@ const serializeAws_json1_1StartApplicationRequest = ( input: StartApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.RunConfiguration !== undefined) { - bodyParams["RunConfiguration"] = serializeAws_json1_1RunConfiguration( - input.RunConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.RunConfiguration !== undefined && { + RunConfiguration: serializeAws_json1_1RunConfiguration( + input.RunConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1StopApplicationRequest = ( input: StopApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }) + }; }; const serializeAws_json1_1SubnetIds = ( @@ -5458,14 +5259,10 @@ const serializeAws_json1_1SubnetIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -5479,14 +5276,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -5500,99 +5295,87 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateApplicationRequest = ( input: UpdateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationConfigurationUpdate !== undefined) { - bodyParams[ - "ApplicationConfigurationUpdate" - ] = serializeAws_json1_1ApplicationConfigurationUpdate( - input.ApplicationConfigurationUpdate, - context - ); - } - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOptionUpdates !== undefined) { - bodyParams[ - "CloudWatchLoggingOptionUpdates" - ] = serializeAws_json1_1CloudWatchLoggingOptionUpdates( - input.CloudWatchLoggingOptionUpdates, - context - ); - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.RunConfigurationUpdate !== undefined) { - bodyParams[ - "RunConfigurationUpdate" - ] = serializeAws_json1_1RunConfigurationUpdate( - input.RunConfigurationUpdate, - context - ); - } - if (input.ServiceExecutionRoleUpdate !== undefined) { - bodyParams["ServiceExecutionRoleUpdate"] = input.ServiceExecutionRoleUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1VpcConfiguration = ( input: VpcConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_json1_1SecurityGroupIds( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) + }) + }; }; const serializeAws_json1_1VpcConfigurationUpdate = ( input: VpcConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIdUpdates !== undefined) { - bodyParams["SecurityGroupIdUpdates"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIdUpdates, - context - ); - } - if (input.SubnetIdUpdates !== undefined) { - bodyParams["SubnetIdUpdates"] = serializeAws_json1_1SubnetIds( - input.SubnetIdUpdates, - context - ); - } - if (input.VpcConfigurationId !== undefined) { - bodyParams["VpcConfigurationId"] = input.VpcConfigurationId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1VpcConfigurationUpdates = ( diff --git a/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts b/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts index b5ac3beac645..56205aff8fe7 100644 --- a/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis-analytics/protocols/Aws_json1_1.ts @@ -2753,190 +2753,173 @@ const serializeAws_json1_1AddApplicationCloudWatchLoggingOptionRequest = ( input: AddApplicationCloudWatchLoggingOptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOption !== undefined) { - bodyParams[ - "CloudWatchLoggingOption" - ] = serializeAws_json1_1CloudWatchLoggingOption( - input.CloudWatchLoggingOption, - context - ); - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CloudWatchLoggingOption !== undefined && { + CloudWatchLoggingOption: serializeAws_json1_1CloudWatchLoggingOption( + input.CloudWatchLoggingOption, + context + ) + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }) + }; }; const serializeAws_json1_1AddApplicationInputProcessingConfigurationRequest = ( input: AddApplicationInputProcessingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - if (input.InputProcessingConfiguration !== undefined) { - bodyParams[ - "InputProcessingConfiguration" - ] = serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AddApplicationInputRequest = ( input: AddApplicationInputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.Input !== undefined) { - bodyParams["Input"] = serializeAws_json1_1Input(input.Input, context); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.Input !== undefined && { + Input: serializeAws_json1_1Input(input.Input, context) + }) + }; }; const serializeAws_json1_1AddApplicationOutputRequest = ( input: AddApplicationOutputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.Output !== undefined) { - bodyParams["Output"] = serializeAws_json1_1Output(input.Output, context); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.Output !== undefined && { + Output: serializeAws_json1_1Output(input.Output, context) + }) + }; }; const serializeAws_json1_1AddApplicationReferenceDataSourceRequest = ( input: AddApplicationReferenceDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.ReferenceDataSource !== undefined) { - bodyParams["ReferenceDataSource"] = serializeAws_json1_1ReferenceDataSource( - input.ReferenceDataSource, - context - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.ReferenceDataSource !== undefined && { + ReferenceDataSource: serializeAws_json1_1ReferenceDataSource( + input.ReferenceDataSource, + context + ) + }) + }; }; const serializeAws_json1_1ApplicationUpdate = ( input: ApplicationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationCodeUpdate !== undefined) { - bodyParams["ApplicationCodeUpdate"] = input.ApplicationCodeUpdate; - } - if (input.CloudWatchLoggingOptionUpdates !== undefined) { - bodyParams[ - "CloudWatchLoggingOptionUpdates" - ] = serializeAws_json1_1CloudWatchLoggingOptionUpdates( - input.CloudWatchLoggingOptionUpdates, - context - ); - } - if (input.InputUpdates !== undefined) { - bodyParams["InputUpdates"] = serializeAws_json1_1InputUpdates( - input.InputUpdates, - context - ); - } - if (input.OutputUpdates !== undefined) { - bodyParams["OutputUpdates"] = serializeAws_json1_1OutputUpdates( - input.OutputUpdates, - context - ); - } - if (input.ReferenceDataSourceUpdates !== undefined) { - bodyParams[ - "ReferenceDataSourceUpdates" - ] = serializeAws_json1_1ReferenceDataSourceUpdates( - input.ReferenceDataSourceUpdates, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CSVMappingParameters = ( input: CSVMappingParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordColumnDelimiter !== undefined) { - bodyParams["RecordColumnDelimiter"] = input.RecordColumnDelimiter; - } - if (input.RecordRowDelimiter !== undefined) { - bodyParams["RecordRowDelimiter"] = input.RecordRowDelimiter; - } - return bodyParams; + return { + ...(input.RecordColumnDelimiter !== undefined && { + RecordColumnDelimiter: input.RecordColumnDelimiter + }), + ...(input.RecordRowDelimiter !== undefined && { + RecordRowDelimiter: input.RecordRowDelimiter + }) + }; }; const serializeAws_json1_1CloudWatchLoggingOption = ( input: CloudWatchLoggingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogStreamARN !== undefined) { - bodyParams["LogStreamARN"] = input.LogStreamARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.LogStreamARN !== undefined && { + LogStreamARN: input.LogStreamARN + }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1CloudWatchLoggingOptionUpdate = ( input: CloudWatchLoggingOptionUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLoggingOptionId !== undefined) { - bodyParams["CloudWatchLoggingOptionId"] = input.CloudWatchLoggingOptionId; - } - if (input.LogStreamARNUpdate !== undefined) { - bodyParams["LogStreamARNUpdate"] = input.LogStreamARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.CloudWatchLoggingOptionId !== undefined && { + CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId + }), + ...(input.LogStreamARNUpdate !== undefined && { + LogStreamARNUpdate: input.LogStreamARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1CloudWatchLoggingOptionUpdates = ( @@ -2961,244 +2944,209 @@ const serializeAws_json1_1CreateApplicationRequest = ( input: CreateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationCode !== undefined) { - bodyParams["ApplicationCode"] = input.ApplicationCode; - } - if (input.ApplicationDescription !== undefined) { - bodyParams["ApplicationDescription"] = input.ApplicationDescription; - } - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOptions !== undefined) { - bodyParams[ - "CloudWatchLoggingOptions" - ] = serializeAws_json1_1CloudWatchLoggingOptions( - input.CloudWatchLoggingOptions, - context - ); - } - if (input.Inputs !== undefined) { - bodyParams["Inputs"] = serializeAws_json1_1Inputs(input.Inputs, context); - } - if (input.Outputs !== undefined) { - bodyParams["Outputs"] = serializeAws_json1_1Outputs(input.Outputs, context); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteApplicationCloudWatchLoggingOptionRequest = ( input: DeleteApplicationCloudWatchLoggingOptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CloudWatchLoggingOptionId !== undefined) { - bodyParams["CloudWatchLoggingOptionId"] = input.CloudWatchLoggingOptionId; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CloudWatchLoggingOptionId !== undefined && { + CloudWatchLoggingOptionId: input.CloudWatchLoggingOptionId + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }) + }; }; const serializeAws_json1_1DeleteApplicationInputProcessingConfigurationRequest = ( input: DeleteApplicationInputProcessingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.InputId !== undefined && { InputId: input.InputId }) + }; }; const serializeAws_json1_1DeleteApplicationOutputRequest = ( input: DeleteApplicationOutputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.OutputId !== undefined) { - bodyParams["OutputId"] = input.OutputId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.OutputId !== undefined && { OutputId: input.OutputId }) + }; }; const serializeAws_json1_1DeleteApplicationReferenceDataSourceRequest = ( input: DeleteApplicationReferenceDataSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - if (input.ReferenceId !== undefined) { - bodyParams["ReferenceId"] = input.ReferenceId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }), + ...(input.ReferenceId !== undefined && { ReferenceId: input.ReferenceId }) + }; }; const serializeAws_json1_1DeleteApplicationRequest = ( input: DeleteApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.CreateTimestamp !== undefined) { - bodyParams["CreateTimestamp"] = Math.round( - input.CreateTimestamp.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.CreateTimestamp !== undefined && { + CreateTimestamp: Math.round(input.CreateTimestamp.getTime() / 1000) + }) + }; }; const serializeAws_json1_1DescribeApplicationRequest = ( input: DescribeApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }) + }; }; const serializeAws_json1_1DestinationSchema = ( input: DestinationSchema, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordFormatType !== undefined) { - bodyParams["RecordFormatType"] = input.RecordFormatType; - } - return bodyParams; + return { + ...(input.RecordFormatType !== undefined && { + RecordFormatType: input.RecordFormatType + }) + }; }; const serializeAws_json1_1DiscoverInputSchemaRequest = ( input: DiscoverInputSchemaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputProcessingConfiguration !== undefined) { - bodyParams[ - "InputProcessingConfiguration" - ] = serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ); - } - if (input.InputStartingPositionConfiguration !== undefined) { - bodyParams[ - "InputStartingPositionConfiguration" - ] = serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ); - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.S3Configuration !== undefined) { - bodyParams["S3Configuration"] = serializeAws_json1_1S3Configuration( - input.S3Configuration, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1Input = ( input: Input, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputParallelism !== undefined) { - bodyParams["InputParallelism"] = serializeAws_json1_1InputParallelism( - input.InputParallelism, - context - ); - } - if (input.InputProcessingConfiguration !== undefined) { - bodyParams[ - "InputProcessingConfiguration" - ] = serializeAws_json1_1InputProcessingConfiguration( - input.InputProcessingConfiguration, - context - ); - } - if (input.InputSchema !== undefined) { - bodyParams["InputSchema"] = serializeAws_json1_1SourceSchema( - input.InputSchema, - context - ); - } - if (input.KinesisFirehoseInput !== undefined) { - bodyParams[ - "KinesisFirehoseInput" - ] = serializeAws_json1_1KinesisFirehoseInput( - input.KinesisFirehoseInput, - context - ); - } - if (input.KinesisStreamsInput !== undefined) { - bodyParams["KinesisStreamsInput"] = serializeAws_json1_1KinesisStreamsInput( - input.KinesisStreamsInput, - context - ); - } - if (input.NamePrefix !== undefined) { - bodyParams["NamePrefix"] = input.NamePrefix; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1InputConfiguration = ( input: InputConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.InputStartingPositionConfiguration !== undefined) { - bodyParams[ - "InputStartingPositionConfiguration" - ] = serializeAws_json1_1InputStartingPositionConfiguration( - input.InputStartingPositionConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.InputStartingPositionConfiguration !== undefined && { + InputStartingPositionConfiguration: serializeAws_json1_1InputStartingPositionConfiguration( + input.InputStartingPositionConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1InputConfigurations = ( @@ -3214,168 +3162,146 @@ const serializeAws_json1_1InputLambdaProcessor = ( input: InputLambdaProcessor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1InputLambdaProcessorUpdate = ( input: InputLambdaProcessorUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1InputParallelism = ( input: InputParallelism, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Count !== undefined) { - bodyParams["Count"] = input.Count; - } - return bodyParams; + return { + ...(input.Count !== undefined && { Count: input.Count }) + }; }; const serializeAws_json1_1InputParallelismUpdate = ( input: InputParallelismUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CountUpdate !== undefined) { - bodyParams["CountUpdate"] = input.CountUpdate; - } - return bodyParams; + return { + ...(input.CountUpdate !== undefined && { CountUpdate: input.CountUpdate }) + }; }; const serializeAws_json1_1InputProcessingConfiguration = ( input: InputProcessingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputLambdaProcessor !== undefined) { - bodyParams[ - "InputLambdaProcessor" - ] = serializeAws_json1_1InputLambdaProcessor( - input.InputLambdaProcessor, - context - ); - } - return bodyParams; + return { + ...(input.InputLambdaProcessor !== undefined && { + InputLambdaProcessor: serializeAws_json1_1InputLambdaProcessor( + input.InputLambdaProcessor, + context + ) + }) + }; }; const serializeAws_json1_1InputProcessingConfigurationUpdate = ( input: InputProcessingConfigurationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputLambdaProcessorUpdate !== undefined) { - bodyParams[ - "InputLambdaProcessorUpdate" - ] = serializeAws_json1_1InputLambdaProcessorUpdate( - input.InputLambdaProcessorUpdate, - context - ); - } - return bodyParams; + return { + ...(input.InputLambdaProcessorUpdate !== undefined && { + InputLambdaProcessorUpdate: serializeAws_json1_1InputLambdaProcessorUpdate( + input.InputLambdaProcessorUpdate, + context + ) + }) + }; }; const serializeAws_json1_1InputSchemaUpdate = ( input: InputSchemaUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordColumnUpdates !== undefined) { - bodyParams["RecordColumnUpdates"] = serializeAws_json1_1RecordColumns( - input.RecordColumnUpdates, - context - ); - } - if (input.RecordEncodingUpdate !== undefined) { - bodyParams["RecordEncodingUpdate"] = input.RecordEncodingUpdate; - } - if (input.RecordFormatUpdate !== undefined) { - bodyParams["RecordFormatUpdate"] = serializeAws_json1_1RecordFormat( - input.RecordFormatUpdate, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1InputStartingPositionConfiguration = ( input: InputStartingPositionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputStartingPosition !== undefined) { - bodyParams["InputStartingPosition"] = input.InputStartingPosition; - } - return bodyParams; + return { + ...(input.InputStartingPosition !== undefined && { + InputStartingPosition: input.InputStartingPosition + }) + }; }; const serializeAws_json1_1InputUpdate = ( input: InputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputId !== undefined) { - bodyParams["InputId"] = input.InputId; - } - if (input.InputParallelismUpdate !== undefined) { - bodyParams[ - "InputParallelismUpdate" - ] = serializeAws_json1_1InputParallelismUpdate( - input.InputParallelismUpdate, - context - ); - } - if (input.InputProcessingConfigurationUpdate !== undefined) { - bodyParams[ - "InputProcessingConfigurationUpdate" - ] = serializeAws_json1_1InputProcessingConfigurationUpdate( - input.InputProcessingConfigurationUpdate, - context - ); - } - if (input.InputSchemaUpdate !== undefined) { - bodyParams["InputSchemaUpdate"] = serializeAws_json1_1InputSchemaUpdate( - input.InputSchemaUpdate, - context - ); - } - if (input.KinesisFirehoseInputUpdate !== undefined) { - bodyParams[ - "KinesisFirehoseInputUpdate" - ] = serializeAws_json1_1KinesisFirehoseInputUpdate( - input.KinesisFirehoseInputUpdate, - context - ); - } - if (input.KinesisStreamsInputUpdate !== undefined) { - bodyParams[ - "KinesisStreamsInputUpdate" - ] = serializeAws_json1_1KinesisStreamsInputUpdate( - input.KinesisStreamsInputUpdate, - context - ); - } - if (input.NamePrefixUpdate !== undefined) { - bodyParams["NamePrefixUpdate"] = input.NamePrefixUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1InputUpdates = ( @@ -3396,284 +3322,239 @@ const serializeAws_json1_1JSONMappingParameters = ( input: JSONMappingParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordRowPath !== undefined) { - bodyParams["RecordRowPath"] = input.RecordRowPath; - } - return bodyParams; + return { + ...(input.RecordRowPath !== undefined && { + RecordRowPath: input.RecordRowPath + }) + }; }; const serializeAws_json1_1KinesisFirehoseInput = ( input: KinesisFirehoseInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1KinesisFirehoseInputUpdate = ( input: KinesisFirehoseInputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1KinesisFirehoseOutput = ( input: KinesisFirehoseOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1KinesisFirehoseOutputUpdate = ( input: KinesisFirehoseOutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1KinesisStreamsInput = ( input: KinesisStreamsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1KinesisStreamsInputUpdate = ( input: KinesisStreamsInputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1KinesisStreamsOutput = ( input: KinesisStreamsOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1KinesisStreamsOutputUpdate = ( input: KinesisStreamsOutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1LambdaOutput = ( input: LambdaOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1LambdaOutputUpdate = ( input: LambdaOutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNUpdate !== undefined) { - bodyParams["ResourceARNUpdate"] = input.ResourceARNUpdate; - } - if (input.RoleARNUpdate !== undefined) { - bodyParams["RoleARNUpdate"] = input.RoleARNUpdate; - } - return bodyParams; + return { + ...(input.ResourceARNUpdate !== undefined && { + ResourceARNUpdate: input.ResourceARNUpdate + }), + ...(input.RoleARNUpdate !== undefined && { + RoleARNUpdate: input.RoleARNUpdate + }) + }; }; const serializeAws_json1_1ListApplicationsRequest = ( input: ListApplicationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartApplicationName !== undefined) { - bodyParams["ExclusiveStartApplicationName"] = - input.ExclusiveStartApplicationName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.ExclusiveStartApplicationName !== undefined && { + ExclusiveStartApplicationName: input.ExclusiveStartApplicationName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1MappingParameters = ( input: MappingParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CSVMappingParameters !== undefined) { - bodyParams[ - "CSVMappingParameters" - ] = serializeAws_json1_1CSVMappingParameters( - input.CSVMappingParameters, - context - ); - } - if (input.JSONMappingParameters !== undefined) { - bodyParams[ - "JSONMappingParameters" - ] = serializeAws_json1_1JSONMappingParameters( - input.JSONMappingParameters, - context - ); - } - return bodyParams; + return { + ...(input.CSVMappingParameters !== undefined && { + CSVMappingParameters: serializeAws_json1_1CSVMappingParameters( + input.CSVMappingParameters, + context + ) + }), + ...(input.JSONMappingParameters !== undefined && { + JSONMappingParameters: serializeAws_json1_1JSONMappingParameters( + input.JSONMappingParameters, + context + ) + }) + }; }; const serializeAws_json1_1Output = ( input: Output, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationSchema !== undefined) { - bodyParams["DestinationSchema"] = serializeAws_json1_1DestinationSchema( - input.DestinationSchema, - context - ); - } - if (input.KinesisFirehoseOutput !== undefined) { - bodyParams[ - "KinesisFirehoseOutput" - ] = serializeAws_json1_1KinesisFirehoseOutput( - input.KinesisFirehoseOutput, - context - ); - } - if (input.KinesisStreamsOutput !== undefined) { - bodyParams[ - "KinesisStreamsOutput" - ] = serializeAws_json1_1KinesisStreamsOutput( - input.KinesisStreamsOutput, - context - ); - } - if (input.LambdaOutput !== undefined) { - bodyParams["LambdaOutput"] = serializeAws_json1_1LambdaOutput( - input.LambdaOutput, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1OutputUpdate = ( input: OutputUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationSchemaUpdate !== undefined) { - bodyParams[ - "DestinationSchemaUpdate" - ] = serializeAws_json1_1DestinationSchema( - input.DestinationSchemaUpdate, - context - ); - } - if (input.KinesisFirehoseOutputUpdate !== undefined) { - bodyParams[ - "KinesisFirehoseOutputUpdate" - ] = serializeAws_json1_1KinesisFirehoseOutputUpdate( - input.KinesisFirehoseOutputUpdate, - context - ); - } - if (input.KinesisStreamsOutputUpdate !== undefined) { - bodyParams[ - "KinesisStreamsOutputUpdate" - ] = serializeAws_json1_1KinesisStreamsOutputUpdate( - input.KinesisStreamsOutputUpdate, - context - ); - } - if (input.LambdaOutputUpdate !== undefined) { - bodyParams["LambdaOutputUpdate"] = serializeAws_json1_1LambdaOutputUpdate( - input.LambdaOutputUpdate, - context - ); - } - if (input.NameUpdate !== undefined) { - bodyParams["NameUpdate"] = input.NameUpdate; - } - if (input.OutputId !== undefined) { - bodyParams["OutputId"] = input.OutputId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1OutputUpdates = ( @@ -3694,17 +3575,11 @@ const serializeAws_json1_1RecordColumn = ( input: RecordColumn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Mapping !== undefined) { - bodyParams["Mapping"] = input.Mapping; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SqlType !== undefined) { - bodyParams["SqlType"] = input.SqlType; - } - return bodyParams; + return { + ...(input.Mapping !== undefined && { Mapping: input.Mapping }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SqlType !== undefined && { SqlType: input.SqlType }) + }; }; const serializeAws_json1_1RecordColumns = ( @@ -3718,70 +3593,62 @@ const serializeAws_json1_1RecordFormat = ( input: RecordFormat, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MappingParameters !== undefined) { - bodyParams["MappingParameters"] = serializeAws_json1_1MappingParameters( - input.MappingParameters, - context - ); - } - if (input.RecordFormatType !== undefined) { - bodyParams["RecordFormatType"] = input.RecordFormatType; - } - return bodyParams; + return { + ...(input.MappingParameters !== undefined && { + MappingParameters: serializeAws_json1_1MappingParameters( + input.MappingParameters, + context + ) + }), + ...(input.RecordFormatType !== undefined && { + RecordFormatType: input.RecordFormatType + }) + }; }; const serializeAws_json1_1ReferenceDataSource = ( input: ReferenceDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReferenceSchema !== undefined) { - bodyParams["ReferenceSchema"] = serializeAws_json1_1SourceSchema( - input.ReferenceSchema, - context - ); - } - if (input.S3ReferenceDataSource !== undefined) { - bodyParams[ - "S3ReferenceDataSource" - ] = serializeAws_json1_1S3ReferenceDataSource( - input.S3ReferenceDataSource, - context - ); - } - if (input.TableName !== undefined) { - bodyParams["TableName"] = input.TableName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ReferenceDataSourceUpdate = ( input: ReferenceDataSourceUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReferenceId !== undefined) { - bodyParams["ReferenceId"] = input.ReferenceId; - } - if (input.ReferenceSchemaUpdate !== undefined) { - bodyParams["ReferenceSchemaUpdate"] = serializeAws_json1_1SourceSchema( - input.ReferenceSchemaUpdate, - context - ); - } - if (input.S3ReferenceDataSourceUpdate !== undefined) { - bodyParams[ - "S3ReferenceDataSourceUpdate" - ] = serializeAws_json1_1S3ReferenceDataSourceUpdate( - input.S3ReferenceDataSourceUpdate, - context - ); - } - if (input.TableNameUpdate !== undefined) { - bodyParams["TableNameUpdate"] = input.TableNameUpdate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ReferenceDataSourceUpdates = ( @@ -3797,113 +3664,99 @@ const serializeAws_json1_1S3Configuration = ( input: S3Configuration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.FileKey !== undefined) { - bodyParams["FileKey"] = input.FileKey; - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + return { + ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && { FileKey: input.FileKey }), + ...(input.RoleARN !== undefined && { RoleARN: input.RoleARN }) + }; }; const serializeAws_json1_1S3ReferenceDataSource = ( input: S3ReferenceDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARN !== undefined) { - bodyParams["BucketARN"] = input.BucketARN; - } - if (input.FileKey !== undefined) { - bodyParams["FileKey"] = input.FileKey; - } - if (input.ReferenceRoleARN !== undefined) { - bodyParams["ReferenceRoleARN"] = input.ReferenceRoleARN; - } - return bodyParams; + return { + ...(input.BucketARN !== undefined && { BucketARN: input.BucketARN }), + ...(input.FileKey !== undefined && { FileKey: input.FileKey }), + ...(input.ReferenceRoleARN !== undefined && { + ReferenceRoleARN: input.ReferenceRoleARN + }) + }; }; const serializeAws_json1_1S3ReferenceDataSourceUpdate = ( input: S3ReferenceDataSourceUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketARNUpdate !== undefined) { - bodyParams["BucketARNUpdate"] = input.BucketARNUpdate; - } - if (input.FileKeyUpdate !== undefined) { - bodyParams["FileKeyUpdate"] = input.FileKeyUpdate; - } - if (input.ReferenceRoleARNUpdate !== undefined) { - bodyParams["ReferenceRoleARNUpdate"] = input.ReferenceRoleARNUpdate; - } - return bodyParams; + return { + ...(input.BucketARNUpdate !== undefined && { + BucketARNUpdate: input.BucketARNUpdate + }), + ...(input.FileKeyUpdate !== undefined && { + FileKeyUpdate: input.FileKeyUpdate + }), + ...(input.ReferenceRoleARNUpdate !== undefined && { + ReferenceRoleARNUpdate: input.ReferenceRoleARNUpdate + }) + }; }; const serializeAws_json1_1SourceSchema = ( input: SourceSchema, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RecordColumns !== undefined) { - bodyParams["RecordColumns"] = serializeAws_json1_1RecordColumns( - input.RecordColumns, - context - ); - } - if (input.RecordEncoding !== undefined) { - bodyParams["RecordEncoding"] = input.RecordEncoding; - } - if (input.RecordFormat !== undefined) { - bodyParams["RecordFormat"] = serializeAws_json1_1RecordFormat( - input.RecordFormat, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1StartApplicationRequest = ( input: StartApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.InputConfigurations !== undefined) { - bodyParams["InputConfigurations"] = serializeAws_json1_1InputConfigurations( - input.InputConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.InputConfigurations !== undefined && { + InputConfigurations: serializeAws_json1_1InputConfigurations( + input.InputConfigurations, + context + ) + }) + }; }; const serializeAws_json1_1StopApplicationRequest = ( input: StopApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -3917,14 +3770,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -3938,35 +3789,32 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateApplicationRequest = ( input: UpdateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationName !== undefined) { - bodyParams["ApplicationName"] = input.ApplicationName; - } - if (input.ApplicationUpdate !== undefined) { - bodyParams["ApplicationUpdate"] = serializeAws_json1_1ApplicationUpdate( - input.ApplicationUpdate, - context - ); - } - if (input.CurrentApplicationVersionId !== undefined) { - bodyParams["CurrentApplicationVersionId"] = - input.CurrentApplicationVersionId; - } - return bodyParams; + return { + ...(input.ApplicationName !== undefined && { + ApplicationName: input.ApplicationName + }), + ...(input.ApplicationUpdate !== undefined && { + ApplicationUpdate: serializeAws_json1_1ApplicationUpdate( + input.ApplicationUpdate, + context + ) + }), + ...(input.CurrentApplicationVersionId !== undefined && { + CurrentApplicationVersionId: input.CurrentApplicationVersionId + }) + }; }; const deserializeAws_json1_1AddApplicationCloudWatchLoggingOptionResponse = ( diff --git a/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1_1.ts b/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1_1.ts index fe132a15d0b3..b487d88a4a45 100644 --- a/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1_1.ts +++ b/clients/client-kinesis-video-archived-media/protocols/Aws_restJson1_1.ts @@ -841,35 +841,31 @@ const serializeAws_restJson1_1DASHFragmentSelector = ( input: DASHFragmentSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FragmentSelectorType !== undefined) { - bodyParams["FragmentSelectorType"] = input.FragmentSelectorType; - } - if (input.TimestampRange !== undefined) { - bodyParams["TimestampRange"] = serializeAws_restJson1_1DASHTimestampRange( - input.TimestampRange, - context - ); - } - return bodyParams; + return { + ...(input.FragmentSelectorType !== undefined && { + FragmentSelectorType: input.FragmentSelectorType + }), + ...(input.TimestampRange !== undefined && { + TimestampRange: serializeAws_restJson1_1DASHTimestampRange( + input.TimestampRange, + context + ) + }) + }; }; const serializeAws_restJson1_1DASHTimestampRange = ( input: DASHTimestampRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTimestamp !== undefined) { - bodyParams["EndTimestamp"] = Math.round( - input.EndTimestamp.getTime() / 1000 - ); - } - if (input.StartTimestamp !== undefined) { - bodyParams["StartTimestamp"] = Math.round( - input.StartTimestamp.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.EndTimestamp !== undefined && { + EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) + }), + ...(input.StartTimestamp !== undefined && { + StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) + }) + }; }; const serializeAws_restJson1_1FragmentNumberList = ( @@ -883,70 +879,62 @@ const serializeAws_restJson1_1FragmentSelector = ( input: FragmentSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FragmentSelectorType !== undefined) { - bodyParams["FragmentSelectorType"] = input.FragmentSelectorType; - } - if (input.TimestampRange !== undefined) { - bodyParams["TimestampRange"] = serializeAws_restJson1_1TimestampRange( - input.TimestampRange, - context - ); - } - return bodyParams; + return { + ...(input.FragmentSelectorType !== undefined && { + FragmentSelectorType: input.FragmentSelectorType + }), + ...(input.TimestampRange !== undefined && { + TimestampRange: serializeAws_restJson1_1TimestampRange( + input.TimestampRange, + context + ) + }) + }; }; const serializeAws_restJson1_1HLSFragmentSelector = ( input: HLSFragmentSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FragmentSelectorType !== undefined) { - bodyParams["FragmentSelectorType"] = input.FragmentSelectorType; - } - if (input.TimestampRange !== undefined) { - bodyParams["TimestampRange"] = serializeAws_restJson1_1HLSTimestampRange( - input.TimestampRange, - context - ); - } - return bodyParams; + return { + ...(input.FragmentSelectorType !== undefined && { + FragmentSelectorType: input.FragmentSelectorType + }), + ...(input.TimestampRange !== undefined && { + TimestampRange: serializeAws_restJson1_1HLSTimestampRange( + input.TimestampRange, + context + ) + }) + }; }; const serializeAws_restJson1_1HLSTimestampRange = ( input: HLSTimestampRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTimestamp !== undefined) { - bodyParams["EndTimestamp"] = Math.round( - input.EndTimestamp.getTime() / 1000 - ); - } - if (input.StartTimestamp !== undefined) { - bodyParams["StartTimestamp"] = Math.round( - input.StartTimestamp.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.EndTimestamp !== undefined && { + EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) + }), + ...(input.StartTimestamp !== undefined && { + StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) + }) + }; }; const serializeAws_restJson1_1TimestampRange = ( input: TimestampRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTimestamp !== undefined) { - bodyParams["EndTimestamp"] = Math.round( - input.EndTimestamp.getTime() / 1000 - ); - } - if (input.StartTimestamp !== undefined) { - bodyParams["StartTimestamp"] = Math.round( - input.StartTimestamp.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.EndTimestamp !== undefined && { + EndTimestamp: Math.round(input.EndTimestamp.getTime() / 1000) + }), + ...(input.StartTimestamp !== undefined && { + StartTimestamp: Math.round(input.StartTimestamp.getTime() / 1000) + }) + }; }; const deserializeAws_restJson1_1Fragment = ( diff --git a/clients/client-kinesis-video-media/protocols/Aws_restJson1_1.ts b/clients/client-kinesis-video-media/protocols/Aws_restJson1_1.ts index fbcf688c254d..f5b48e7eb016 100644 --- a/clients/client-kinesis-video-media/protocols/Aws_restJson1_1.ts +++ b/clients/client-kinesis-video-media/protocols/Aws_restJson1_1.ts @@ -280,22 +280,20 @@ const serializeAws_restJson1_1StartSelector = ( input: StartSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AfterFragmentNumber !== undefined) { - bodyParams["AfterFragmentNumber"] = input.AfterFragmentNumber; - } - if (input.ContinuationToken !== undefined) { - bodyParams["ContinuationToken"] = input.ContinuationToken; - } - if (input.StartSelectorType !== undefined) { - bodyParams["StartSelectorType"] = input.StartSelectorType; - } - if (input.StartTimestamp !== undefined) { - bodyParams["StartTimestamp"] = Math.round( - input.StartTimestamp.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const deserializeMetadata = (output: __HttpResponse): __ResponseMetadata => ({ diff --git a/clients/client-kinesis-video/protocols/Aws_restJson1_1.ts b/clients/client-kinesis-video/protocols/Aws_restJson1_1.ts index 6249020278c4..1f577be74a20 100644 --- a/clients/client-kinesis-video/protocols/Aws_restJson1_1.ts +++ b/clients/client-kinesis-video/protocols/Aws_restJson1_1.ts @@ -2938,14 +2938,14 @@ const serializeAws_restJson1_1ChannelNameCondition = ( input: ChannelNameCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.ComparisonValue !== undefined) { - bodyParams["ComparisonValue"] = input.ComparisonValue; - } - return bodyParams; + return { + ...(input.ComparisonOperator !== undefined && { + ComparisonOperator: input.ComparisonOperator + }), + ...(input.ComparisonValue !== undefined && { + ComparisonValue: input.ComparisonValue + }) + }; }; const serializeAws_restJson1_1ListOfProtocols = ( @@ -2969,56 +2969,50 @@ const serializeAws_restJson1_1SingleMasterChannelEndpointConfiguration = ( input: SingleMasterChannelEndpointConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Protocols !== undefined) { - bodyParams["Protocols"] = serializeAws_restJson1_1ListOfProtocols( - input.Protocols, - context - ); - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - return bodyParams; + return { + ...(input.Protocols !== undefined && { + Protocols: serializeAws_restJson1_1ListOfProtocols( + input.Protocols, + context + ) + }), + ...(input.Role !== undefined && { Role: input.Role }) + }; }; const serializeAws_restJson1_1SingleMasterConfiguration = ( input: SingleMasterConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageTtlSeconds !== undefined) { - bodyParams["MessageTtlSeconds"] = input.MessageTtlSeconds; - } - return bodyParams; + return { + ...(input.MessageTtlSeconds !== undefined && { + MessageTtlSeconds: input.MessageTtlSeconds + }) + }; }; const serializeAws_restJson1_1StreamNameCondition = ( input: StreamNameCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.ComparisonValue !== undefined) { - bodyParams["ComparisonValue"] = input.ComparisonValue; - } - return bodyParams; + return { + ...(input.ComparisonOperator !== undefined && { + ComparisonOperator: input.ComparisonOperator + }), + ...(input.ComparisonValue !== undefined && { + ComparisonValue: input.ComparisonValue + }) + }; }; const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagKeyList = ( diff --git a/clients/client-kinesis/protocols/Aws_json1_1.ts b/clients/client-kinesis/protocols/Aws_json1_1.ts index ee022c95d8e9..bc40234d4d08 100644 --- a/clients/client-kinesis/protocols/Aws_json1_1.ts +++ b/clients/client-kinesis/protocols/Aws_json1_1.ts @@ -3523,306 +3523,249 @@ const serializeAws_json1_1AddTagsToStreamInput = ( input: AddTagsToStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagMap(input.Tags, context); - } - return bodyParams; + return { + ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagMap(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateStreamInput = ( input: CreateStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ShardCount !== undefined) { - bodyParams["ShardCount"] = input.ShardCount; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.ShardCount !== undefined && { ShardCount: input.ShardCount }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1DecreaseStreamRetentionPeriodInput = ( input: DecreaseStreamRetentionPeriodInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RetentionPeriodHours !== undefined) { - bodyParams["RetentionPeriodHours"] = input.RetentionPeriodHours; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.RetentionPeriodHours !== undefined && { + RetentionPeriodHours: input.RetentionPeriodHours + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1DeleteStreamInput = ( input: DeleteStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnforceConsumerDeletion !== undefined) { - bodyParams["EnforceConsumerDeletion"] = input.EnforceConsumerDeletion; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.EnforceConsumerDeletion !== undefined && { + EnforceConsumerDeletion: input.EnforceConsumerDeletion + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1DeregisterStreamConsumerInput = ( input: DeregisterStreamConsumerInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConsumerARN !== undefined) { - bodyParams["ConsumerARN"] = input.ConsumerARN; - } - if (input.ConsumerName !== undefined) { - bodyParams["ConsumerName"] = input.ConsumerName; - } - if (input.StreamARN !== undefined) { - bodyParams["StreamARN"] = input.StreamARN; - } - return bodyParams; + return { + ...(input.ConsumerARN !== undefined && { ConsumerARN: input.ConsumerARN }), + ...(input.ConsumerName !== undefined && { + ConsumerName: input.ConsumerName + }), + ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }) + }; }; const serializeAws_json1_1DescribeLimitsInput = ( input: DescribeLimitsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeStreamConsumerInput = ( input: DescribeStreamConsumerInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConsumerARN !== undefined) { - bodyParams["ConsumerARN"] = input.ConsumerARN; - } - if (input.ConsumerName !== undefined) { - bodyParams["ConsumerName"] = input.ConsumerName; - } - if (input.StreamARN !== undefined) { - bodyParams["StreamARN"] = input.StreamARN; - } - return bodyParams; + return { + ...(input.ConsumerARN !== undefined && { ConsumerARN: input.ConsumerARN }), + ...(input.ConsumerName !== undefined && { + ConsumerName: input.ConsumerName + }), + ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }) + }; }; const serializeAws_json1_1DescribeStreamInput = ( input: DescribeStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartShardId !== undefined) { - bodyParams["ExclusiveStartShardId"] = input.ExclusiveStartShardId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.ExclusiveStartShardId !== undefined && { + ExclusiveStartShardId: input.ExclusiveStartShardId + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1DescribeStreamSummaryInput = ( input: DescribeStreamSummaryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1DisableEnhancedMonitoringInput = ( input: DisableEnhancedMonitoringInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ShardLevelMetrics !== undefined) { - bodyParams["ShardLevelMetrics"] = serializeAws_json1_1MetricsNameList( - input.ShardLevelMetrics, - context - ); - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.ShardLevelMetrics !== undefined && { + ShardLevelMetrics: serializeAws_json1_1MetricsNameList( + input.ShardLevelMetrics, + context + ) + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1EnableEnhancedMonitoringInput = ( input: EnableEnhancedMonitoringInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ShardLevelMetrics !== undefined) { - bodyParams["ShardLevelMetrics"] = serializeAws_json1_1MetricsNameList( - input.ShardLevelMetrics, - context - ); - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.ShardLevelMetrics !== undefined && { + ShardLevelMetrics: serializeAws_json1_1MetricsNameList( + input.ShardLevelMetrics, + context + ) + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1GetRecordsInput = ( input: GetRecordsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.ShardIterator !== undefined) { - bodyParams["ShardIterator"] = input.ShardIterator; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.ShardIterator !== undefined && { + ShardIterator: input.ShardIterator + }) + }; }; const serializeAws_json1_1GetShardIteratorInput = ( input: GetShardIteratorInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ShardId !== undefined) { - bodyParams["ShardId"] = input.ShardId; - } - if (input.ShardIteratorType !== undefined) { - bodyParams["ShardIteratorType"] = input.ShardIteratorType; - } - if (input.StartingSequenceNumber !== undefined) { - bodyParams["StartingSequenceNumber"] = input.StartingSequenceNumber; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1IncreaseStreamRetentionPeriodInput = ( input: IncreaseStreamRetentionPeriodInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RetentionPeriodHours !== undefined) { - bodyParams["RetentionPeriodHours"] = input.RetentionPeriodHours; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.RetentionPeriodHours !== undefined && { + RetentionPeriodHours: input.RetentionPeriodHours + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1ListShardsInput = ( input: ListShardsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartShardId !== undefined) { - bodyParams["ExclusiveStartShardId"] = input.ExclusiveStartShardId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StreamCreationTimestamp !== undefined) { - bodyParams["StreamCreationTimestamp"] = Math.round( - input.StreamCreationTimestamp.getTime() / 1000 - ); - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.ExclusiveStartShardId !== undefined && { + ExclusiveStartShardId: input.ExclusiveStartShardId + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.StreamCreationTimestamp !== undefined && { + StreamCreationTimestamp: Math.round( + input.StreamCreationTimestamp.getTime() / 1000 + ) + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1ListStreamConsumersInput = ( input: ListStreamConsumersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StreamARN !== undefined) { - bodyParams["StreamARN"] = input.StreamARN; - } - if (input.StreamCreationTimestamp !== undefined) { - bodyParams["StreamCreationTimestamp"] = Math.round( - input.StreamCreationTimestamp.getTime() / 1000 - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ListStreamsInput = ( input: ListStreamsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartStreamName !== undefined) { - bodyParams["ExclusiveStartStreamName"] = input.ExclusiveStartStreamName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.ExclusiveStartStreamName !== undefined && { + ExclusiveStartStreamName: input.ExclusiveStartStreamName + }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_1ListTagsForStreamInput = ( input: ListTagsForStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExclusiveStartTagKey !== undefined) { - bodyParams["ExclusiveStartTagKey"] = input.ExclusiveStartTagKey; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.ExclusiveStartTagKey !== undefined && { + ExclusiveStartTagKey: input.ExclusiveStartTagKey + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1MergeShardsInput = ( input: MergeShardsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdjacentShardToMerge !== undefined) { - bodyParams["AdjacentShardToMerge"] = input.AdjacentShardToMerge; - } - if (input.ShardToMerge !== undefined) { - bodyParams["ShardToMerge"] = input.ShardToMerge; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.AdjacentShardToMerge !== undefined && { + AdjacentShardToMerge: input.AdjacentShardToMerge + }), + ...(input.ShardToMerge !== undefined && { + ShardToMerge: input.ShardToMerge + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1MetricsNameList = ( @@ -3836,57 +3779,53 @@ const serializeAws_json1_1PutRecordInput = ( input: PutRecordInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = context.base64Encoder(input.Data); - } - if (input.ExplicitHashKey !== undefined) { - bodyParams["ExplicitHashKey"] = input.ExplicitHashKey; - } - if (input.PartitionKey !== undefined) { - bodyParams["PartitionKey"] = input.PartitionKey; - } - if (input.SequenceNumberForOrdering !== undefined) { - bodyParams["SequenceNumberForOrdering"] = input.SequenceNumberForOrdering; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1PutRecordsInput = ( input: PutRecordsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Records !== undefined) { - bodyParams["Records"] = serializeAws_json1_1PutRecordsRequestEntryList( - input.Records, - context - ); - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.Records !== undefined && { + Records: serializeAws_json1_1PutRecordsRequestEntryList( + input.Records, + context + ) + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1PutRecordsRequestEntry = ( input: PutRecordsRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = context.base64Encoder(input.Data); - } - if (input.ExplicitHashKey !== undefined) { - bodyParams["ExplicitHashKey"] = input.ExplicitHashKey; - } - if (input.PartitionKey !== undefined) { - bodyParams["PartitionKey"] = input.PartitionKey; - } - return bodyParams; + return { + ...(input.Data !== undefined && { + Data: context.base64Encoder(input.Data) + }), + ...(input.ExplicitHashKey !== undefined && { + ExplicitHashKey: input.ExplicitHashKey + }), + ...(input.PartitionKey !== undefined && { + PartitionKey: input.PartitionKey + }) + }; }; const serializeAws_json1_1PutRecordsRequestEntryList = ( @@ -3902,119 +3841,96 @@ const serializeAws_json1_1RegisterStreamConsumerInput = ( input: RegisterStreamConsumerInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConsumerName !== undefined) { - bodyParams["ConsumerName"] = input.ConsumerName; - } - if (input.StreamARN !== undefined) { - bodyParams["StreamARN"] = input.StreamARN; - } - return bodyParams; + return { + ...(input.ConsumerName !== undefined && { + ConsumerName: input.ConsumerName + }), + ...(input.StreamARN !== undefined && { StreamARN: input.StreamARN }) + }; }; const serializeAws_json1_1RemoveTagsFromStreamInput = ( input: RemoveTagsFromStreamInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1SplitShardInput = ( input: SplitShardInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NewStartingHashKey !== undefined) { - bodyParams["NewStartingHashKey"] = input.NewStartingHashKey; - } - if (input.ShardToSplit !== undefined) { - bodyParams["ShardToSplit"] = input.ShardToSplit; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.NewStartingHashKey !== undefined && { + NewStartingHashKey: input.NewStartingHashKey + }), + ...(input.ShardToSplit !== undefined && { + ShardToSplit: input.ShardToSplit + }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1StartStreamEncryptionInput = ( input: StartStreamEncryptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionType !== undefined) { - bodyParams["EncryptionType"] = input.EncryptionType; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.EncryptionType !== undefined && { + EncryptionType: input.EncryptionType + }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1StartingPosition = ( input: StartingPosition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SequenceNumber !== undefined) { - bodyParams["SequenceNumber"] = input.SequenceNumber; - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.SequenceNumber !== undefined && { + SequenceNumber: input.SequenceNumber + }), + ...(input.Timestamp !== undefined && { + Timestamp: Math.round(input.Timestamp.getTime() / 1000) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1StopStreamEncryptionInput = ( input: StopStreamEncryptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionType !== undefined) { - bodyParams["EncryptionType"] = input.EncryptionType; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.EncryptionType !== undefined && { + EncryptionType: input.EncryptionType + }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }) + }; }; const serializeAws_json1_1SubscribeToShardInput = ( input: SubscribeToShardInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConsumerARN !== undefined) { - bodyParams["ConsumerARN"] = input.ConsumerARN; - } - if (input.ShardId !== undefined) { - bodyParams["ShardId"] = input.ShardId; - } - if (input.StartingPosition !== undefined) { - bodyParams["StartingPosition"] = serializeAws_json1_1StartingPosition( - input.StartingPosition, - context - ); - } - return bodyParams; + return { + ...(input.ConsumerARN !== undefined && { ConsumerARN: input.ConsumerARN }), + ...(input.ShardId !== undefined && { ShardId: input.ShardId }), + ...(input.StartingPosition !== undefined && { + StartingPosition: serializeAws_json1_1StartingPosition( + input.StartingPosition, + context + ) + }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -4038,17 +3954,13 @@ const serializeAws_json1_1UpdateShardCountInput = ( input: UpdateShardCountInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScalingType !== undefined) { - bodyParams["ScalingType"] = input.ScalingType; - } - if (input.StreamName !== undefined) { - bodyParams["StreamName"] = input.StreamName; - } - if (input.TargetShardCount !== undefined) { - bodyParams["TargetShardCount"] = input.TargetShardCount; - } - return bodyParams; + return { + ...(input.ScalingType !== undefined && { ScalingType: input.ScalingType }), + ...(input.StreamName !== undefined && { StreamName: input.StreamName }), + ...(input.TargetShardCount !== undefined && { + TargetShardCount: input.TargetShardCount + }) + }; }; const deserializeAws_json1_1Consumer = ( diff --git a/clients/client-kms/protocols/Aws_json1_1.ts b/clients/client-kms/protocols/Aws_json1_1.ts index 9edcd1d1e95d..992f8a5fab34 100644 --- a/clients/client-kms/protocols/Aws_json1_1.ts +++ b/clients/client-kms/protocols/Aws_json1_1.ts @@ -7015,310 +7015,269 @@ const serializeAws_json1_1CancelKeyDeletionRequest = ( input: CancelKeyDeletionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1ConnectCustomKeyStoreRequest = ( input: ConnectCustomKeyStoreRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - return bodyParams; + return { + ...(input.CustomKeyStoreId !== undefined && { + CustomKeyStoreId: input.CustomKeyStoreId + }) + }; }; const serializeAws_json1_1CreateAliasRequest = ( input: CreateAliasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasName !== undefined) { - bodyParams["AliasName"] = input.AliasName; - } - if (input.TargetKeyId !== undefined) { - bodyParams["TargetKeyId"] = input.TargetKeyId; - } - return bodyParams; + return { + ...(input.AliasName !== undefined && { AliasName: input.AliasName }), + ...(input.TargetKeyId !== undefined && { TargetKeyId: input.TargetKeyId }) + }; }; const serializeAws_json1_1CreateCustomKeyStoreRequest = ( input: CreateCustomKeyStoreRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudHsmClusterId !== undefined) { - bodyParams["CloudHsmClusterId"] = input.CloudHsmClusterId; - } - if (input.CustomKeyStoreName !== undefined) { - bodyParams["CustomKeyStoreName"] = input.CustomKeyStoreName; - } - if (input.KeyStorePassword !== undefined) { - bodyParams["KeyStorePassword"] = input.KeyStorePassword; - } - if (input.TrustAnchorCertificate !== undefined) { - bodyParams["TrustAnchorCertificate"] = input.TrustAnchorCertificate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateGrantRequest = ( input: CreateGrantRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Constraints !== undefined) { - bodyParams["Constraints"] = serializeAws_json1_1GrantConstraints( - input.Constraints, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.GranteePrincipal !== undefined) { - bodyParams["GranteePrincipal"] = input.GranteePrincipal; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Operations !== undefined) { - bodyParams["Operations"] = serializeAws_json1_1GrantOperationList( - input.Operations, - context - ); - } - if (input.RetiringPrincipal !== undefined) { - bodyParams["RetiringPrincipal"] = input.RetiringPrincipal; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateKeyRequest = ( input: CreateKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BypassPolicyLockoutSafetyCheck !== undefined) { - bodyParams["BypassPolicyLockoutSafetyCheck"] = - input.BypassPolicyLockoutSafetyCheck; - } - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - if (input.CustomerMasterKeySpec !== undefined) { - bodyParams["CustomerMasterKeySpec"] = input.CustomerMasterKeySpec; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.KeyUsage !== undefined) { - bodyParams["KeyUsage"] = input.KeyUsage; - } - if (input.Origin !== undefined) { - bodyParams["Origin"] = input.Origin; - } - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DecryptRequest = ( input: DecryptRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CiphertextBlob !== undefined) { - bodyParams["CiphertextBlob"] = context.base64Encoder(input.CiphertextBlob); - } - if (input.EncryptionAlgorithm !== undefined) { - bodyParams["EncryptionAlgorithm"] = input.EncryptionAlgorithm; - } - if (input.EncryptionContext !== undefined) { - bodyParams["EncryptionContext"] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContext, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteAliasRequest = ( input: DeleteAliasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasName !== undefined) { - bodyParams["AliasName"] = input.AliasName; - } - return bodyParams; + return { + ...(input.AliasName !== undefined && { AliasName: input.AliasName }) + }; }; const serializeAws_json1_1DeleteCustomKeyStoreRequest = ( input: DeleteCustomKeyStoreRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - return bodyParams; + return { + ...(input.CustomKeyStoreId !== undefined && { + CustomKeyStoreId: input.CustomKeyStoreId + }) + }; }; const serializeAws_json1_1DeleteImportedKeyMaterialRequest = ( input: DeleteImportedKeyMaterialRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1DescribeCustomKeyStoresRequest = ( input: DescribeCustomKeyStoresRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - if (input.CustomKeyStoreName !== undefined) { - bodyParams["CustomKeyStoreName"] = input.CustomKeyStoreName; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeKeyRequest = ( input: DescribeKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.GrantTokens !== undefined && { + GrantTokens: serializeAws_json1_1GrantTokenList( + input.GrantTokens, + context + ) + }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1DisableKeyRequest = ( input: DisableKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1DisableKeyRotationRequest = ( input: DisableKeyRotationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1DisconnectCustomKeyStoreRequest = ( input: DisconnectCustomKeyStoreRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - return bodyParams; + return { + ...(input.CustomKeyStoreId !== undefined && { + CustomKeyStoreId: input.CustomKeyStoreId + }) + }; }; const serializeAws_json1_1EnableKeyRequest = ( input: EnableKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1EnableKeyRotationRequest = ( input: EnableKeyRotationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1EncryptRequest = ( input: EncryptRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionAlgorithm !== undefined) { - bodyParams["EncryptionAlgorithm"] = input.EncryptionAlgorithm; - } - if (input.EncryptionContext !== undefined) { - bodyParams["EncryptionContext"] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContext, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Plaintext !== undefined) { - bodyParams["Plaintext"] = context.base64Encoder(input.Plaintext); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1EncryptionContextType = ( @@ -7335,207 +7294,177 @@ const serializeAws_json1_1GenerateDataKeyPairRequest = ( input: GenerateDataKeyPairRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionContext !== undefined) { - bodyParams["EncryptionContext"] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContext, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.KeyPairSpec !== undefined) { - bodyParams["KeyPairSpec"] = input.KeyPairSpec; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GenerateDataKeyPairWithoutPlaintextRequest = ( input: GenerateDataKeyPairWithoutPlaintextRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionContext !== undefined) { - bodyParams["EncryptionContext"] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContext, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.KeyPairSpec !== undefined) { - bodyParams["KeyPairSpec"] = input.KeyPairSpec; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GenerateDataKeyRequest = ( input: GenerateDataKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionContext !== undefined) { - bodyParams["EncryptionContext"] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContext, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.KeySpec !== undefined) { - bodyParams["KeySpec"] = input.KeySpec; - } - if (input.NumberOfBytes !== undefined) { - bodyParams["NumberOfBytes"] = input.NumberOfBytes; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GenerateDataKeyWithoutPlaintextRequest = ( input: GenerateDataKeyWithoutPlaintextRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionContext !== undefined) { - bodyParams["EncryptionContext"] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContext, - context - ); - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.KeySpec !== undefined) { - bodyParams["KeySpec"] = input.KeySpec; - } - if (input.NumberOfBytes !== undefined) { - bodyParams["NumberOfBytes"] = input.NumberOfBytes; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GenerateRandomRequest = ( input: GenerateRandomRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - if (input.NumberOfBytes !== undefined) { - bodyParams["NumberOfBytes"] = input.NumberOfBytes; - } - return bodyParams; + return { + ...(input.CustomKeyStoreId !== undefined && { + CustomKeyStoreId: input.CustomKeyStoreId + }), + ...(input.NumberOfBytes !== undefined && { + NumberOfBytes: input.NumberOfBytes + }) + }; }; const serializeAws_json1_1GetKeyPolicyRequest = ( input: GetKeyPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }) + }; }; const serializeAws_json1_1GetKeyRotationStatusRequest = ( input: GetKeyRotationStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1GetParametersForImportRequest = ( input: GetParametersForImportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.WrappingAlgorithm !== undefined) { - bodyParams["WrappingAlgorithm"] = input.WrappingAlgorithm; - } - if (input.WrappingKeySpec !== undefined) { - bodyParams["WrappingKeySpec"] = input.WrappingKeySpec; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.WrappingAlgorithm !== undefined && { + WrappingAlgorithm: input.WrappingAlgorithm + }), + ...(input.WrappingKeySpec !== undefined && { + WrappingKeySpec: input.WrappingKeySpec + }) + }; }; const serializeAws_json1_1GetPublicKeyRequest = ( input: GetPublicKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.GrantTokens !== undefined && { + GrantTokens: serializeAws_json1_1GrantTokenList( + input.GrantTokens, + context + ) + }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1GrantConstraints = ( input: GrantConstraints, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionContextEquals !== undefined) { - bodyParams[ - "EncryptionContextEquals" - ] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContextEquals, - context - ); - } - if (input.EncryptionContextSubset !== undefined) { - bodyParams[ - "EncryptionContextSubset" - ] = serializeAws_json1_1EncryptionContextType( - input.EncryptionContextSubset, - context - ); - } - return bodyParams; + return { + ...(input.EncryptionContextEquals !== undefined && { + EncryptionContextEquals: serializeAws_json1_1EncryptionContextType( + input.EncryptionContextEquals, + context + ) + }), + ...(input.EncryptionContextSubset !== undefined && { + EncryptionContextSubset: serializeAws_json1_1EncryptionContextType( + input.EncryptionContextSubset, + context + ) + }) + }; }; const serializeAws_json1_1GrantOperationList = ( @@ -7556,273 +7485,203 @@ const serializeAws_json1_1ImportKeyMaterialRequest = ( input: ImportKeyMaterialRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptedKeyMaterial !== undefined) { - bodyParams["EncryptedKeyMaterial"] = context.base64Encoder( - input.EncryptedKeyMaterial - ); - } - if (input.ExpirationModel !== undefined) { - bodyParams["ExpirationModel"] = input.ExpirationModel; - } - if (input.ImportToken !== undefined) { - bodyParams["ImportToken"] = context.base64Encoder(input.ImportToken); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.ValidTo !== undefined) { - bodyParams["ValidTo"] = Math.round(input.ValidTo.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListAliasesRequest = ( input: ListAliasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListGrantsRequest = ( input: ListGrantsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListKeyPoliciesRequest = ( input: ListKeyPoliciesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListKeysRequest = ( input: ListKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListResourceTagsRequest = ( input: ListResourceTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListRetirableGrantsRequest = ( input: ListRetirableGrantsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.RetiringPrincipal !== undefined) { - bodyParams["RetiringPrincipal"] = input.RetiringPrincipal; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.RetiringPrincipal !== undefined && { + RetiringPrincipal: input.RetiringPrincipal + }) + }; }; const serializeAws_json1_1PutKeyPolicyRequest = ( input: PutKeyPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BypassPolicyLockoutSafetyCheck !== undefined) { - bodyParams["BypassPolicyLockoutSafetyCheck"] = - input.BypassPolicyLockoutSafetyCheck; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ReEncryptRequest = ( input: ReEncryptRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CiphertextBlob !== undefined) { - bodyParams["CiphertextBlob"] = context.base64Encoder(input.CiphertextBlob); - } - if (input.DestinationEncryptionAlgorithm !== undefined) { - bodyParams["DestinationEncryptionAlgorithm"] = - input.DestinationEncryptionAlgorithm; - } - if (input.DestinationEncryptionContext !== undefined) { - bodyParams[ - "DestinationEncryptionContext" - ] = serializeAws_json1_1EncryptionContextType( - input.DestinationEncryptionContext, - context - ); - } - if (input.DestinationKeyId !== undefined) { - bodyParams["DestinationKeyId"] = input.DestinationKeyId; - } - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.SourceEncryptionAlgorithm !== undefined) { - bodyParams["SourceEncryptionAlgorithm"] = input.SourceEncryptionAlgorithm; - } - if (input.SourceEncryptionContext !== undefined) { - bodyParams[ - "SourceEncryptionContext" - ] = serializeAws_json1_1EncryptionContextType( - input.SourceEncryptionContext, - context - ); - } - if (input.SourceKeyId !== undefined) { - bodyParams["SourceKeyId"] = input.SourceKeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RetireGrantRequest = ( input: RetireGrantRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GrantId !== undefined) { - bodyParams["GrantId"] = input.GrantId; - } - if (input.GrantToken !== undefined) { - bodyParams["GrantToken"] = input.GrantToken; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.GrantId !== undefined && { GrantId: input.GrantId }), + ...(input.GrantToken !== undefined && { GrantToken: input.GrantToken }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1RevokeGrantRequest = ( input: RevokeGrantRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GrantId !== undefined) { - bodyParams["GrantId"] = input.GrantId; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.GrantId !== undefined && { GrantId: input.GrantId }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1ScheduleKeyDeletionRequest = ( input: ScheduleKeyDeletionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.PendingWindowInDays !== undefined) { - bodyParams["PendingWindowInDays"] = input.PendingWindowInDays; - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.PendingWindowInDays !== undefined && { + PendingWindowInDays: input.PendingWindowInDays + }) + }; }; const serializeAws_json1_1SignRequest = ( input: SignRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Message !== undefined) { - bodyParams["Message"] = context.base64Encoder(input.Message); - } - if (input.MessageType !== undefined) { - bodyParams["MessageType"] = input.MessageType; - } - if (input.SigningAlgorithm !== undefined) { - bodyParams["SigningAlgorithm"] = input.SigningAlgorithm; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.TagKey !== undefined) { - bodyParams["TagKey"] = input.TagKey; - } - if (input.TagValue !== undefined) { - bodyParams["TagValue"] = input.TagValue; - } - return bodyParams; + return { + ...(input.TagKey !== undefined && { TagKey: input.TagKey }), + ...(input.TagValue !== undefined && { TagValue: input.TagValue }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -7843,108 +7702,89 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateAliasRequest = ( input: UpdateAliasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AliasName !== undefined) { - bodyParams["AliasName"] = input.AliasName; - } - if (input.TargetKeyId !== undefined) { - bodyParams["TargetKeyId"] = input.TargetKeyId; - } - return bodyParams; + return { + ...(input.AliasName !== undefined && { AliasName: input.AliasName }), + ...(input.TargetKeyId !== undefined && { TargetKeyId: input.TargetKeyId }) + }; }; const serializeAws_json1_1UpdateCustomKeyStoreRequest = ( input: UpdateCustomKeyStoreRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudHsmClusterId !== undefined) { - bodyParams["CloudHsmClusterId"] = input.CloudHsmClusterId; - } - if (input.CustomKeyStoreId !== undefined) { - bodyParams["CustomKeyStoreId"] = input.CustomKeyStoreId; - } - if (input.KeyStorePassword !== undefined) { - bodyParams["KeyStorePassword"] = input.KeyStorePassword; - } - if (input.NewCustomKeyStoreName !== undefined) { - bodyParams["NewCustomKeyStoreName"] = input.NewCustomKeyStoreName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateKeyDescriptionRequest = ( input: UpdateKeyDescriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }) + }; }; const serializeAws_json1_1VerifyRequest = ( input: VerifyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GrantTokens !== undefined) { - bodyParams["GrantTokens"] = serializeAws_json1_1GrantTokenList( - input.GrantTokens, - context - ); - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Message !== undefined) { - bodyParams["Message"] = context.base64Encoder(input.Message); - } - if (input.MessageType !== undefined) { - bodyParams["MessageType"] = input.MessageType; - } - if (input.Signature !== undefined) { - bodyParams["Signature"] = context.base64Encoder(input.Signature); - } - if (input.SigningAlgorithm !== undefined) { - bodyParams["SigningAlgorithm"] = input.SigningAlgorithm; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1AliasList = ( diff --git a/clients/client-lakeformation/protocols/Aws_json1_1.ts b/clients/client-lakeformation/protocols/Aws_json1_1.ts index b644675311a2..579250e5dc23 100644 --- a/clients/client-lakeformation/protocols/Aws_json1_1.ts +++ b/clients/client-lakeformation/protocols/Aws_json1_1.ts @@ -1533,56 +1533,42 @@ const serializeAws_json1_1BatchGrantPermissionsRequest = ( input: BatchGrantPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Entries !== undefined) { - bodyParams[ - "Entries" - ] = serializeAws_json1_1BatchPermissionsRequestEntryList( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1BatchPermissionsRequestEntryList( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1BatchPermissionsRequestEntry = ( input: BatchPermissionsRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = serializeAws_json1_1PermissionList( - input.Permissions, - context - ); - } - if (input.PermissionsWithGrantOption !== undefined) { - bodyParams[ - "PermissionsWithGrantOption" - ] = serializeAws_json1_1PermissionList( - input.PermissionsWithGrantOption, - context - ); - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = serializeAws_json1_1DataLakePrincipal( - input.Principal, - context - ); - } - if (input.Resource !== undefined) { - bodyParams["Resource"] = serializeAws_json1_1Resource( - input.Resource, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1BatchPermissionsRequestEntryList = ( @@ -1598,27 +1584,22 @@ const serializeAws_json1_1BatchRevokePermissionsRequest = ( input: BatchRevokePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Entries !== undefined) { - bodyParams[ - "Entries" - ] = serializeAws_json1_1BatchPermissionsRequestEntryList( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1BatchPermissionsRequestEntryList( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1CatalogResource = ( input: CatalogResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ColumnNames = ( @@ -1632,26 +1613,25 @@ const serializeAws_json1_1ColumnWildcard = ( input: ColumnWildcard, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludedColumnNames !== undefined) { - bodyParams["ExcludedColumnNames"] = serializeAws_json1_1ColumnNames( - input.ExcludedColumnNames, - context - ); - } - return bodyParams; + return { + ...(input.ExcludedColumnNames !== undefined && { + ExcludedColumnNames: serializeAws_json1_1ColumnNames( + input.ExcludedColumnNames, + context + ) + }) + }; }; const serializeAws_json1_1DataLakePrincipal = ( input: DataLakePrincipal, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataLakePrincipalIdentifier !== undefined) { - bodyParams["DataLakePrincipalIdentifier"] = - input.DataLakePrincipalIdentifier; - } - return bodyParams; + return { + ...(input.DataLakePrincipalIdentifier !== undefined && { + DataLakePrincipalIdentifier: input.DataLakePrincipalIdentifier + }) + }; }; const serializeAws_json1_1DataLakePrincipalList = ( @@ -1667,194 +1647,146 @@ const serializeAws_json1_1DataLakeSettings = ( input: DataLakeSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreateDatabaseDefaultPermissions !== undefined) { - bodyParams[ - "CreateDatabaseDefaultPermissions" - ] = serializeAws_json1_1PrincipalPermissionsList( - input.CreateDatabaseDefaultPermissions, - context - ); - } - if (input.CreateTableDefaultPermissions !== undefined) { - bodyParams[ - "CreateTableDefaultPermissions" - ] = serializeAws_json1_1PrincipalPermissionsList( - input.CreateTableDefaultPermissions, - context - ); - } - if (input.DataLakeAdmins !== undefined) { - bodyParams["DataLakeAdmins"] = serializeAws_json1_1DataLakePrincipalList( - input.DataLakeAdmins, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DataLocationResource = ( input: DataLocationResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DatabaseResource = ( input: DatabaseResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeregisterResourceRequest = ( input: DeregisterResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DescribeResourceRequest = ( input: DescribeResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetDataLakeSettingsRequest = ( input: GetDataLakeSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }) + }; }; const serializeAws_json1_1GetEffectivePermissionsForPathRequest = ( input: GetEffectivePermissionsForPathRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GrantPermissionsRequest = ( input: GrantPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = serializeAws_json1_1PermissionList( - input.Permissions, - context - ); - } - if (input.PermissionsWithGrantOption !== undefined) { - bodyParams[ - "PermissionsWithGrantOption" - ] = serializeAws_json1_1PermissionList( - input.PermissionsWithGrantOption, - context - ); - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = serializeAws_json1_1DataLakePrincipal( - input.Principal, - context - ); - } - if (input.Resource !== undefined) { - bodyParams["Resource"] = serializeAws_json1_1Resource( - input.Resource, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListPermissionsRequest = ( input: ListPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = serializeAws_json1_1DataLakePrincipal( - input.Principal, - context - ); - } - if (input.Resource !== undefined) { - bodyParams["Resource"] = serializeAws_json1_1Resource( - input.Resource, - context - ); - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListResourcesRequest = ( input: ListResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FilterConditionList !== undefined) { - bodyParams["FilterConditionList"] = serializeAws_json1_1FilterConditionList( - input.FilterConditionList, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.FilterConditionList !== undefined && { + FilterConditionList: serializeAws_json1_1FilterConditionList( + input.FilterConditionList, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1PermissionList = ( @@ -1868,20 +1800,17 @@ const serializeAws_json1_1PrincipalPermissions = ( input: PrincipalPermissions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = serializeAws_json1_1PermissionList( - input.Permissions, - context - ); - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = serializeAws_json1_1DataLakePrincipal( - input.Principal, - context - ); - } - return bodyParams; + return { + ...(input.Permissions !== undefined && { + Permissions: serializeAws_json1_1PermissionList( + input.Permissions, + context + ) + }), + ...(input.Principal !== undefined && { + Principal: serializeAws_json1_1DataLakePrincipal(input.Principal, context) + }) + }; }; const serializeAws_json1_1PrincipalPermissionsList = ( @@ -1897,185 +1826,145 @@ const serializeAws_json1_1PutDataLakeSettingsRequest = ( input: PutDataLakeSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.DataLakeSettings !== undefined) { - bodyParams["DataLakeSettings"] = serializeAws_json1_1DataLakeSettings( - input.DataLakeSettings, - context - ); - } - return bodyParams; + return { + ...(input.CatalogId !== undefined && { CatalogId: input.CatalogId }), + ...(input.DataLakeSettings !== undefined && { + DataLakeSettings: serializeAws_json1_1DataLakeSettings( + input.DataLakeSettings, + context + ) + }) + }; }; const serializeAws_json1_1RegisterResourceRequest = ( input: RegisterResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.UseServiceLinkedRole !== undefined) { - bodyParams["UseServiceLinkedRole"] = input.UseServiceLinkedRole; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.UseServiceLinkedRole !== undefined && { + UseServiceLinkedRole: input.UseServiceLinkedRole + }) + }; }; const serializeAws_json1_1Resource = ( input: Resource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Catalog !== undefined) { - bodyParams["Catalog"] = serializeAws_json1_1CatalogResource( - input.Catalog, - context - ); - } - if (input.DataLocation !== undefined) { - bodyParams["DataLocation"] = serializeAws_json1_1DataLocationResource( - input.DataLocation, - context - ); - } - if (input.Database !== undefined) { - bodyParams["Database"] = serializeAws_json1_1DatabaseResource( - input.Database, - context - ); - } - if (input.Table !== undefined) { - bodyParams["Table"] = serializeAws_json1_1TableResource( - input.Table, - context - ); - } - if (input.TableWithColumns !== undefined) { - bodyParams[ - "TableWithColumns" - ] = serializeAws_json1_1TableWithColumnsResource( - input.TableWithColumns, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RevokePermissionsRequest = ( input: RevokePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CatalogId !== undefined) { - bodyParams["CatalogId"] = input.CatalogId; - } - if (input.Permissions !== undefined) { - bodyParams["Permissions"] = serializeAws_json1_1PermissionList( - input.Permissions, - context - ); - } - if (input.PermissionsWithGrantOption !== undefined) { - bodyParams[ - "PermissionsWithGrantOption" - ] = serializeAws_json1_1PermissionList( - input.PermissionsWithGrantOption, - context - ); - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = serializeAws_json1_1DataLakePrincipal( - input.Principal, - context - ); - } - if (input.Resource !== undefined) { - bodyParams["Resource"] = serializeAws_json1_1Resource( - input.Resource, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1TableResource = ( input: TableResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1TableWithColumnsResource = ( input: TableWithColumnsResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnNames !== undefined) { - bodyParams["ColumnNames"] = serializeAws_json1_1ColumnNames( - input.ColumnNames, - context - ); - } - if (input.ColumnWildcard !== undefined) { - bodyParams["ColumnWildcard"] = serializeAws_json1_1ColumnWildcard( - input.ColumnWildcard, - context - ); - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(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 }) + }; }; const serializeAws_json1_1UpdateResourceRequest = ( input: UpdateResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_json1_1FilterCondition = ( input: FilterCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.Field !== undefined) { - bodyParams["Field"] = input.Field; - } - if (input.StringValueList !== undefined) { - bodyParams["StringValueList"] = serializeAws_json1_1StringValueList( - input.StringValueList, - context - ); - } - return bodyParams; + return { + ...(input.ComparisonOperator !== undefined && { + ComparisonOperator: input.ComparisonOperator + }), + ...(input.Field !== undefined && { Field: input.Field }), + ...(input.StringValueList !== undefined && { + StringValueList: serializeAws_json1_1StringValueList( + input.StringValueList, + context + ) + }) + }; }; const serializeAws_json1_1FilterConditionList = ( diff --git a/clients/client-lambda/protocols/Aws_restJson1_1.ts b/clients/client-lambda/protocols/Aws_restJson1_1.ts index baa700ec1ced..4d6b57f8cc30 100644 --- a/clients/client-lambda/protocols/Aws_restJson1_1.ts +++ b/clients/client-lambda/protocols/Aws_restJson1_1.ts @@ -9553,16 +9553,14 @@ const serializeAws_restJson1_1AliasRoutingConfiguration = ( input: AliasRoutingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalVersionWeights !== undefined) { - bodyParams[ - "AdditionalVersionWeights" - ] = serializeAws_restJson1_1AdditionalVersionWeights( - input.AdditionalVersionWeights, - context - ); - } - return bodyParams; + return { + ...(input.AdditionalVersionWeights !== undefined && { + AdditionalVersionWeights: serializeAws_restJson1_1AdditionalVersionWeights( + input.AdditionalVersionWeights, + context + ) + }) + }; }; const serializeAws_restJson1_1CompatibleRuntimes = ( @@ -9576,45 +9574,37 @@ const serializeAws_restJson1_1DeadLetterConfig = ( input: DeadLetterConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetArn !== undefined) { - bodyParams["TargetArn"] = input.TargetArn; - } - return bodyParams; + return { + ...(input.TargetArn !== undefined && { TargetArn: input.TargetArn }) + }; }; const serializeAws_restJson1_1DestinationConfig = ( input: DestinationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OnFailure !== undefined) { - bodyParams["OnFailure"] = serializeAws_restJson1_1OnFailure( - input.OnFailure, - context - ); - } - if (input.OnSuccess !== undefined) { - bodyParams["OnSuccess"] = serializeAws_restJson1_1OnSuccess( - input.OnSuccess, - context - ); - } - return bodyParams; + return { + ...(input.OnFailure !== undefined && { + OnFailure: serializeAws_restJson1_1OnFailure(input.OnFailure, context) + }), + ...(input.OnSuccess !== undefined && { + OnSuccess: serializeAws_restJson1_1OnSuccess(input.OnSuccess, context) + }) + }; }; const serializeAws_restJson1_1Environment = ( input: Environment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Variables !== undefined) { - bodyParams["Variables"] = serializeAws_restJson1_1EnvironmentVariables( - input.Variables, - context - ); - } - return bodyParams; + return { + ...(input.Variables !== undefined && { + Variables: serializeAws_restJson1_1EnvironmentVariables( + input.Variables, + context + ) + }) + }; }; const serializeAws_restJson1_1EnvironmentVariables = ( @@ -9631,20 +9621,16 @@ const serializeAws_restJson1_1FunctionCode = ( input: FunctionCode, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3Key !== undefined) { - bodyParams["S3Key"] = input.S3Key; - } - if (input.S3ObjectVersion !== undefined) { - bodyParams["S3ObjectVersion"] = input.S3ObjectVersion; - } - if (input.ZipFile !== undefined) { - bodyParams["ZipFile"] = context.base64Encoder(input.ZipFile); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_restJson1_1LayerList = ( @@ -9658,42 +9644,34 @@ const serializeAws_restJson1_1LayerVersionContentInput = ( input: LayerVersionContentInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3Key !== undefined) { - bodyParams["S3Key"] = input.S3Key; - } - if (input.S3ObjectVersion !== undefined) { - bodyParams["S3ObjectVersion"] = input.S3ObjectVersion; - } - if (input.ZipFile !== undefined) { - bodyParams["ZipFile"] = context.base64Encoder(input.ZipFile); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_restJson1_1OnFailure = ( input: OnFailure, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["Destination"] = input.Destination; - } - return bodyParams; + return { + ...(input.Destination !== undefined && { Destination: input.Destination }) + }; }; const serializeAws_restJson1_1OnSuccess = ( input: OnSuccess, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["Destination"] = input.Destination; - } - return bodyParams; + return { + ...(input.Destination !== undefined && { Destination: input.Destination }) + }; }; const serializeAws_restJson1_1SecurityGroupIds = ( @@ -9724,31 +9702,26 @@ const serializeAws_restJson1_1TracingConfig = ( input: TracingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - return bodyParams; + return { + ...(input.Mode !== undefined && { Mode: input.Mode }) + }; }; const serializeAws_restJson1_1VpcConfig = ( input: VpcConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_restJson1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_restJson1_1SubnetIds( - input.SubnetIds, - context - ); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_restJson1_1SecurityGroupIds( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_restJson1_1SubnetIds(input.SubnetIds, context) + }) + }; }; const deserializeAws_restJson1_1AccountLimit = ( diff --git a/clients/client-lex-model-building-service/protocols/Aws_restJson1_1.ts b/clients/client-lex-model-building-service/protocols/Aws_restJson1_1.ts index e6ba07277394..bbd94d3addc8 100644 --- a/clients/client-lex-model-building-service/protocols/Aws_restJson1_1.ts +++ b/clients/client-lex-model-building-service/protocols/Aws_restJson1_1.ts @@ -6331,48 +6331,39 @@ const serializeAws_restJson1_1CodeHook = ( input: CodeHook, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.messageVersion !== undefined) { - bodyParams["messageVersion"] = input.messageVersion; - } - if (input.uri !== undefined) { - bodyParams["uri"] = input.uri; - } - return bodyParams; + return { + ...(input.messageVersion !== undefined && { + messageVersion: input.messageVersion + }), + ...(input.uri !== undefined && { uri: input.uri }) + }; }; const serializeAws_restJson1_1ConversationLogsRequest = ( input: ConversationLogsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.iamRoleArn !== undefined) { - bodyParams["iamRoleArn"] = input.iamRoleArn; - } - if (input.logSettings !== undefined) { - bodyParams["logSettings"] = serializeAws_restJson1_1LogSettingsRequestList( - input.logSettings, - context - ); - } - return bodyParams; + return { + ...(input.iamRoleArn !== undefined && { iamRoleArn: input.iamRoleArn }), + ...(input.logSettings !== undefined && { + logSettings: serializeAws_restJson1_1LogSettingsRequestList( + input.logSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1EnumerationValue = ( input: EnumerationValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.synonyms !== undefined) { - bodyParams["synonyms"] = serializeAws_restJson1_1SynonymList( - input.synonyms, - context - ); - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.synonyms !== undefined && { + synonyms: serializeAws_restJson1_1SynonymList(input.synonyms, context) + }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1EnumerationValues = ( @@ -6388,51 +6379,41 @@ const serializeAws_restJson1_1FollowUpPrompt = ( input: FollowUpPrompt, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.prompt !== undefined) { - bodyParams["prompt"] = serializeAws_restJson1_1Prompt( - input.prompt, - context - ); - } - if (input.rejectionStatement !== undefined) { - bodyParams["rejectionStatement"] = serializeAws_restJson1_1Statement( - input.rejectionStatement, - context - ); - } - return bodyParams; + return { + ...(input.prompt !== undefined && { + prompt: serializeAws_restJson1_1Prompt(input.prompt, context) + }), + ...(input.rejectionStatement !== undefined && { + rejectionStatement: serializeAws_restJson1_1Statement( + input.rejectionStatement, + context + ) + }) + }; }; const serializeAws_restJson1_1FulfillmentActivity = ( input: FulfillmentActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.codeHook !== undefined) { - bodyParams["codeHook"] = serializeAws_restJson1_1CodeHook( - input.codeHook, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.codeHook !== undefined && { + codeHook: serializeAws_restJson1_1CodeHook(input.codeHook, context) + }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_restJson1_1Intent = ( input: Intent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.intentName !== undefined) { - bodyParams["intentName"] = input.intentName; - } - if (input.intentVersion !== undefined) { - bodyParams["intentVersion"] = input.intentVersion; - } - return bodyParams; + return { + ...(input.intentName !== undefined && { intentName: input.intentName }), + ...(input.intentVersion !== undefined && { + intentVersion: input.intentVersion + }) + }; }; const serializeAws_restJson1_1IntentList = ( @@ -6453,20 +6434,12 @@ const serializeAws_restJson1_1LogSettingsRequest = ( input: LogSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destination !== undefined) { - bodyParams["destination"] = input.destination; - } - if (input.kmsKeyArn !== undefined) { - bodyParams["kmsKeyArn"] = input.kmsKeyArn; - } - if (input.logType !== undefined) { - bodyParams["logType"] = input.logType; - } - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1LogSettingsRequestList = ( @@ -6482,17 +6455,11 @@ const serializeAws_restJson1_1Message = ( input: Message, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.content !== undefined) { - bodyParams["content"] = input.content; - } - if (input.contentType !== undefined) { - bodyParams["contentType"] = input.contentType; - } - if (input.groupNumber !== undefined) { - bodyParams["groupNumber"] = input.groupNumber; - } - return bodyParams; + return { + ...(input.content !== undefined && { content: input.content }), + ...(input.contentType !== undefined && { contentType: input.contentType }), + ...(input.groupNumber !== undefined && { groupNumber: input.groupNumber }) + }; }; const serializeAws_restJson1_1MessageList = ( @@ -6506,64 +6473,51 @@ const serializeAws_restJson1_1Prompt = ( input: Prompt, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxAttempts !== undefined) { - bodyParams["maxAttempts"] = input.maxAttempts; - } - if (input.messages !== undefined) { - bodyParams["messages"] = serializeAws_restJson1_1MessageList( - input.messages, - context - ); - } - if (input.responseCard !== undefined) { - bodyParams["responseCard"] = input.responseCard; - } - return bodyParams; + return { + ...(input.maxAttempts !== undefined && { maxAttempts: input.maxAttempts }), + ...(input.messages !== undefined && { + messages: serializeAws_restJson1_1MessageList(input.messages, context) + }), + ...(input.responseCard !== undefined && { + responseCard: input.responseCard + }) + }; }; const serializeAws_restJson1_1Slot = ( input: Slot, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.obfuscationSetting !== undefined) { - bodyParams["obfuscationSetting"] = input.obfuscationSetting; - } - if (input.priority !== undefined) { - bodyParams["priority"] = input.priority; - } - if (input.responseCard !== undefined) { - bodyParams["responseCard"] = input.responseCard; - } - if (input.sampleUtterances !== undefined) { - bodyParams["sampleUtterances"] = serializeAws_restJson1_1SlotUtteranceList( - input.sampleUtterances, - context - ); - } - if (input.slotConstraint !== undefined) { - bodyParams["slotConstraint"] = input.slotConstraint; - } - if (input.slotType !== undefined) { - bodyParams["slotType"] = input.slotType; - } - if (input.slotTypeVersion !== undefined) { - bodyParams["slotTypeVersion"] = input.slotTypeVersion; - } - if (input.valueElicitationPrompt !== undefined) { - bodyParams["valueElicitationPrompt"] = serializeAws_restJson1_1Prompt( - input.valueElicitationPrompt, - context - ); - } - return bodyParams; + return { + ...(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_restJson1_1SlotUtteranceList( + 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_restJson1_1Prompt( + input.valueElicitationPrompt, + context + ) + }) + }; }; const serializeAws_restJson1_1SlotList = ( @@ -6584,17 +6538,14 @@ const serializeAws_restJson1_1Statement = ( input: Statement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.messages !== undefined) { - bodyParams["messages"] = serializeAws_restJson1_1MessageList( - input.messages, - context - ); - } - if (input.responseCard !== undefined) { - bodyParams["responseCard"] = input.responseCard; - } - return bodyParams; + return { + ...(input.messages !== undefined && { + messages: serializeAws_restJson1_1MessageList(input.messages, context) + }), + ...(input.responseCard !== undefined && { + responseCard: input.responseCard + }) + }; }; const serializeAws_restJson1_1SynonymList = ( diff --git a/clients/client-lex-runtime-service/protocols/Aws_restJson1_1.ts b/clients/client-lex-runtime-service/protocols/Aws_restJson1_1.ts index cf10d4f52b95..d04783d55d03 100644 --- a/clients/client-lex-runtime-service/protocols/Aws_restJson1_1.ts +++ b/clients/client-lex-runtime-service/protocols/Aws_restJson1_1.ts @@ -1394,64 +1394,50 @@ const serializeAws_restJson1_1DialogAction = ( input: DialogAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fulfillmentState !== undefined) { - bodyParams["fulfillmentState"] = input.fulfillmentState; - } - if (input.intentName !== undefined) { - bodyParams["intentName"] = input.intentName; - } - if (input.message !== undefined) { - bodyParams["message"] = input.message; - } - if (input.messageFormat !== undefined) { - bodyParams["messageFormat"] = input.messageFormat; - } - if (input.slotToElicit !== undefined) { - bodyParams["slotToElicit"] = input.slotToElicit; - } - if (input.slots !== undefined) { - bodyParams["slots"] = serializeAws_restJson1_1StringMap( - input.slots, - context - ); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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_restJson1_1StringMap(input.slots, context) + }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_restJson1_1IntentSummary = ( input: IntentSummary, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.checkpointLabel !== undefined) { - bodyParams["checkpointLabel"] = input.checkpointLabel; - } - if (input.confirmationStatus !== undefined) { - bodyParams["confirmationStatus"] = input.confirmationStatus; - } - if (input.dialogActionType !== undefined) { - bodyParams["dialogActionType"] = input.dialogActionType; - } - if (input.fulfillmentState !== undefined) { - bodyParams["fulfillmentState"] = input.fulfillmentState; - } - if (input.intentName !== undefined) { - bodyParams["intentName"] = input.intentName; - } - if (input.slotToElicit !== undefined) { - bodyParams["slotToElicit"] = input.slotToElicit; - } - if (input.slots !== undefined) { - bodyParams["slots"] = serializeAws_restJson1_1StringMap( - input.slots, - context - ); - } - return bodyParams; + 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_restJson1_1StringMap(input.slots, context) + }) + }; }; const serializeAws_restJson1_1IntentSummaryList = ( diff --git a/clients/client-license-manager/protocols/Aws_json1_1.ts b/clients/client-license-manager/protocols/Aws_json1_1.ts index 4ba34ab5af05..68be98c24e85 100644 --- a/clients/client-license-manager/protocols/Aws_json1_1.ts +++ b/clients/client-license-manager/protocols/Aws_json1_1.ts @@ -2383,68 +2383,54 @@ const serializeAws_json1_1CreateLicenseConfigurationRequest = ( input: CreateLicenseConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.LicenseCount !== undefined) { - bodyParams["LicenseCount"] = input.LicenseCount; - } - if (input.LicenseCountHardLimit !== undefined) { - bodyParams["LicenseCountHardLimit"] = input.LicenseCountHardLimit; - } - if (input.LicenseCountingType !== undefined) { - bodyParams["LicenseCountingType"] = input.LicenseCountingType; - } - if (input.LicenseRules !== undefined) { - bodyParams["LicenseRules"] = serializeAws_json1_1StringList( - input.LicenseRules, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ProductInformationList !== undefined) { - bodyParams[ - "ProductInformationList" - ] = serializeAws_json1_1ProductInformationList( - input.ProductInformationList, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(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) + }) + }; }; const serializeAws_json1_1DeleteLicenseConfigurationRequest = ( input: DeleteLicenseConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - return bodyParams; + return { + ...(input.LicenseConfigurationArn !== undefined && { + LicenseConfigurationArn: input.LicenseConfigurationArn + }) + }; }; const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1FilterValues = ( @@ -2465,36 +2451,29 @@ const serializeAws_json1_1GetLicenseConfigurationRequest = ( input: GetLicenseConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - return bodyParams; + return { + ...(input.LicenseConfigurationArn !== undefined && { + LicenseConfigurationArn: input.LicenseConfigurationArn + }) + }; }; const serializeAws_json1_1GetServiceSettingsRequest = ( input: GetServiceSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1InventoryFilter = ( input: InventoryFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = input.Condition; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Condition !== undefined && { Condition: input.Condition }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1InventoryFilterList = ( @@ -2510,11 +2489,11 @@ const serializeAws_json1_1LicenseSpecification = ( input: LicenseSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - return bodyParams; + return { + ...(input.LicenseConfigurationArn !== undefined && { + LicenseConfigurationArn: input.LicenseConfigurationArn + }) + }; }; const serializeAws_json1_1LicenseSpecifications = ( @@ -2530,179 +2509,143 @@ const serializeAws_json1_1ListAssociationsForLicenseConfigurationRequest = ( input: ListAssociationsForLicenseConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.LicenseConfigurationArn !== undefined && { + LicenseConfigurationArn: input.LicenseConfigurationArn + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsRequest = ( input: ListFailuresForLicenseConfigurationOperationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.LicenseConfigurationArn !== undefined && { + LicenseConfigurationArn: input.LicenseConfigurationArn + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListLicenseConfigurationsRequest = ( input: ListLicenseConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.LicenseConfigurationArns !== undefined) { - bodyParams["LicenseConfigurationArns"] = serializeAws_json1_1StringList( - input.LicenseConfigurationArns, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListLicenseSpecificationsForResourceRequest = ( input: ListLicenseSpecificationsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListResourceInventoryRequest = ( input: ListResourceInventoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1InventoryFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListUsageForLicenseConfigurationRequest = ( input: ListUsageForLicenseConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1OrganizationConfiguration = ( input: OrganizationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnableIntegration !== undefined) { - bodyParams["EnableIntegration"] = input.EnableIntegration; - } - return bodyParams; + return { + ...(input.EnableIntegration !== undefined && { + EnableIntegration: input.EnableIntegration + }) + }; }; const serializeAws_json1_1ProductInformation = ( input: ProductInformation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProductInformationFilterList !== undefined) { - bodyParams[ - "ProductInformationFilterList" - ] = serializeAws_json1_1ProductInformationFilterList( - input.ProductInformationFilterList, - context - ); - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.ProductInformationFilterList !== undefined && { + ProductInformationFilterList: serializeAws_json1_1ProductInformationFilterList( + input.ProductInformationFilterList, + context + ) + }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1ProductInformationFilter = ( input: ProductInformationFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProductInformationFilterComparator !== undefined) { - bodyParams["ProductInformationFilterComparator"] = - input.ProductInformationFilterComparator; - } - if (input.ProductInformationFilterName !== undefined) { - bodyParams["ProductInformationFilterName"] = - input.ProductInformationFilterName; - } - if (input.ProductInformationFilterValue !== undefined) { - bodyParams[ - "ProductInformationFilterValue" - ] = serializeAws_json1_1StringList( - input.ProductInformationFilterValue, - context - ); - } - return bodyParams; + return { + ...(input.ProductInformationFilterComparator !== undefined && { + ProductInformationFilterComparator: + input.ProductInformationFilterComparator + }), + ...(input.ProductInformationFilterName !== undefined && { + ProductInformationFilterName: input.ProductInformationFilterName + }), + ...(input.ProductInformationFilterValue !== undefined && { + ProductInformationFilterValue: serializeAws_json1_1StringList( + input.ProductInformationFilterValue, + context + ) + }) + }; }; const serializeAws_json1_1ProductInformationFilterList = ( @@ -2731,14 +2674,10 @@ const serializeAws_json1_1StringList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -2759,124 +2698,95 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateLicenseConfigurationRequest = ( input: UpdateLicenseConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.LicenseConfigurationArn !== undefined) { - bodyParams["LicenseConfigurationArn"] = input.LicenseConfigurationArn; - } - if (input.LicenseConfigurationStatus !== undefined) { - bodyParams["LicenseConfigurationStatus"] = input.LicenseConfigurationStatus; - } - if (input.LicenseCount !== undefined) { - bodyParams["LicenseCount"] = input.LicenseCount; - } - if (input.LicenseCountHardLimit !== undefined) { - bodyParams["LicenseCountHardLimit"] = input.LicenseCountHardLimit; - } - if (input.LicenseRules !== undefined) { - bodyParams["LicenseRules"] = serializeAws_json1_1StringList( - input.LicenseRules, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ProductInformationList !== undefined) { - bodyParams[ - "ProductInformationList" - ] = serializeAws_json1_1ProductInformationList( - input.ProductInformationList, - context - ); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(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 + ) + }) + }; }; const serializeAws_json1_1UpdateLicenseSpecificationsForResourceRequest = ( input: UpdateLicenseSpecificationsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddLicenseSpecifications !== undefined) { - bodyParams[ - "AddLicenseSpecifications" - ] = serializeAws_json1_1LicenseSpecifications( - input.AddLicenseSpecifications, - context - ); - } - if (input.RemoveLicenseSpecifications !== undefined) { - bodyParams[ - "RemoveLicenseSpecifications" - ] = serializeAws_json1_1LicenseSpecifications( - input.RemoveLicenseSpecifications, - context - ); - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateServiceSettingsRequest = ( input: UpdateServiceSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnableCrossAccountsDiscovery !== undefined) { - bodyParams["EnableCrossAccountsDiscovery"] = - input.EnableCrossAccountsDiscovery; - } - if (input.OrganizationConfiguration !== undefined) { - bodyParams[ - "OrganizationConfiguration" - ] = serializeAws_json1_1OrganizationConfiguration( - input.OrganizationConfiguration, - context - ); - } - if (input.S3BucketArn !== undefined) { - bodyParams["S3BucketArn"] = input.S3BucketArn; - } - if (input.SnsTopicArn !== undefined) { - bodyParams["SnsTopicArn"] = input.SnsTopicArn; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-lightsail/protocols/Aws_json1_1.ts b/clients/client-lightsail/protocols/Aws_json1_1.ts index 1b59b91890d7..8295f0981d29 100644 --- a/clients/client-lightsail/protocols/Aws_json1_1.ts +++ b/clients/client-lightsail/protocols/Aws_json1_1.ts @@ -15831,19 +15831,15 @@ const serializeAws_json1_1AddOnRequest = ( input: AddOnRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOnType !== undefined) { - bodyParams["addOnType"] = input.addOnType; - } - if (input.autoSnapshotAddOnRequest !== undefined) { - bodyParams[ - "autoSnapshotAddOnRequest" - ] = serializeAws_json1_1AutoSnapshotAddOnRequest( - input.autoSnapshotAddOnRequest, - context - ); - } - return bodyParams; + return { + ...(input.addOnType !== undefined && { addOnType: input.addOnType }), + ...(input.autoSnapshotAddOnRequest !== undefined && { + autoSnapshotAddOnRequest: serializeAws_json1_1AutoSnapshotAddOnRequest( + input.autoSnapshotAddOnRequest, + context + ) + }) + }; }; const serializeAws_json1_1AddOnRequestList = ( @@ -15857,73 +15853,69 @@ const serializeAws_json1_1AllocateStaticIpRequest = ( input: AllocateStaticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.staticIpName !== undefined) { - bodyParams["staticIpName"] = input.staticIpName; - } - return bodyParams; + return { + ...(input.staticIpName !== undefined && { + staticIpName: input.staticIpName + }) + }; }; const serializeAws_json1_1AttachDiskRequest = ( input: AttachDiskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - if (input.diskPath !== undefined) { - bodyParams["diskPath"] = input.diskPath; - } - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.diskName !== undefined && { diskName: input.diskName }), + ...(input.diskPath !== undefined && { diskPath: input.diskPath }), + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1AttachInstancesToLoadBalancerRequest = ( input: AttachInstancesToLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1ResourceNameList( - input.instanceNames, - context - ); - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.instanceNames !== undefined && { + instanceNames: serializeAws_json1_1ResourceNameList( + input.instanceNames, + context + ) + }), + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1AttachLoadBalancerTlsCertificateRequest = ( input: AttachLoadBalancerTlsCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateName !== undefined) { - bodyParams["certificateName"] = input.certificateName; - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.certificateName !== undefined && { + certificateName: input.certificateName + }), + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1AttachStaticIpRequest = ( input: AttachStaticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.staticIpName !== undefined) { - bodyParams["staticIpName"] = input.staticIpName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }), + ...(input.staticIpName !== undefined && { + staticIpName: input.staticIpName + }) + }; }; const serializeAws_json1_1AttachedDiskMap = ( @@ -15940,709 +15932,619 @@ const serializeAws_json1_1AutoSnapshotAddOnRequest = ( input: AutoSnapshotAddOnRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.snapshotTimeOfDay !== undefined) { - bodyParams["snapshotTimeOfDay"] = input.snapshotTimeOfDay; - } - return bodyParams; + return { + ...(input.snapshotTimeOfDay !== undefined && { + snapshotTimeOfDay: input.snapshotTimeOfDay + }) + }; }; const serializeAws_json1_1CloseInstancePublicPortsRequest = ( input: CloseInstancePublicPortsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.portInfo !== undefined) { - bodyParams["portInfo"] = serializeAws_json1_1PortInfo( - input.portInfo, - context - ); - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }), + ...(input.portInfo !== undefined && { + portInfo: serializeAws_json1_1PortInfo(input.portInfo, context) + }) + }; }; const serializeAws_json1_1CopySnapshotRequest = ( input: CopySnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.restoreDate !== undefined) { - bodyParams["restoreDate"] = input.restoreDate; - } - if (input.sourceRegion !== undefined) { - bodyParams["sourceRegion"] = input.sourceRegion; - } - if (input.sourceResourceName !== undefined) { - bodyParams["sourceResourceName"] = input.sourceResourceName; - } - if (input.sourceSnapshotName !== undefined) { - bodyParams["sourceSnapshotName"] = input.sourceSnapshotName; - } - if (input.targetSnapshotName !== undefined) { - bodyParams["targetSnapshotName"] = input.targetSnapshotName; - } - if (input.useLatestRestorableAutoSnapshot !== undefined) { - bodyParams["useLatestRestorableAutoSnapshot"] = - input.useLatestRestorableAutoSnapshot; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateCloudFormationStackRequest = ( input: CreateCloudFormationStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instances !== undefined) { - bodyParams["instances"] = serializeAws_json1_1InstanceEntryList( - input.instances, - context - ); - } - return bodyParams; + return { + ...(input.instances !== undefined && { + instances: serializeAws_json1_1InstanceEntryList(input.instances, context) + }) + }; }; const serializeAws_json1_1CreateDiskFromSnapshotRequest = ( input: CreateDiskFromSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOns !== undefined) { - bodyParams["addOns"] = serializeAws_json1_1AddOnRequestList( - input.addOns, - context - ); - } - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - if (input.diskSnapshotName !== undefined) { - bodyParams["diskSnapshotName"] = input.diskSnapshotName; - } - if (input.restoreDate !== undefined) { - bodyParams["restoreDate"] = input.restoreDate; - } - if (input.sizeInGb !== undefined) { - bodyParams["sizeInGb"] = input.sizeInGb; - } - if (input.sourceDiskName !== undefined) { - bodyParams["sourceDiskName"] = input.sourceDiskName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.useLatestRestorableAutoSnapshot !== undefined) { - bodyParams["useLatestRestorableAutoSnapshot"] = - input.useLatestRestorableAutoSnapshot; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateDiskRequest = ( input: CreateDiskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOns !== undefined) { - bodyParams["addOns"] = serializeAws_json1_1AddOnRequestList( - input.addOns, - context - ); - } - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - if (input.sizeInGb !== undefined) { - bodyParams["sizeInGb"] = input.sizeInGb; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateDiskSnapshotRequest = ( input: CreateDiskSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - if (input.diskSnapshotName !== undefined) { - bodyParams["diskSnapshotName"] = input.diskSnapshotName; - } - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateDomainEntryRequest = ( input: CreateDomainEntryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainEntry !== undefined) { - bodyParams["domainEntry"] = serializeAws_json1_1DomainEntry( - input.domainEntry, - context - ); - } - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainEntry !== undefined && { + domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context) + }), + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1CreateDomainRequest = ( input: CreateDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.domainName !== undefined && { domainName: input.domainName }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1CreateInstanceSnapshotRequest = ( input: CreateInstanceSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.instanceSnapshotName !== undefined) { - bodyParams["instanceSnapshotName"] = input.instanceSnapshotName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }), + ...(input.instanceSnapshotName !== undefined && { + instanceSnapshotName: input.instanceSnapshotName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1CreateInstancesFromSnapshotRequest = ( input: CreateInstancesFromSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOns !== undefined) { - bodyParams["addOns"] = serializeAws_json1_1AddOnRequestList( - input.addOns, - context - ); - } - if (input.attachedDiskMapping !== undefined) { - bodyParams["attachedDiskMapping"] = serializeAws_json1_1AttachedDiskMap( - input.attachedDiskMapping, - context - ); - } - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.bundleId !== undefined) { - bodyParams["bundleId"] = input.bundleId; - } - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1StringList( - input.instanceNames, - context - ); - } - if (input.instanceSnapshotName !== undefined) { - bodyParams["instanceSnapshotName"] = input.instanceSnapshotName; - } - if (input.keyPairName !== undefined) { - bodyParams["keyPairName"] = input.keyPairName; - } - if (input.restoreDate !== undefined) { - bodyParams["restoreDate"] = input.restoreDate; - } - if (input.sourceInstanceName !== undefined) { - bodyParams["sourceInstanceName"] = input.sourceInstanceName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.useLatestRestorableAutoSnapshot !== undefined) { - bodyParams["useLatestRestorableAutoSnapshot"] = - input.useLatestRestorableAutoSnapshot; - } - if (input.userData !== undefined) { - bodyParams["userData"] = input.userData; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateInstancesRequest = ( input: CreateInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOns !== undefined) { - bodyParams["addOns"] = serializeAws_json1_1AddOnRequestList( - input.addOns, - context - ); - } - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.blueprintId !== undefined) { - bodyParams["blueprintId"] = input.blueprintId; - } - if (input.bundleId !== undefined) { - bodyParams["bundleId"] = input.bundleId; - } - if (input.customImageName !== undefined) { - bodyParams["customImageName"] = input.customImageName; - } - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1StringList( - input.instanceNames, - context - ); - } - if (input.keyPairName !== undefined) { - bodyParams["keyPairName"] = input.keyPairName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.userData !== undefined) { - bodyParams["userData"] = input.userData; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateKeyPairRequest = ( input: CreateKeyPairRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.keyPairName !== undefined) { - bodyParams["keyPairName"] = input.keyPairName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1CreateLoadBalancerRequest = ( input: CreateLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateAlternativeNames !== undefined) { - bodyParams[ - "certificateAlternativeNames" - ] = serializeAws_json1_1DomainNameList( - input.certificateAlternativeNames, - context - ); - } - if (input.certificateDomainName !== undefined) { - bodyParams["certificateDomainName"] = input.certificateDomainName; - } - if (input.certificateName !== undefined) { - bodyParams["certificateName"] = input.certificateName; - } - if (input.healthCheckPath !== undefined) { - bodyParams["healthCheckPath"] = input.healthCheckPath; - } - if (input.instancePort !== undefined) { - bodyParams["instancePort"] = input.instancePort; - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateLoadBalancerTlsCertificateRequest = ( input: CreateLoadBalancerTlsCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateAlternativeNames !== undefined) { - bodyParams[ - "certificateAlternativeNames" - ] = serializeAws_json1_1DomainNameList( - input.certificateAlternativeNames, - context - ); - } - if (input.certificateDomainName !== undefined) { - bodyParams["certificateDomainName"] = input.certificateDomainName; - } - if (input.certificateName !== undefined) { - bodyParams["certificateName"] = input.certificateName; - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRelationalDatabaseFromSnapshotRequest = ( input: CreateRelationalDatabaseFromSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.publiclyAccessible !== undefined) { - bodyParams["publiclyAccessible"] = input.publiclyAccessible; - } - if (input.relationalDatabaseBundleId !== undefined) { - bodyParams["relationalDatabaseBundleId"] = input.relationalDatabaseBundleId; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.relationalDatabaseSnapshotName !== undefined) { - bodyParams["relationalDatabaseSnapshotName"] = - input.relationalDatabaseSnapshotName; - } - if (input.restoreTime !== undefined) { - bodyParams["restoreTime"] = Math.round(input.restoreTime.getTime() / 1000); - } - if (input.sourceRelationalDatabaseName !== undefined) { - bodyParams["sourceRelationalDatabaseName"] = - input.sourceRelationalDatabaseName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - if (input.useLatestRestorableTime !== undefined) { - bodyParams["useLatestRestorableTime"] = input.useLatestRestorableTime; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateRelationalDatabaseRequest = ( input: CreateRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.masterDatabaseName !== undefined) { - bodyParams["masterDatabaseName"] = input.masterDatabaseName; - } - if (input.masterUserPassword !== undefined) { - bodyParams["masterUserPassword"] = input.masterUserPassword; - } - if (input.masterUsername !== undefined) { - bodyParams["masterUsername"] = input.masterUsername; - } - if (input.preferredBackupWindow !== undefined) { - bodyParams["preferredBackupWindow"] = input.preferredBackupWindow; - } - if (input.preferredMaintenanceWindow !== undefined) { - bodyParams["preferredMaintenanceWindow"] = input.preferredMaintenanceWindow; - } - if (input.publiclyAccessible !== undefined) { - bodyParams["publiclyAccessible"] = input.publiclyAccessible; - } - if (input.relationalDatabaseBlueprintId !== undefined) { - bodyParams["relationalDatabaseBlueprintId"] = - input.relationalDatabaseBlueprintId; - } - if (input.relationalDatabaseBundleId !== undefined) { - bodyParams["relationalDatabaseBundleId"] = input.relationalDatabaseBundleId; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRelationalDatabaseSnapshotRequest = ( input: CreateRelationalDatabaseSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.relationalDatabaseSnapshotName !== undefined) { - bodyParams["relationalDatabaseSnapshotName"] = - input.relationalDatabaseSnapshotName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }), + ...(input.relationalDatabaseSnapshotName !== undefined && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1DeleteAutoSnapshotRequest = ( input: DeleteAutoSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.date !== undefined) { - bodyParams["date"] = input.date; - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - return bodyParams; + return { + ...(input.date !== undefined && { date: input.date }), + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }) + }; }; const serializeAws_json1_1DeleteDiskRequest = ( input: DeleteDiskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - if (input.forceDeleteAddOns !== undefined) { - bodyParams["forceDeleteAddOns"] = input.forceDeleteAddOns; - } - return bodyParams; + return { + ...(input.diskName !== undefined && { diskName: input.diskName }), + ...(input.forceDeleteAddOns !== undefined && { + forceDeleteAddOns: input.forceDeleteAddOns + }) + }; }; const serializeAws_json1_1DeleteDiskSnapshotRequest = ( input: DeleteDiskSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskSnapshotName !== undefined) { - bodyParams["diskSnapshotName"] = input.diskSnapshotName; - } - return bodyParams; + return { + ...(input.diskSnapshotName !== undefined && { + diskSnapshotName: input.diskSnapshotName + }) + }; }; const serializeAws_json1_1DeleteDomainEntryRequest = ( input: DeleteDomainEntryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainEntry !== undefined) { - bodyParams["domainEntry"] = serializeAws_json1_1DomainEntry( - input.domainEntry, - context - ); - } - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainEntry !== undefined && { + domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context) + }), + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1DeleteDomainRequest = ( input: DeleteDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1DeleteInstanceRequest = ( input: DeleteInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.forceDeleteAddOns !== undefined) { - bodyParams["forceDeleteAddOns"] = input.forceDeleteAddOns; - } - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.forceDeleteAddOns !== undefined && { + forceDeleteAddOns: input.forceDeleteAddOns + }), + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1DeleteInstanceSnapshotRequest = ( input: DeleteInstanceSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceSnapshotName !== undefined) { - bodyParams["instanceSnapshotName"] = input.instanceSnapshotName; - } - return bodyParams; + return { + ...(input.instanceSnapshotName !== undefined && { + instanceSnapshotName: input.instanceSnapshotName + }) + }; }; const serializeAws_json1_1DeleteKeyPairRequest = ( input: DeleteKeyPairRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.keyPairName !== undefined) { - bodyParams["keyPairName"] = input.keyPairName; - } - return bodyParams; + return { + ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }) + }; }; const serializeAws_json1_1DeleteKnownHostKeysRequest = ( input: DeleteKnownHostKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1DeleteLoadBalancerRequest = ( input: DeleteLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1DeleteLoadBalancerTlsCertificateRequest = ( input: DeleteLoadBalancerTlsCertificateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateName !== undefined) { - bodyParams["certificateName"] = input.certificateName; - } - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.certificateName !== undefined && { + certificateName: input.certificateName + }), + ...(input.force !== undefined && { force: input.force }), + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1DeleteRelationalDatabaseRequest = ( input: DeleteRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.finalRelationalDatabaseSnapshotName !== undefined) { - bodyParams["finalRelationalDatabaseSnapshotName"] = - input.finalRelationalDatabaseSnapshotName; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.skipFinalSnapshot !== undefined) { - bodyParams["skipFinalSnapshot"] = input.skipFinalSnapshot; - } - return bodyParams; + return { + ...(input.finalRelationalDatabaseSnapshotName !== undefined && { + finalRelationalDatabaseSnapshotName: + input.finalRelationalDatabaseSnapshotName + }), + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }), + ...(input.skipFinalSnapshot !== undefined && { + skipFinalSnapshot: input.skipFinalSnapshot + }) + }; }; const serializeAws_json1_1DeleteRelationalDatabaseSnapshotRequest = ( input: DeleteRelationalDatabaseSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseSnapshotName !== undefined) { - bodyParams["relationalDatabaseSnapshotName"] = - input.relationalDatabaseSnapshotName; - } - return bodyParams; + return { + ...(input.relationalDatabaseSnapshotName !== undefined && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName + }) + }; }; const serializeAws_json1_1DetachDiskRequest = ( input: DetachDiskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - return bodyParams; + return { + ...(input.diskName !== undefined && { diskName: input.diskName }) + }; }; const serializeAws_json1_1DetachInstancesFromLoadBalancerRequest = ( input: DetachInstancesFromLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceNames !== undefined) { - bodyParams["instanceNames"] = serializeAws_json1_1ResourceNameList( - input.instanceNames, - context - ); - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.instanceNames !== undefined && { + instanceNames: serializeAws_json1_1ResourceNameList( + input.instanceNames, + context + ) + }), + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1DetachStaticIpRequest = ( input: DetachStaticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.staticIpName !== undefined) { - bodyParams["staticIpName"] = input.staticIpName; - } - return bodyParams; + return { + ...(input.staticIpName !== undefined && { + staticIpName: input.staticIpName + }) + }; }; const serializeAws_json1_1DisableAddOnRequest = ( input: DisableAddOnRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOnType !== undefined) { - bodyParams["addOnType"] = input.addOnType; - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - return bodyParams; + return { + ...(input.addOnType !== undefined && { addOnType: input.addOnType }), + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }) + }; }; const serializeAws_json1_1DiskMap = ( input: DiskMap, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.newDiskName !== undefined) { - bodyParams["newDiskName"] = input.newDiskName; - } - if (input.originalDiskPath !== undefined) { - bodyParams["originalDiskPath"] = input.originalDiskPath; - } - return bodyParams; + return { + ...(input.newDiskName !== undefined && { newDiskName: input.newDiskName }), + ...(input.originalDiskPath !== undefined && { + originalDiskPath: input.originalDiskPath + }) + }; }; const serializeAws_json1_1DiskMapList = ( @@ -16656,29 +16558,16 @@ const serializeAws_json1_1DomainEntry = ( input: DomainEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.isAlias !== undefined) { - bodyParams["isAlias"] = input.isAlias; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.options !== undefined) { - bodyParams["options"] = serializeAws_json1_1DomainEntryOptions( - input.options, - context - ); - } - if (input.target !== undefined) { - bodyParams["target"] = input.target; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DomainEntryOptions = ( @@ -16702,664 +16591,584 @@ const serializeAws_json1_1DownloadDefaultKeyPairRequest = ( input: DownloadDefaultKeyPairRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1EnableAddOnRequest = ( input: EnableAddOnRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.addOnRequest !== undefined) { - bodyParams["addOnRequest"] = serializeAws_json1_1AddOnRequest( - input.addOnRequest, - context - ); - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - return bodyParams; + return { + ...(input.addOnRequest !== undefined && { + addOnRequest: serializeAws_json1_1AddOnRequest( + input.addOnRequest, + context + ) + }), + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }) + }; }; const serializeAws_json1_1ExportSnapshotRequest = ( input: ExportSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.sourceSnapshotName !== undefined) { - bodyParams["sourceSnapshotName"] = input.sourceSnapshotName; - } - return bodyParams; + return { + ...(input.sourceSnapshotName !== undefined && { + sourceSnapshotName: input.sourceSnapshotName + }) + }; }; const serializeAws_json1_1GetActiveNamesRequest = ( input: GetActiveNamesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetAutoSnapshotsRequest = ( input: GetAutoSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - return bodyParams; + return { + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }) + }; }; const serializeAws_json1_1GetBlueprintsRequest = ( input: GetBlueprintsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.includeInactive !== undefined) { - bodyParams["includeInactive"] = input.includeInactive; - } - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.includeInactive !== undefined && { + includeInactive: input.includeInactive + }), + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetBundlesRequest = ( input: GetBundlesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.includeInactive !== undefined) { - bodyParams["includeInactive"] = input.includeInactive; - } - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.includeInactive !== undefined && { + includeInactive: input.includeInactive + }), + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetCloudFormationStackRecordsRequest = ( input: GetCloudFormationStackRecordsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetDiskRequest = ( input: GetDiskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskName !== undefined) { - bodyParams["diskName"] = input.diskName; - } - return bodyParams; + return { + ...(input.diskName !== undefined && { diskName: input.diskName }) + }; }; const serializeAws_json1_1GetDiskSnapshotRequest = ( input: GetDiskSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.diskSnapshotName !== undefined) { - bodyParams["diskSnapshotName"] = input.diskSnapshotName; - } - return bodyParams; + return { + ...(input.diskSnapshotName !== undefined && { + diskSnapshotName: input.diskSnapshotName + }) + }; }; const serializeAws_json1_1GetDiskSnapshotsRequest = ( input: GetDiskSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetDisksRequest = ( input: GetDisksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetDomainRequest = ( input: GetDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1GetDomainsRequest = ( input: GetDomainsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetExportSnapshotRecordsRequest = ( input: GetExportSnapshotRecordsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetInstanceAccessDetailsRequest = ( input: GetInstanceAccessDetailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.protocol !== undefined) { - bodyParams["protocol"] = input.protocol; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }), + ...(input.protocol !== undefined && { protocol: input.protocol }) + }; }; const serializeAws_json1_1GetInstanceMetricDataRequest = ( input: GetInstanceMetricDataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.period !== undefined) { - bodyParams["period"] = input.period; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - if (input.statistics !== undefined) { - bodyParams["statistics"] = serializeAws_json1_1MetricStatisticList( - input.statistics, - context - ); - } - if (input.unit !== undefined) { - bodyParams["unit"] = input.unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetInstancePortStatesRequest = ( input: GetInstancePortStatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1GetInstanceRequest = ( input: GetInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1GetInstanceSnapshotRequest = ( input: GetInstanceSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceSnapshotName !== undefined) { - bodyParams["instanceSnapshotName"] = input.instanceSnapshotName; - } - return bodyParams; + return { + ...(input.instanceSnapshotName !== undefined && { + instanceSnapshotName: input.instanceSnapshotName + }) + }; }; const serializeAws_json1_1GetInstanceSnapshotsRequest = ( input: GetInstanceSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetInstanceStateRequest = ( input: GetInstanceStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1GetInstancesRequest = ( input: GetInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetKeyPairRequest = ( input: GetKeyPairRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.keyPairName !== undefined) { - bodyParams["keyPairName"] = input.keyPairName; - } - return bodyParams; + return { + ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }) + }; }; const serializeAws_json1_1GetKeyPairsRequest = ( input: GetKeyPairsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetLoadBalancerMetricDataRequest = ( input: GetLoadBalancerMetricDataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.period !== undefined) { - bodyParams["period"] = input.period; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - if (input.statistics !== undefined) { - bodyParams["statistics"] = serializeAws_json1_1MetricStatisticList( - input.statistics, - context - ); - } - if (input.unit !== undefined) { - bodyParams["unit"] = input.unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetLoadBalancerRequest = ( input: GetLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1GetLoadBalancerTlsCertificatesRequest = ( input: GetLoadBalancerTlsCertificatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1GetLoadBalancersRequest = ( input: GetLoadBalancersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetOperationRequest = ( input: GetOperationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.operationId !== undefined) { - bodyParams["operationId"] = input.operationId; - } - return bodyParams; + return { + ...(input.operationId !== undefined && { operationId: input.operationId }) + }; }; const serializeAws_json1_1GetOperationsForResourceRequest = ( input: GetOperationsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }) + }; }; const serializeAws_json1_1GetOperationsRequest = ( input: GetOperationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetRegionsRequest = ( input: GetRegionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.includeAvailabilityZones !== undefined) { - bodyParams["includeAvailabilityZones"] = input.includeAvailabilityZones; - } - if (input.includeRelationalDatabaseAvailabilityZones !== undefined) { - bodyParams["includeRelationalDatabaseAvailabilityZones"] = - input.includeRelationalDatabaseAvailabilityZones; - } - return bodyParams; + return { + ...(input.includeAvailabilityZones !== undefined && { + includeAvailabilityZones: input.includeAvailabilityZones + }), + ...(input.includeRelationalDatabaseAvailabilityZones !== undefined && { + includeRelationalDatabaseAvailabilityZones: + input.includeRelationalDatabaseAvailabilityZones + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseBlueprintsRequest = ( input: GetRelationalDatabaseBlueprintsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetRelationalDatabaseBundlesRequest = ( input: GetRelationalDatabaseBundlesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetRelationalDatabaseEventsRequest = ( input: GetRelationalDatabaseEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.durationInMinutes !== undefined) { - bodyParams["durationInMinutes"] = input.durationInMinutes; - } - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.durationInMinutes !== undefined && { + durationInMinutes: input.durationInMinutes + }), + ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseLogEventsRequest = ( input: GetRelationalDatabaseLogEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.logStreamName !== undefined) { - bodyParams["logStreamName"] = input.logStreamName; - } - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.startFromHead !== undefined) { - bodyParams["startFromHead"] = input.startFromHead; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseLogStreamsRequest = ( input: GetRelationalDatabaseLogStreamsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseMasterUserPasswordRequest = ( input: GetRelationalDatabaseMasterUserPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.passwordVersion !== undefined) { - bodyParams["passwordVersion"] = input.passwordVersion; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.passwordVersion !== undefined && { + passwordVersion: input.passwordVersion + }), + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseMetricDataRequest = ( input: GetRelationalDatabaseMetricDataRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.endTime !== undefined) { - bodyParams["endTime"] = Math.round(input.endTime.getTime() / 1000); - } - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.period !== undefined) { - bodyParams["period"] = input.period; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.startTime !== undefined) { - bodyParams["startTime"] = Math.round(input.startTime.getTime() / 1000); - } - if (input.statistics !== undefined) { - bodyParams["statistics"] = serializeAws_json1_1MetricStatisticList( - input.statistics, - context - ); - } - if (input.unit !== undefined) { - bodyParams["unit"] = input.unit; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetRelationalDatabaseParametersRequest = ( input: GetRelationalDatabaseParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }), + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseRequest = ( input: GetRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseSnapshotRequest = ( input: GetRelationalDatabaseSnapshotRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseSnapshotName !== undefined) { - bodyParams["relationalDatabaseSnapshotName"] = - input.relationalDatabaseSnapshotName; - } - return bodyParams; + return { + ...(input.relationalDatabaseSnapshotName !== undefined && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName + }) + }; }; const serializeAws_json1_1GetRelationalDatabaseSnapshotsRequest = ( input: GetRelationalDatabaseSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetRelationalDatabasesRequest = ( input: GetRelationalDatabasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1GetStaticIpRequest = ( input: GetStaticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.staticIpName !== undefined) { - bodyParams["staticIpName"] = input.staticIpName; - } - return bodyParams; + return { + ...(input.staticIpName !== undefined && { + staticIpName: input.staticIpName + }) + }; }; const serializeAws_json1_1GetStaticIpsRequest = ( input: GetStaticIpsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.pageToken !== undefined) { - bodyParams["pageToken"] = input.pageToken; - } - return bodyParams; + return { + ...(input.pageToken !== undefined && { pageToken: input.pageToken }) + }; }; const serializeAws_json1_1ImportKeyPairRequest = ( input: ImportKeyPairRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.keyPairName !== undefined) { - bodyParams["keyPairName"] = input.keyPairName; - } - if (input.publicKeyBase64 !== undefined) { - bodyParams["publicKeyBase64"] = input.publicKeyBase64; - } - return bodyParams; + return { + ...(input.keyPairName !== undefined && { keyPairName: input.keyPairName }), + ...(input.publicKeyBase64 !== undefined && { + publicKeyBase64: input.publicKeyBase64 + }) + }; }; const serializeAws_json1_1InstanceEntry = ( input: InstanceEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.availabilityZone !== undefined) { - bodyParams["availabilityZone"] = input.availabilityZone; - } - if (input.instanceType !== undefined) { - bodyParams["instanceType"] = input.instanceType; - } - if (input.portInfoSource !== undefined) { - bodyParams["portInfoSource"] = input.portInfoSource; - } - if (input.sourceName !== undefined) { - bodyParams["sourceName"] = input.sourceName; - } - if (input.userData !== undefined) { - bodyParams["userData"] = input.userData; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1InstanceEntryList = ( @@ -17373,8 +17182,7 @@ const serializeAws_json1_1IsVpcPeeredRequest = ( input: IsVpcPeeredRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1MetricStatisticList = ( @@ -17388,42 +17196,32 @@ const serializeAws_json1_1OpenInstancePublicPortsRequest = ( input: OpenInstancePublicPortsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.portInfo !== undefined) { - bodyParams["portInfo"] = serializeAws_json1_1PortInfo( - input.portInfo, - context - ); - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }), + ...(input.portInfo !== undefined && { + portInfo: serializeAws_json1_1PortInfo(input.portInfo, context) + }) + }; }; const serializeAws_json1_1PeerVpcRequest = ( input: PeerVpcRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1PortInfo = ( input: PortInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.fromPort !== undefined) { - bodyParams["fromPort"] = input.fromPort; - } - if (input.protocol !== undefined) { - bodyParams["protocol"] = input.protocol; - } - if (input.toPort !== undefined) { - bodyParams["toPort"] = input.toPort; - } - return bodyParams; + return { + ...(input.fromPort !== undefined && { fromPort: input.fromPort }), + ...(input.protocol !== undefined && { protocol: input.protocol }), + ...(input.toPort !== undefined && { toPort: input.toPort }) + }; }; const serializeAws_json1_1PortInfoList = ( @@ -17437,71 +17235,60 @@ const serializeAws_json1_1PutInstancePublicPortsRequest = ( input: PutInstancePublicPortsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - if (input.portInfos !== undefined) { - bodyParams["portInfos"] = serializeAws_json1_1PortInfoList( - input.portInfos, - context - ); - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }), + ...(input.portInfos !== undefined && { + portInfos: serializeAws_json1_1PortInfoList(input.portInfos, context) + }) + }; }; const serializeAws_json1_1RebootInstanceRequest = ( input: RebootInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1RebootRelationalDatabaseRequest = ( input: RebootRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1RelationalDatabaseParameter = ( input: RelationalDatabaseParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.allowedValues !== undefined) { - bodyParams["allowedValues"] = input.allowedValues; - } - if (input.applyMethod !== undefined) { - bodyParams["applyMethod"] = input.applyMethod; - } - if (input.applyType !== undefined) { - bodyParams["applyType"] = input.applyType; - } - if (input.dataType !== undefined) { - bodyParams["dataType"] = input.dataType; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.isModifiable !== undefined) { - bodyParams["isModifiable"] = input.isModifiable; - } - if (input.parameterName !== undefined) { - bodyParams["parameterName"] = input.parameterName; - } - if (input.parameterValue !== undefined) { - bodyParams["parameterValue"] = input.parameterValue; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1RelationalDatabaseParameterList = ( @@ -17517,11 +17304,11 @@ const serializeAws_json1_1ReleaseStaticIpRequest = ( input: ReleaseStaticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.staticIpName !== undefined) { - bodyParams["staticIpName"] = input.staticIpName; - } - return bodyParams; + return { + ...(input.staticIpName !== undefined && { + staticIpName: input.staticIpName + }) + }; }; const serializeAws_json1_1ResourceNameList = ( @@ -17535,51 +17322,48 @@ const serializeAws_json1_1StartInstanceRequest = ( input: StartInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1StartRelationalDatabaseRequest = ( input: StartRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1StopInstanceRequest = ( input: StopInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.force !== undefined) { - bodyParams["force"] = input.force; - } - if (input.instanceName !== undefined) { - bodyParams["instanceName"] = input.instanceName; - } - return bodyParams; + return { + ...(input.force !== undefined && { force: input.force }), + ...(input.instanceName !== undefined && { + instanceName: input.instanceName + }) + }; }; const serializeAws_json1_1StopRelationalDatabaseRequest = ( input: StopRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.relationalDatabaseSnapshotName !== undefined) { - bodyParams["relationalDatabaseSnapshotName"] = - input.relationalDatabaseSnapshotName; - } - return bodyParams; + return { + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }), + ...(input.relationalDatabaseSnapshotName !== undefined && { + relationalDatabaseSnapshotName: input.relationalDatabaseSnapshotName + }) + }; }; const serializeAws_json1_1StringList = ( @@ -17590,14 +17374,10 @@ const serializeAws_json1_1StringList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -17618,136 +17398,121 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_1TagList(input.tags, context) + }) + }; }; const serializeAws_json1_1UnpeerVpcRequest = ( input: UnpeerVpcRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.resourceName !== undefined) { - bodyParams["resourceName"] = input.resourceName; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_1TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.resourceName !== undefined && { + resourceName: input.resourceName + }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_1TagKeyList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateDomainEntryRequest = ( input: UpdateDomainEntryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainEntry !== undefined) { - bodyParams["domainEntry"] = serializeAws_json1_1DomainEntry( - input.domainEntry, - context - ); - } - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainEntry !== undefined && { + domainEntry: serializeAws_json1_1DomainEntry(input.domainEntry, context) + }), + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1UpdateLoadBalancerAttributeRequest = ( input: UpdateLoadBalancerAttributeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attributeName !== undefined) { - bodyParams["attributeName"] = input.attributeName; - } - if (input.attributeValue !== undefined) { - bodyParams["attributeValue"] = input.attributeValue; - } - if (input.loadBalancerName !== undefined) { - bodyParams["loadBalancerName"] = input.loadBalancerName; - } - return bodyParams; + return { + ...(input.attributeName !== undefined && { + attributeName: input.attributeName + }), + ...(input.attributeValue !== undefined && { + attributeValue: input.attributeValue + }), + ...(input.loadBalancerName !== undefined && { + loadBalancerName: input.loadBalancerName + }) + }; }; const serializeAws_json1_1UpdateRelationalDatabaseParametersRequest = ( input: UpdateRelationalDatabaseParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.parameters !== undefined) { - bodyParams[ - "parameters" - ] = serializeAws_json1_1RelationalDatabaseParameterList( - input.parameters, - context - ); - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - return bodyParams; + return { + ...(input.parameters !== undefined && { + parameters: serializeAws_json1_1RelationalDatabaseParameterList( + input.parameters, + context + ) + }), + ...(input.relationalDatabaseName !== undefined && { + relationalDatabaseName: input.relationalDatabaseName + }) + }; }; const serializeAws_json1_1UpdateRelationalDatabaseRequest = ( input: UpdateRelationalDatabaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applyImmediately !== undefined) { - bodyParams["applyImmediately"] = input.applyImmediately; - } - if (input.caCertificateIdentifier !== undefined) { - bodyParams["caCertificateIdentifier"] = input.caCertificateIdentifier; - } - if (input.disableBackupRetention !== undefined) { - bodyParams["disableBackupRetention"] = input.disableBackupRetention; - } - if (input.enableBackupRetention !== undefined) { - bodyParams["enableBackupRetention"] = input.enableBackupRetention; - } - if (input.masterUserPassword !== undefined) { - bodyParams["masterUserPassword"] = input.masterUserPassword; - } - if (input.preferredBackupWindow !== undefined) { - bodyParams["preferredBackupWindow"] = input.preferredBackupWindow; - } - if (input.preferredMaintenanceWindow !== undefined) { - bodyParams["preferredMaintenanceWindow"] = input.preferredMaintenanceWindow; - } - if (input.publiclyAccessible !== undefined) { - bodyParams["publiclyAccessible"] = input.publiclyAccessible; - } - if (input.relationalDatabaseName !== undefined) { - bodyParams["relationalDatabaseName"] = input.relationalDatabaseName; - } - if (input.rotateMasterUserPassword !== undefined) { - bodyParams["rotateMasterUserPassword"] = input.rotateMasterUserPassword; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-machine-learning/protocols/Aws_json1_1.ts b/clients/client-machine-learning/protocols/Aws_json1_1.ts index b930953d8374..43884062044c 100644 --- a/clients/client-machine-learning/protocols/Aws_json1_1.ts +++ b/clients/client-machine-learning/protocols/Aws_json1_1.ts @@ -3103,432 +3103,307 @@ const serializeAws_json1_1AddTagsInput = ( input: AddTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateBatchPredictionInput = ( input: CreateBatchPredictionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchPredictionDataSourceId !== undefined) { - bodyParams["BatchPredictionDataSourceId"] = - input.BatchPredictionDataSourceId; - } - if (input.BatchPredictionId !== undefined) { - bodyParams["BatchPredictionId"] = input.BatchPredictionId; - } - if (input.BatchPredictionName !== undefined) { - bodyParams["BatchPredictionName"] = input.BatchPredictionName; - } - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - if (input.OutputUri !== undefined) { - bodyParams["OutputUri"] = input.OutputUri; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateDataSourceFromRDSInput = ( input: CreateDataSourceFromRDSInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComputeStatistics !== undefined) { - bodyParams["ComputeStatistics"] = input.ComputeStatistics; - } - if (input.DataSourceId !== undefined) { - bodyParams["DataSourceId"] = input.DataSourceId; - } - if (input.DataSourceName !== undefined) { - bodyParams["DataSourceName"] = input.DataSourceName; - } - if (input.RDSData !== undefined) { - bodyParams["RDSData"] = serializeAws_json1_1RDSDataSpec( - input.RDSData, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateDataSourceFromRedshiftInput = ( input: CreateDataSourceFromRedshiftInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComputeStatistics !== undefined) { - bodyParams["ComputeStatistics"] = input.ComputeStatistics; - } - if (input.DataSourceId !== undefined) { - bodyParams["DataSourceId"] = input.DataSourceId; - } - if (input.DataSourceName !== undefined) { - bodyParams["DataSourceName"] = input.DataSourceName; - } - if (input.DataSpec !== undefined) { - bodyParams["DataSpec"] = serializeAws_json1_1RedshiftDataSpec( - input.DataSpec, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateDataSourceFromS3Input = ( input: CreateDataSourceFromS3Input, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComputeStatistics !== undefined) { - bodyParams["ComputeStatistics"] = input.ComputeStatistics; - } - if (input.DataSourceId !== undefined) { - bodyParams["DataSourceId"] = input.DataSourceId; - } - if (input.DataSourceName !== undefined) { - bodyParams["DataSourceName"] = input.DataSourceName; - } - if (input.DataSpec !== undefined) { - bodyParams["DataSpec"] = serializeAws_json1_1S3DataSpec( - input.DataSpec, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateEvaluationInput = ( input: CreateEvaluationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EvaluationDataSourceId !== undefined) { - bodyParams["EvaluationDataSourceId"] = input.EvaluationDataSourceId; - } - if (input.EvaluationId !== undefined) { - bodyParams["EvaluationId"] = input.EvaluationId; - } - if (input.EvaluationName !== undefined) { - bodyParams["EvaluationName"] = input.EvaluationName; - } - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateMLModelInput = ( input: CreateMLModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - if (input.MLModelName !== undefined) { - bodyParams["MLModelName"] = input.MLModelName; - } - if (input.MLModelType !== undefined) { - bodyParams["MLModelType"] = input.MLModelType; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1TrainingParameters( - input.Parameters, - context - ); - } - if (input.Recipe !== undefined) { - bodyParams["Recipe"] = input.Recipe; - } - if (input.RecipeUri !== undefined) { - bodyParams["RecipeUri"] = input.RecipeUri; - } - if (input.TrainingDataSourceId !== undefined) { - bodyParams["TrainingDataSourceId"] = input.TrainingDataSourceId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateRealtimeEndpointInput = ( input: CreateRealtimeEndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - return bodyParams; + return { + ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }) + }; }; const serializeAws_json1_1DeleteBatchPredictionInput = ( input: DeleteBatchPredictionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchPredictionId !== undefined) { - bodyParams["BatchPredictionId"] = input.BatchPredictionId; - } - return bodyParams; + return { + ...(input.BatchPredictionId !== undefined && { + BatchPredictionId: input.BatchPredictionId + }) + }; }; const serializeAws_json1_1DeleteDataSourceInput = ( input: DeleteDataSourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSourceId !== undefined) { - bodyParams["DataSourceId"] = input.DataSourceId; - } - return bodyParams; + return { + ...(input.DataSourceId !== undefined && { + DataSourceId: input.DataSourceId + }) + }; }; const serializeAws_json1_1DeleteEvaluationInput = ( input: DeleteEvaluationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EvaluationId !== undefined) { - bodyParams["EvaluationId"] = input.EvaluationId; - } - return bodyParams; + return { + ...(input.EvaluationId !== undefined && { + EvaluationId: input.EvaluationId + }) + }; }; const serializeAws_json1_1DeleteMLModelInput = ( input: DeleteMLModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - return bodyParams; + return { + ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }) + }; }; const serializeAws_json1_1DeleteRealtimeEndpointInput = ( input: DeleteRealtimeEndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - return bodyParams; + return { + ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }) + }; }; const serializeAws_json1_1DeleteTagsInput = ( input: DeleteTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1DescribeBatchPredictionsInput = ( input: DescribeBatchPredictionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EQ !== undefined) { - bodyParams["EQ"] = input.EQ; - } - if (input.FilterVariable !== undefined) { - bodyParams["FilterVariable"] = input.FilterVariable; - } - if (input.GE !== undefined) { - bodyParams["GE"] = input.GE; - } - if (input.GT !== undefined) { - bodyParams["GT"] = input.GT; - } - if (input.LE !== undefined) { - bodyParams["LE"] = input.LE; - } - if (input.LT !== undefined) { - bodyParams["LT"] = input.LT; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NE !== undefined) { - bodyParams["NE"] = input.NE; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeDataSourcesInput = ( input: DescribeDataSourcesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EQ !== undefined) { - bodyParams["EQ"] = input.EQ; - } - if (input.FilterVariable !== undefined) { - bodyParams["FilterVariable"] = input.FilterVariable; - } - if (input.GE !== undefined) { - bodyParams["GE"] = input.GE; - } - if (input.GT !== undefined) { - bodyParams["GT"] = input.GT; - } - if (input.LE !== undefined) { - bodyParams["LE"] = input.LE; - } - if (input.LT !== undefined) { - bodyParams["LT"] = input.LT; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NE !== undefined) { - bodyParams["NE"] = input.NE; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEvaluationsInput = ( input: DescribeEvaluationsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EQ !== undefined) { - bodyParams["EQ"] = input.EQ; - } - if (input.FilterVariable !== undefined) { - bodyParams["FilterVariable"] = input.FilterVariable; - } - if (input.GE !== undefined) { - bodyParams["GE"] = input.GE; - } - if (input.GT !== undefined) { - bodyParams["GT"] = input.GT; - } - if (input.LE !== undefined) { - bodyParams["LE"] = input.LE; - } - if (input.LT !== undefined) { - bodyParams["LT"] = input.LT; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NE !== undefined) { - bodyParams["NE"] = input.NE; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMLModelsInput = ( input: DescribeMLModelsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EQ !== undefined) { - bodyParams["EQ"] = input.EQ; - } - if (input.FilterVariable !== undefined) { - bodyParams["FilterVariable"] = input.FilterVariable; - } - if (input.GE !== undefined) { - bodyParams["GE"] = input.GE; - } - if (input.GT !== undefined) { - bodyParams["GT"] = input.GT; - } - if (input.LE !== undefined) { - bodyParams["LE"] = input.LE; - } - if (input.LT !== undefined) { - bodyParams["LT"] = input.LT; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NE !== undefined) { - bodyParams["NE"] = input.NE; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeTagsInput = ( input: DescribeTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1EDPSecurityGroupIds = ( @@ -3542,147 +3417,127 @@ const serializeAws_json1_1GetBatchPredictionInput = ( input: GetBatchPredictionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchPredictionId !== undefined) { - bodyParams["BatchPredictionId"] = input.BatchPredictionId; - } - return bodyParams; + return { + ...(input.BatchPredictionId !== undefined && { + BatchPredictionId: input.BatchPredictionId + }) + }; }; const serializeAws_json1_1GetDataSourceInput = ( input: GetDataSourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSourceId !== undefined) { - bodyParams["DataSourceId"] = input.DataSourceId; - } - if (input.Verbose !== undefined) { - bodyParams["Verbose"] = input.Verbose; - } - return bodyParams; + return { + ...(input.DataSourceId !== undefined && { + DataSourceId: input.DataSourceId + }), + ...(input.Verbose !== undefined && { Verbose: input.Verbose }) + }; }; const serializeAws_json1_1GetEvaluationInput = ( input: GetEvaluationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EvaluationId !== undefined) { - bodyParams["EvaluationId"] = input.EvaluationId; - } - return bodyParams; + return { + ...(input.EvaluationId !== undefined && { + EvaluationId: input.EvaluationId + }) + }; }; const serializeAws_json1_1GetMLModelInput = ( input: GetMLModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - if (input.Verbose !== undefined) { - bodyParams["Verbose"] = input.Verbose; - } - return bodyParams; + return { + ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.Verbose !== undefined && { Verbose: input.Verbose }) + }; }; const serializeAws_json1_1PredictInput = ( input: PredictInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - if (input.PredictEndpoint !== undefined) { - bodyParams["PredictEndpoint"] = input.PredictEndpoint; - } - if (input.Record !== undefined) { - bodyParams["Record"] = serializeAws_json1_1Record(input.Record, context); - } - return bodyParams; + return { + ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.PredictEndpoint !== undefined && { + PredictEndpoint: input.PredictEndpoint + }), + ...(input.Record !== undefined && { + Record: serializeAws_json1_1Record(input.Record, context) + }) + }; }; const serializeAws_json1_1RDSDataSpec = ( input: RDSDataSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataRearrangement !== undefined) { - bodyParams["DataRearrangement"] = input.DataRearrangement; - } - if (input.DataSchema !== undefined) { - bodyParams["DataSchema"] = input.DataSchema; - } - if (input.DataSchemaUri !== undefined) { - bodyParams["DataSchemaUri"] = input.DataSchemaUri; - } - if (input.DatabaseCredentials !== undefined) { - bodyParams[ - "DatabaseCredentials" - ] = serializeAws_json1_1RDSDatabaseCredentials( - input.DatabaseCredentials, - context - ); - } - if (input.DatabaseInformation !== undefined) { - bodyParams["DatabaseInformation"] = serializeAws_json1_1RDSDatabase( - input.DatabaseInformation, - context - ); - } - if (input.ResourceRole !== undefined) { - bodyParams["ResourceRole"] = input.ResourceRole; - } - if (input.S3StagingLocation !== undefined) { - bodyParams["S3StagingLocation"] = input.S3StagingLocation; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1EDPSecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.SelectSqlQuery !== undefined) { - bodyParams["SelectSqlQuery"] = input.SelectSqlQuery; - } - if (input.ServiceRole !== undefined) { - bodyParams["ServiceRole"] = input.ServiceRole; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RDSDatabase = ( input: RDSDatabase, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.InstanceIdentifier !== undefined) { - bodyParams["InstanceIdentifier"] = input.InstanceIdentifier; - } - return bodyParams; + return { + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.InstanceIdentifier !== undefined && { + InstanceIdentifier: input.InstanceIdentifier + }) + }; }; const serializeAws_json1_1RDSDatabaseCredentials = ( input: RDSDatabaseCredentials, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1Record = ( @@ -3699,96 +3554,82 @@ const serializeAws_json1_1RedshiftDataSpec = ( input: RedshiftDataSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataRearrangement !== undefined) { - bodyParams["DataRearrangement"] = input.DataRearrangement; - } - if (input.DataSchema !== undefined) { - bodyParams["DataSchema"] = input.DataSchema; - } - if (input.DataSchemaUri !== undefined) { - bodyParams["DataSchemaUri"] = input.DataSchemaUri; - } - if (input.DatabaseCredentials !== undefined) { - bodyParams[ - "DatabaseCredentials" - ] = serializeAws_json1_1RedshiftDatabaseCredentials( - input.DatabaseCredentials, - context - ); - } - if (input.DatabaseInformation !== undefined) { - bodyParams["DatabaseInformation"] = serializeAws_json1_1RedshiftDatabase( - input.DatabaseInformation, - context - ); - } - if (input.S3StagingLocation !== undefined) { - bodyParams["S3StagingLocation"] = input.S3StagingLocation; - } - if (input.SelectSqlQuery !== undefined) { - bodyParams["SelectSqlQuery"] = input.SelectSqlQuery; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1RedshiftDatabase = ( input: RedshiftDatabase, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterIdentifier !== undefined) { - bodyParams["ClusterIdentifier"] = input.ClusterIdentifier; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - return bodyParams; + return { + ...(input.ClusterIdentifier !== undefined && { + ClusterIdentifier: input.ClusterIdentifier + }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }) + }; }; const serializeAws_json1_1RedshiftDatabaseCredentials = ( input: RedshiftDatabaseCredentials, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_json1_1S3DataSpec = ( input: S3DataSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataLocationS3 !== undefined) { - bodyParams["DataLocationS3"] = input.DataLocationS3; - } - if (input.DataRearrangement !== undefined) { - bodyParams["DataRearrangement"] = input.DataRearrangement; - } - if (input.DataSchema !== undefined) { - bodyParams["DataSchema"] = input.DataSchema; - } - if (input.DataSchemaLocationS3 !== undefined) { - bodyParams["DataSchemaLocationS3"] = input.DataSchemaLocationS3; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -3819,59 +3660,55 @@ const serializeAws_json1_1UpdateBatchPredictionInput = ( input: UpdateBatchPredictionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchPredictionId !== undefined) { - bodyParams["BatchPredictionId"] = input.BatchPredictionId; - } - if (input.BatchPredictionName !== undefined) { - bodyParams["BatchPredictionName"] = input.BatchPredictionName; - } - return bodyParams; + return { + ...(input.BatchPredictionId !== undefined && { + BatchPredictionId: input.BatchPredictionId + }), + ...(input.BatchPredictionName !== undefined && { + BatchPredictionName: input.BatchPredictionName + }) + }; }; const serializeAws_json1_1UpdateDataSourceInput = ( input: UpdateDataSourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSourceId !== undefined) { - bodyParams["DataSourceId"] = input.DataSourceId; - } - if (input.DataSourceName !== undefined) { - bodyParams["DataSourceName"] = input.DataSourceName; - } - return bodyParams; + return { + ...(input.DataSourceId !== undefined && { + DataSourceId: input.DataSourceId + }), + ...(input.DataSourceName !== undefined && { + DataSourceName: input.DataSourceName + }) + }; }; const serializeAws_json1_1UpdateEvaluationInput = ( input: UpdateEvaluationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EvaluationId !== undefined) { - bodyParams["EvaluationId"] = input.EvaluationId; - } - if (input.EvaluationName !== undefined) { - bodyParams["EvaluationName"] = input.EvaluationName; - } - return bodyParams; + return { + ...(input.EvaluationId !== undefined && { + EvaluationId: input.EvaluationId + }), + ...(input.EvaluationName !== undefined && { + EvaluationName: input.EvaluationName + }) + }; }; const serializeAws_json1_1UpdateMLModelInput = ( input: UpdateMLModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MLModelId !== undefined) { - bodyParams["MLModelId"] = input.MLModelId; - } - if (input.MLModelName !== undefined) { - bodyParams["MLModelName"] = input.MLModelName; - } - if (input.ScoreThreshold !== undefined) { - bodyParams["ScoreThreshold"] = input.ScoreThreshold; - } - return bodyParams; + return { + ...(input.MLModelId !== undefined && { MLModelId: input.MLModelId }), + ...(input.MLModelName !== undefined && { MLModelName: input.MLModelName }), + ...(input.ScoreThreshold !== undefined && { + ScoreThreshold: input.ScoreThreshold + }) + }; }; const deserializeAws_json1_1AddTagsOutput = ( diff --git a/clients/client-macie/protocols/Aws_json1_1.ts b/clients/client-macie/protocols/Aws_json1_1.ts index 38e89db71b3c..8ad26990b4bb 100644 --- a/clients/client-macie/protocols/Aws_json1_1.ts +++ b/clients/client-macie/protocols/Aws_json1_1.ts @@ -815,171 +815,141 @@ const serializeAws_json1_1AssociateMemberAccountRequest = ( input: AssociateMemberAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.memberAccountId !== undefined) { - bodyParams["memberAccountId"] = input.memberAccountId; - } - return bodyParams; + return { + ...(input.memberAccountId !== undefined && { + memberAccountId: input.memberAccountId + }) + }; }; const serializeAws_json1_1AssociateS3ResourcesRequest = ( input: AssociateS3ResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.memberAccountId !== undefined) { - bodyParams["memberAccountId"] = input.memberAccountId; - } - if (input.s3Resources !== undefined) { - bodyParams["s3Resources"] = serializeAws_json1_1S3ResourcesClassification( - input.s3Resources, - context - ); - } - return bodyParams; + return { + ...(input.memberAccountId !== undefined && { + memberAccountId: input.memberAccountId + }), + ...(input.s3Resources !== undefined && { + s3Resources: serializeAws_json1_1S3ResourcesClassification( + input.s3Resources, + context + ) + }) + }; }; const serializeAws_json1_1ClassificationType = ( input: ClassificationType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.continuous !== undefined) { - bodyParams["continuous"] = input.continuous; - } - if (input.oneTime !== undefined) { - bodyParams["oneTime"] = input.oneTime; - } - return bodyParams; + return { + ...(input.continuous !== undefined && { continuous: input.continuous }), + ...(input.oneTime !== undefined && { oneTime: input.oneTime }) + }; }; const serializeAws_json1_1ClassificationTypeUpdate = ( input: ClassificationTypeUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.continuous !== undefined) { - bodyParams["continuous"] = input.continuous; - } - if (input.oneTime !== undefined) { - bodyParams["oneTime"] = input.oneTime; - } - return bodyParams; + return { + ...(input.continuous !== undefined && { continuous: input.continuous }), + ...(input.oneTime !== undefined && { oneTime: input.oneTime }) + }; }; const serializeAws_json1_1DisassociateMemberAccountRequest = ( input: DisassociateMemberAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.memberAccountId !== undefined) { - bodyParams["memberAccountId"] = input.memberAccountId; - } - return bodyParams; + return { + ...(input.memberAccountId !== undefined && { + memberAccountId: input.memberAccountId + }) + }; }; const serializeAws_json1_1DisassociateS3ResourcesRequest = ( input: DisassociateS3ResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.associatedS3Resources !== undefined) { - bodyParams["associatedS3Resources"] = serializeAws_json1_1S3Resources( - input.associatedS3Resources, - context - ); - } - if (input.memberAccountId !== undefined) { - bodyParams["memberAccountId"] = input.memberAccountId; - } - return bodyParams; + return { + ...(input.associatedS3Resources !== undefined && { + associatedS3Resources: serializeAws_json1_1S3Resources( + input.associatedS3Resources, + context + ) + }), + ...(input.memberAccountId !== undefined && { + memberAccountId: input.memberAccountId + }) + }; }; const serializeAws_json1_1ListMemberAccountsRequest = ( input: ListMemberAccountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListS3ResourcesRequest = ( input: ListS3ResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.memberAccountId !== undefined) { - bodyParams["memberAccountId"] = input.memberAccountId; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.memberAccountId !== undefined && { + memberAccountId: input.memberAccountId + }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1S3Resource = ( input: S3Resource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - return bodyParams; + return { + ...(input.bucketName !== undefined && { bucketName: input.bucketName }), + ...(input.prefix !== undefined && { prefix: input.prefix }) + }; }; const serializeAws_json1_1S3ResourceClassification = ( input: S3ResourceClassification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - if (input.classificationType !== undefined) { - bodyParams["classificationType"] = serializeAws_json1_1ClassificationType( - input.classificationType, - context - ); - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - return bodyParams; + return { + ...(input.bucketName !== undefined && { bucketName: input.bucketName }), + ...(input.classificationType !== undefined && { + classificationType: serializeAws_json1_1ClassificationType( + input.classificationType, + context + ) + }), + ...(input.prefix !== undefined && { prefix: input.prefix }) + }; }; const serializeAws_json1_1S3ResourceClassificationUpdate = ( input: S3ResourceClassificationUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - if (input.classificationTypeUpdate !== undefined) { - bodyParams[ - "classificationTypeUpdate" - ] = serializeAws_json1_1ClassificationTypeUpdate( - input.classificationTypeUpdate, - context - ); - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - return bodyParams; + return { + ...(input.bucketName !== undefined && { bucketName: input.bucketName }), + ...(input.classificationTypeUpdate !== undefined && { + classificationTypeUpdate: serializeAws_json1_1ClassificationTypeUpdate( + input.classificationTypeUpdate, + context + ) + }), + ...(input.prefix !== undefined && { prefix: input.prefix }) + }; }; const serializeAws_json1_1S3Resources = ( @@ -1011,19 +981,17 @@ const serializeAws_json1_1UpdateS3ResourcesRequest = ( input: UpdateS3ResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.memberAccountId !== undefined) { - bodyParams["memberAccountId"] = input.memberAccountId; - } - if (input.s3ResourcesUpdate !== undefined) { - bodyParams[ - "s3ResourcesUpdate" - ] = serializeAws_json1_1S3ResourcesClassificationUpdate( - input.s3ResourcesUpdate, - context - ); - } - return bodyParams; + return { + ...(input.memberAccountId !== undefined && { + memberAccountId: input.memberAccountId + }), + ...(input.s3ResourcesUpdate !== undefined && { + s3ResourcesUpdate: serializeAws_json1_1S3ResourcesClassificationUpdate( + input.s3ResourcesUpdate, + context + ) + }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-managedblockchain/protocols/Aws_restJson1_1.ts b/clients/client-managedblockchain/protocols/Aws_restJson1_1.ts index 46151fad6543..575dc238aba9 100644 --- a/clients/client-managedblockchain/protocols/Aws_restJson1_1.ts +++ b/clients/client-managedblockchain/protocols/Aws_restJson1_1.ts @@ -3114,28 +3114,26 @@ const serializeAws_restJson1_1ApprovalThresholdPolicy = ( input: ApprovalThresholdPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProposalDurationInHours !== undefined) { - bodyParams["ProposalDurationInHours"] = input.ProposalDurationInHours; - } - if (input.ThresholdComparator !== undefined) { - bodyParams["ThresholdComparator"] = input.ThresholdComparator; - } - if (input.ThresholdPercentage !== undefined) { - bodyParams["ThresholdPercentage"] = input.ThresholdPercentage; - } - return bodyParams; + return { + ...(input.ProposalDurationInHours !== undefined && { + ProposalDurationInHours: input.ProposalDurationInHours + }), + ...(input.ThresholdComparator !== undefined && { + ThresholdComparator: input.ThresholdComparator + }), + ...(input.ThresholdPercentage !== undefined && { + ThresholdPercentage: input.ThresholdPercentage + }) + }; }; const serializeAws_restJson1_1InviteAction = ( input: InviteAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Principal !== undefined) { - bodyParams["Principal"] = input.Principal; - } - return bodyParams; + return { + ...(input.Principal !== undefined && { Principal: input.Principal }) + }; }; const serializeAws_restJson1_1InviteActionList = ( @@ -3151,120 +3149,110 @@ const serializeAws_restJson1_1MemberConfiguration = ( input: MemberConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.FrameworkConfiguration !== undefined) { - bodyParams[ - "FrameworkConfiguration" - ] = serializeAws_restJson1_1MemberFrameworkConfiguration( - input.FrameworkConfiguration, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.FrameworkConfiguration !== undefined && { + FrameworkConfiguration: serializeAws_restJson1_1MemberFrameworkConfiguration( + input.FrameworkConfiguration, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_restJson1_1MemberFabricConfiguration = ( input: MemberFabricConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminPassword !== undefined) { - bodyParams["AdminPassword"] = input.AdminPassword; - } - if (input.AdminUsername !== undefined) { - bodyParams["AdminUsername"] = input.AdminUsername; - } - return bodyParams; + return { + ...(input.AdminPassword !== undefined && { + AdminPassword: input.AdminPassword + }), + ...(input.AdminUsername !== undefined && { + AdminUsername: input.AdminUsername + }) + }; }; const serializeAws_restJson1_1MemberFrameworkConfiguration = ( input: MemberFrameworkConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Fabric !== undefined) { - bodyParams["Fabric"] = serializeAws_restJson1_1MemberFabricConfiguration( - input.Fabric, - context - ); - } - return bodyParams; + return { + ...(input.Fabric !== undefined && { + Fabric: serializeAws_restJson1_1MemberFabricConfiguration( + input.Fabric, + context + ) + }) + }; }; const serializeAws_restJson1_1NetworkFabricConfiguration = ( input: NetworkFabricConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Edition !== undefined) { - bodyParams["Edition"] = input.Edition; - } - return bodyParams; + return { + ...(input.Edition !== undefined && { Edition: input.Edition }) + }; }; const serializeAws_restJson1_1NetworkFrameworkConfiguration = ( input: NetworkFrameworkConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Fabric !== undefined) { - bodyParams["Fabric"] = serializeAws_restJson1_1NetworkFabricConfiguration( - input.Fabric, - context - ); - } - return bodyParams; + return { + ...(input.Fabric !== undefined && { + Fabric: serializeAws_restJson1_1NetworkFabricConfiguration( + input.Fabric, + context + ) + }) + }; }; const serializeAws_restJson1_1NodeConfiguration = ( input: NodeConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - return bodyParams; + return { + ...(input.AvailabilityZone !== undefined && { + AvailabilityZone: input.AvailabilityZone + }), + ...(input.InstanceType !== undefined && { + InstanceType: input.InstanceType + }) + }; }; const serializeAws_restJson1_1ProposalActions = ( input: ProposalActions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Invitations !== undefined) { - bodyParams["Invitations"] = serializeAws_restJson1_1InviteActionList( - input.Invitations, - context - ); - } - if (input.Removals !== undefined) { - bodyParams["Removals"] = serializeAws_restJson1_1RemoveActionList( - input.Removals, - context - ); - } - return bodyParams; + return { + ...(input.Invitations !== undefined && { + Invitations: serializeAws_restJson1_1InviteActionList( + input.Invitations, + context + ) + }), + ...(input.Removals !== undefined && { + Removals: serializeAws_restJson1_1RemoveActionList( + input.Removals, + context + ) + }) + }; }; const serializeAws_restJson1_1RemoveAction = ( input: RemoveAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MemberId !== undefined) { - bodyParams["MemberId"] = input.MemberId; - } - return bodyParams; + return { + ...(input.MemberId !== undefined && { MemberId: input.MemberId }) + }; }; const serializeAws_restJson1_1RemoveActionList = ( @@ -3280,16 +3268,14 @@ const serializeAws_restJson1_1VotingPolicy = ( input: VotingPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApprovalThresholdPolicy !== undefined) { - bodyParams[ - "ApprovalThresholdPolicy" - ] = serializeAws_restJson1_1ApprovalThresholdPolicy( - input.ApprovalThresholdPolicy, - context - ); - } - return bodyParams; + return { + ...(input.ApprovalThresholdPolicy !== undefined && { + ApprovalThresholdPolicy: serializeAws_restJson1_1ApprovalThresholdPolicy( + input.ApprovalThresholdPolicy, + context + ) + }) + }; }; const deserializeAws_restJson1_1ApprovalThresholdPolicy = ( diff --git a/clients/client-marketplace-catalog/protocols/Aws_restJson1_1.ts b/clients/client-marketplace-catalog/protocols/Aws_restJson1_1.ts index 7cac89547467..810c27c1f9d1 100644 --- a/clients/client-marketplace-catalog/protocols/Aws_restJson1_1.ts +++ b/clients/client-marketplace-catalog/protocols/Aws_restJson1_1.ts @@ -1137,51 +1137,35 @@ const serializeAws_restJson1_1Change = ( input: Change, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeType !== undefined) { - bodyParams["ChangeType"] = input.ChangeType; - } - if (input.Details !== undefined) { - bodyParams["Details"] = input.Details; - } - if (input.Entity !== undefined) { - bodyParams["Entity"] = serializeAws_restJson1_1Entity( - input.Entity, - context - ); - } - return bodyParams; + return { + ...(input.ChangeType !== undefined && { ChangeType: input.ChangeType }), + ...(input.Details !== undefined && { Details: input.Details }), + ...(input.Entity !== undefined && { + Entity: serializeAws_restJson1_1Entity(input.Entity, context) + }) + }; }; const serializeAws_restJson1_1Entity = ( input: Entity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Identifier !== undefined && { Identifier: input.Identifier }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ValueList !== undefined) { - bodyParams["ValueList"] = serializeAws_restJson1_1ValueList( - input.ValueList, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ValueList !== undefined && { + ValueList: serializeAws_restJson1_1ValueList(input.ValueList, context) + }) + }; }; const serializeAws_restJson1_1FilterList = ( @@ -1202,14 +1186,10 @@ const serializeAws_restJson1_1Sort = ( input: Sort, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + return { + ...(input.SortBy !== undefined && { SortBy: input.SortBy }), + ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }) + }; }; const serializeAws_restJson1_1ValueList = ( 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 a66d6327e8e4..3b0a94f05b6d 100644 --- a/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-commerce-analytics/protocols/Aws_json1_1.ts @@ -212,70 +212,54 @@ const serializeAws_json1_1GenerateDataSetRequest = ( input: GenerateDataSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.customerDefinedValues !== undefined) { - bodyParams[ - "customerDefinedValues" - ] = serializeAws_json1_1CustomerDefinedValues( - input.customerDefinedValues, - context - ); - } - if (input.dataSetPublicationDate !== undefined) { - bodyParams["dataSetPublicationDate"] = Math.round( - input.dataSetPublicationDate.getTime() / 1000 - ); - } - if (input.dataSetType !== undefined) { - bodyParams["dataSetType"] = input.dataSetType; - } - if (input.destinationS3BucketName !== undefined) { - bodyParams["destinationS3BucketName"] = input.destinationS3BucketName; - } - if (input.destinationS3Prefix !== undefined) { - bodyParams["destinationS3Prefix"] = input.destinationS3Prefix; - } - if (input.roleNameArn !== undefined) { - bodyParams["roleNameArn"] = input.roleNameArn; - } - if (input.snsTopicArn !== undefined) { - bodyParams["snsTopicArn"] = input.snsTopicArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartSupportDataExportRequest = ( input: StartSupportDataExportRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.customerDefinedValues !== undefined) { - bodyParams[ - "customerDefinedValues" - ] = serializeAws_json1_1CustomerDefinedValues( - input.customerDefinedValues, - context - ); - } - if (input.dataSetType !== undefined) { - bodyParams["dataSetType"] = input.dataSetType; - } - if (input.destinationS3BucketName !== undefined) { - bodyParams["destinationS3BucketName"] = input.destinationS3BucketName; - } - if (input.destinationS3Prefix !== undefined) { - bodyParams["destinationS3Prefix"] = input.destinationS3Prefix; - } - if (input.fromDate !== undefined) { - bodyParams["fromDate"] = Math.round(input.fromDate.getTime() / 1000); - } - if (input.roleNameArn !== undefined) { - bodyParams["roleNameArn"] = input.roleNameArn; - } - if (input.snsTopicArn !== undefined) { - bodyParams["snsTopicArn"] = input.snsTopicArn; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1GenerateDataSetResult = ( 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 798176f1015f..e5f88edd853a 100644 --- a/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-entitlement-service/protocols/Aws_json1_1.ts @@ -196,23 +196,14 @@ const serializeAws_json1_1GetEntitlementsRequest = ( input: GetEntitlementsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1GetEntitlementFilters( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ProductCode !== undefined) { - bodyParams["ProductCode"] = input.ProductCode; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1Entitlement = ( diff --git a/clients/client-marketplace-metering/protocols/Aws_json1_1.ts b/clients/client-marketplace-metering/protocols/Aws_json1_1.ts index 034eee4fef35..7036ace22e45 100644 --- a/clients/client-marketplace-metering/protocols/Aws_json1_1.ts +++ b/clients/client-marketplace-metering/protocols/Aws_json1_1.ts @@ -890,88 +890,74 @@ const serializeAws_json1_1BatchMeterUsageRequest = ( input: BatchMeterUsageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProductCode !== undefined) { - bodyParams["ProductCode"] = input.ProductCode; - } - if (input.UsageRecords !== undefined) { - bodyParams["UsageRecords"] = serializeAws_json1_1UsageRecordList( - input.UsageRecords, - context - ); - } - return bodyParams; + return { + ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), + ...(input.UsageRecords !== undefined && { + UsageRecords: serializeAws_json1_1UsageRecordList( + input.UsageRecords, + context + ) + }) + }; }; const serializeAws_json1_1MeterUsageRequest = ( input: MeterUsageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.ProductCode !== undefined) { - bodyParams["ProductCode"] = input.ProductCode; - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - if (input.UsageDimension !== undefined) { - bodyParams["UsageDimension"] = input.UsageDimension; - } - if (input.UsageQuantity !== undefined) { - bodyParams["UsageQuantity"] = input.UsageQuantity; - } - return bodyParams; + return { + ...(input.DryRun !== undefined && { DryRun: input.DryRun }), + ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), + ...(input.Timestamp !== undefined && { + Timestamp: Math.round(input.Timestamp.getTime() / 1000) + }), + ...(input.UsageDimension !== undefined && { + UsageDimension: input.UsageDimension + }), + ...(input.UsageQuantity !== undefined && { + UsageQuantity: input.UsageQuantity + }) + }; }; const serializeAws_json1_1RegisterUsageRequest = ( input: RegisterUsageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Nonce !== undefined) { - bodyParams["Nonce"] = input.Nonce; - } - if (input.ProductCode !== undefined) { - bodyParams["ProductCode"] = input.ProductCode; - } - if (input.PublicKeyVersion !== undefined) { - bodyParams["PublicKeyVersion"] = input.PublicKeyVersion; - } - return bodyParams; + return { + ...(input.Nonce !== undefined && { Nonce: input.Nonce }), + ...(input.ProductCode !== undefined && { ProductCode: input.ProductCode }), + ...(input.PublicKeyVersion !== undefined && { + PublicKeyVersion: input.PublicKeyVersion + }) + }; }; const serializeAws_json1_1ResolveCustomerRequest = ( input: ResolveCustomerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegistrationToken !== undefined) { - bodyParams["RegistrationToken"] = input.RegistrationToken; - } - return bodyParams; + return { + ...(input.RegistrationToken !== undefined && { + RegistrationToken: input.RegistrationToken + }) + }; }; const serializeAws_json1_1UsageRecord = ( input: UsageRecord, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomerIdentifier !== undefined) { - bodyParams["CustomerIdentifier"] = input.CustomerIdentifier; - } - if (input.Dimension !== undefined) { - bodyParams["Dimension"] = input.Dimension; - } - if (input.Quantity !== undefined) { - bodyParams["Quantity"] = input.Quantity; - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UsageRecordList = ( diff --git a/clients/client-mediaconnect/protocols/Aws_restJson1_1.ts b/clients/client-mediaconnect/protocols/Aws_restJson1_1.ts index 073e783a14f2..fc993304d3d7 100644 --- a/clients/client-mediaconnect/protocols/Aws_restJson1_1.ts +++ b/clients/client-mediaconnect/protocols/Aws_restJson1_1.ts @@ -2925,190 +2925,112 @@ const serializeAws_restJson1_1AddOutputRequest = ( input: AddOutputRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CidrAllowList !== undefined) { - bodyParams["cidrAllowList"] = serializeAws_restJson1_1__listOf__string( - input.CidrAllowList, - context - ); - } - if (input.Description !== undefined) { - bodyParams["description"] = input.Description; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = input.Destination; - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.MaxLatency !== undefined) { - bodyParams["maxLatency"] = input.MaxLatency; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.Port !== undefined) { - bodyParams["port"] = input.Port; - } - if (input.Protocol !== undefined) { - bodyParams["protocol"] = input.Protocol; - } - if (input.RemoteId !== undefined) { - bodyParams["remoteId"] = input.RemoteId; - } - if (input.SmoothingLatency !== undefined) { - bodyParams["smoothingLatency"] = input.SmoothingLatency; - } - if (input.StreamId !== undefined) { - bodyParams["streamId"] = input.StreamId; - } - return bodyParams; + return { + ...(input.CidrAllowList !== undefined && { + cidrAllowList: serializeAws_restJson1_1__listOf__string( + input.CidrAllowList, + context + ) + }), + ...(input.Description !== undefined && { description: input.Description }), + ...(input.Destination !== undefined && { destination: input.Destination }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1Encryption(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 }) + }; }; const serializeAws_restJson1_1Encryption = ( input: Encryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Algorithm !== undefined) { - bodyParams["algorithm"] = input.Algorithm; - } - if (input.ConstantInitializationVector !== undefined) { - bodyParams["constantInitializationVector"] = - input.ConstantInitializationVector; - } - if (input.DeviceId !== undefined) { - bodyParams["deviceId"] = input.DeviceId; - } - if (input.KeyType !== undefined) { - bodyParams["keyType"] = input.KeyType; - } - if (input.Region !== undefined) { - bodyParams["region"] = input.Region; - } - if (input.ResourceId !== undefined) { - bodyParams["resourceId"] = input.ResourceId; - } - if (input.RoleArn !== undefined) { - bodyParams["roleArn"] = input.RoleArn; - } - if (input.SecretArn !== undefined) { - bodyParams["secretArn"] = input.SecretArn; - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1GrantEntitlementRequest = ( input: GrantEntitlementRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataTransferSubscriberFeePercent !== undefined) { - bodyParams["dataTransferSubscriberFeePercent"] = - input.DataTransferSubscriberFeePercent; - } - if (input.Description !== undefined) { - bodyParams["description"] = input.Description; - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1Encryption( - input.Encryption, - context - ); - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.Subscribers !== undefined) { - bodyParams["subscribers"] = serializeAws_restJson1_1__listOf__string( - input.Subscribers, - context - ); - } - return bodyParams; + return { + ...(input.DataTransferSubscriberFeePercent !== undefined && { + dataTransferSubscriberFeePercent: input.DataTransferSubscriberFeePercent + }), + ...(input.Description !== undefined && { description: input.Description }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1Encryption(input.Encryption, context) + }), + ...(input.Name !== undefined && { name: input.Name }), + ...(input.Subscribers !== undefined && { + subscribers: serializeAws_restJson1_1__listOf__string( + input.Subscribers, + context + ) + }) + }; }; const serializeAws_restJson1_1SetSourceRequest = ( input: SetSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Decryption !== undefined) { - bodyParams["decryption"] = serializeAws_restJson1_1Encryption( - input.Decryption, - context - ); - } - if (input.Description !== undefined) { - bodyParams["description"] = input.Description; - } - if (input.EntitlementArn !== undefined) { - bodyParams["entitlementArn"] = input.EntitlementArn; - } - if (input.IngestPort !== undefined) { - bodyParams["ingestPort"] = input.IngestPort; - } - if (input.MaxBitrate !== undefined) { - bodyParams["maxBitrate"] = input.MaxBitrate; - } - if (input.MaxLatency !== undefined) { - bodyParams["maxLatency"] = input.MaxLatency; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.Protocol !== undefined) { - bodyParams["protocol"] = input.Protocol; - } - if (input.StreamId !== undefined) { - bodyParams["streamId"] = input.StreamId; - } - if (input.WhitelistCidr !== undefined) { - bodyParams["whitelistCidr"] = input.WhitelistCidr; - } - return bodyParams; + return { + ...(input.Decryption !== undefined && { + decryption: serializeAws_restJson1_1Encryption(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.WhitelistCidr !== undefined && { + whitelistCidr: input.WhitelistCidr + }) + }; }; const serializeAws_restJson1_1UpdateEncryption = ( input: UpdateEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Algorithm !== undefined) { - bodyParams["algorithm"] = input.Algorithm; - } - if (input.ConstantInitializationVector !== undefined) { - bodyParams["constantInitializationVector"] = - input.ConstantInitializationVector; - } - if (input.DeviceId !== undefined) { - bodyParams["deviceId"] = input.DeviceId; - } - if (input.KeyType !== undefined) { - bodyParams["keyType"] = input.KeyType; - } - if (input.Region !== undefined) { - bodyParams["region"] = input.Region; - } - if (input.ResourceId !== undefined) { - bodyParams["resourceId"] = input.ResourceId; - } - if (input.RoleArn !== undefined) { - bodyParams["roleArn"] = input.RoleArn; - } - if (input.SecretArn !== undefined) { - bodyParams["secretArn"] = input.SecretArn; - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1__listOfAddOutputRequest = ( diff --git a/clients/client-mediaconvert/protocols/Aws_restJson1_1.ts b/clients/client-mediaconvert/protocols/Aws_restJson1_1.ts index 783a0ea15c0f..ff368a6fb826 100644 --- a/clients/client-mediaconvert/protocols/Aws_restJson1_1.ts +++ b/clients/client-mediaconvert/protocols/Aws_restJson1_1.ts @@ -4221,3756 +4221,3090 @@ const serializeAws_restJson1_1AacSettings = ( input: AacSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioDescriptionBroadcasterMix !== undefined) { - bodyParams["audioDescriptionBroadcasterMix"] = - input.AudioDescriptionBroadcasterMix; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.CodecProfile !== undefined) { - bodyParams["codecProfile"] = input.CodecProfile; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.RawFormat !== undefined) { - bodyParams["rawFormat"] = input.RawFormat; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - if (input.Specification !== undefined) { - bodyParams["specification"] = input.Specification; - } - if (input.VbrQuality !== undefined) { - bodyParams["vbrQuality"] = input.VbrQuality; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Ac3Settings = ( input: Ac3Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BitstreamMode !== undefined) { - bodyParams["bitstreamMode"] = input.BitstreamMode; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.Dialnorm !== undefined) { - bodyParams["dialnorm"] = input.Dialnorm; - } - if (input.DynamicRangeCompressionProfile !== undefined) { - bodyParams["dynamicRangeCompressionProfile"] = - input.DynamicRangeCompressionProfile; - } - if (input.LfeFilter !== undefined) { - bodyParams["lfeFilter"] = input.LfeFilter; - } - if (input.MetadataControl !== undefined) { - bodyParams["metadataControl"] = input.MetadataControl; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1AccelerationSettings = ( input: AccelerationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Mode !== undefined) { - bodyParams["mode"] = input.Mode; - } - return bodyParams; + return { + ...(input.Mode !== undefined && { mode: input.Mode }) + }; }; const serializeAws_restJson1_1AiffSettings = ( input: AiffSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BitDepth !== undefined) { - bodyParams["bitDepth"] = input.BitDepth; - } - if (input.Channels !== undefined) { - bodyParams["channels"] = input.Channels; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - return bodyParams; + return { + ...(input.BitDepth !== undefined && { bitDepth: input.BitDepth }), + ...(input.Channels !== undefined && { channels: input.Channels }), + ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }) + }; }; const serializeAws_restJson1_1AncillarySourceSettings = ( input: AncillarySourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Convert608To708 !== undefined) { - bodyParams["convert608To708"] = input.Convert608To708; - } - if (input.SourceAncillaryChannelNumber !== undefined) { - bodyParams["sourceAncillaryChannelNumber"] = - input.SourceAncillaryChannelNumber; - } - if (input.TerminateCaptions !== undefined) { - bodyParams["terminateCaptions"] = input.TerminateCaptions; - } - return bodyParams; + return { + ...(input.Convert608To708 !== undefined && { + convert608To708: input.Convert608To708 + }), + ...(input.SourceAncillaryChannelNumber !== undefined && { + sourceAncillaryChannelNumber: input.SourceAncillaryChannelNumber + }), + ...(input.TerminateCaptions !== undefined && { + terminateCaptions: input.TerminateCaptions + }) + }; }; const serializeAws_restJson1_1AudioCodecSettings = ( input: AudioCodecSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AacSettings !== undefined) { - bodyParams["aacSettings"] = serializeAws_restJson1_1AacSettings( - input.AacSettings, - context - ); - } - if (input.Ac3Settings !== undefined) { - bodyParams["ac3Settings"] = serializeAws_restJson1_1Ac3Settings( - input.Ac3Settings, - context - ); - } - if (input.AiffSettings !== undefined) { - bodyParams["aiffSettings"] = serializeAws_restJson1_1AiffSettings( - input.AiffSettings, - context - ); - } - if (input.Codec !== undefined) { - bodyParams["codec"] = input.Codec; - } - if (input.Eac3AtmosSettings !== undefined) { - bodyParams["eac3AtmosSettings"] = serializeAws_restJson1_1Eac3AtmosSettings( - input.Eac3AtmosSettings, - context - ); - } - if (input.Eac3Settings !== undefined) { - bodyParams["eac3Settings"] = serializeAws_restJson1_1Eac3Settings( - input.Eac3Settings, - context - ); - } - if (input.Mp2Settings !== undefined) { - bodyParams["mp2Settings"] = serializeAws_restJson1_1Mp2Settings( - input.Mp2Settings, - context - ); - } - if (input.Mp3Settings !== undefined) { - bodyParams["mp3Settings"] = serializeAws_restJson1_1Mp3Settings( - input.Mp3Settings, - context - ); - } - if (input.WavSettings !== undefined) { - bodyParams["wavSettings"] = serializeAws_restJson1_1WavSettings( - input.WavSettings, - context - ); - } - return bodyParams; + return { + ...(input.AacSettings !== undefined && { + aacSettings: serializeAws_restJson1_1AacSettings( + input.AacSettings, + context + ) + }), + ...(input.Ac3Settings !== undefined && { + ac3Settings: serializeAws_restJson1_1Ac3Settings( + input.Ac3Settings, + context + ) + }), + ...(input.AiffSettings !== undefined && { + aiffSettings: serializeAws_restJson1_1AiffSettings( + input.AiffSettings, + context + ) + }), + ...(input.Codec !== undefined && { codec: input.Codec }), + ...(input.Eac3AtmosSettings !== undefined && { + eac3AtmosSettings: serializeAws_restJson1_1Eac3AtmosSettings( + input.Eac3AtmosSettings, + context + ) + }), + ...(input.Eac3Settings !== undefined && { + eac3Settings: serializeAws_restJson1_1Eac3Settings( + input.Eac3Settings, + context + ) + }), + ...(input.Mp2Settings !== undefined && { + mp2Settings: serializeAws_restJson1_1Mp2Settings( + input.Mp2Settings, + context + ) + }), + ...(input.Mp3Settings !== undefined && { + mp3Settings: serializeAws_restJson1_1Mp3Settings( + input.Mp3Settings, + context + ) + }), + ...(input.WavSettings !== undefined && { + wavSettings: serializeAws_restJson1_1WavSettings( + input.WavSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1AudioDescription = ( input: AudioDescription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioNormalizationSettings !== undefined) { - bodyParams[ - "audioNormalizationSettings" - ] = serializeAws_restJson1_1AudioNormalizationSettings( - input.AudioNormalizationSettings, - context - ); - } - if (input.AudioSourceName !== undefined) { - bodyParams["audioSourceName"] = input.AudioSourceName; - } - if (input.AudioType !== undefined) { - bodyParams["audioType"] = input.AudioType; - } - if (input.AudioTypeControl !== undefined) { - bodyParams["audioTypeControl"] = input.AudioTypeControl; - } - if (input.CodecSettings !== undefined) { - bodyParams["codecSettings"] = serializeAws_restJson1_1AudioCodecSettings( - input.CodecSettings, - context - ); - } - if (input.CustomLanguageCode !== undefined) { - bodyParams["customLanguageCode"] = input.CustomLanguageCode; - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageCodeControl !== undefined) { - bodyParams["languageCodeControl"] = input.LanguageCodeControl; - } - if (input.RemixSettings !== undefined) { - bodyParams["remixSettings"] = serializeAws_restJson1_1RemixSettings( - input.RemixSettings, - context - ); - } - if (input.StreamName !== undefined) { - bodyParams["streamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.AudioNormalizationSettings !== undefined && { + audioNormalizationSettings: serializeAws_restJson1_1AudioNormalizationSettings( + 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_restJson1_1AudioCodecSettings( + 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_restJson1_1RemixSettings( + input.RemixSettings, + context + ) + }), + ...(input.StreamName !== undefined && { streamName: input.StreamName }) + }; }; const serializeAws_restJson1_1AudioNormalizationSettings = ( input: AudioNormalizationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Algorithm !== undefined) { - bodyParams["algorithm"] = input.Algorithm; - } - if (input.AlgorithmControl !== undefined) { - bodyParams["algorithmControl"] = input.AlgorithmControl; - } - if (input.CorrectionGateLevel !== undefined) { - bodyParams["correctionGateLevel"] = input.CorrectionGateLevel; - } - if (input.LoudnessLogging !== undefined) { - bodyParams["loudnessLogging"] = input.LoudnessLogging; - } - if (input.PeakCalculation !== undefined) { - bodyParams["peakCalculation"] = input.PeakCalculation; - } - if (input.TargetLkfs !== undefined) { - bodyParams["targetLkfs"] = input.TargetLkfs; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1AudioSelector = ( input: AudioSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomLanguageCode !== undefined) { - bodyParams["customLanguageCode"] = input.CustomLanguageCode; - } - if (input.DefaultSelection !== undefined) { - bodyParams["defaultSelection"] = input.DefaultSelection; - } - if (input.ExternalAudioFileInput !== undefined) { - bodyParams["externalAudioFileInput"] = input.ExternalAudioFileInput; - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.Offset !== undefined) { - bodyParams["offset"] = input.Offset; - } - if (input.Pids !== undefined) { - bodyParams[ - "pids" - ] = serializeAws_restJson1_1__listOf__integerMin1Max2147483647( - input.Pids, - context - ); - } - if (input.ProgramSelection !== undefined) { - bodyParams["programSelection"] = input.ProgramSelection; - } - if (input.RemixSettings !== undefined) { - bodyParams["remixSettings"] = serializeAws_restJson1_1RemixSettings( - input.RemixSettings, - context - ); - } - if (input.SelectorType !== undefined) { - bodyParams["selectorType"] = input.SelectorType; - } - if (input.Tracks !== undefined) { - bodyParams[ - "tracks" - ] = serializeAws_restJson1_1__listOf__integerMin1Max2147483647( - input.Tracks, - context - ); - } - return bodyParams; + 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_1__listOf__integerMin1Max2147483647( + input.Pids, + context + ) + }), + ...(input.ProgramSelection !== undefined && { + programSelection: input.ProgramSelection + }), + ...(input.RemixSettings !== undefined && { + remixSettings: serializeAws_restJson1_1RemixSettings( + input.RemixSettings, + context + ) + }), + ...(input.SelectorType !== undefined && { + selectorType: input.SelectorType + }), + ...(input.Tracks !== undefined && { + tracks: serializeAws_restJson1_1__listOf__integerMin1Max2147483647( + input.Tracks, + context + ) + }) + }; }; const serializeAws_restJson1_1AudioSelectorGroup = ( input: AudioSelectorGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioSelectorNames !== undefined) { - bodyParams[ - "audioSelectorNames" - ] = serializeAws_restJson1_1__listOf__stringMin1( - input.AudioSelectorNames, - context - ); - } - return bodyParams; + return { + ...(input.AudioSelectorNames !== undefined && { + audioSelectorNames: serializeAws_restJson1_1__listOf__stringMin1( + input.AudioSelectorNames, + context + ) + }) + }; }; const serializeAws_restJson1_1AvailBlanking = ( input: AvailBlanking, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailBlankingImage !== undefined) { - bodyParams["availBlankingImage"] = input.AvailBlankingImage; - } - return bodyParams; + return { + ...(input.AvailBlankingImage !== undefined && { + availBlankingImage: input.AvailBlankingImage + }) + }; }; const serializeAws_restJson1_1BurninDestinationSettings = ( input: BurninDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alignment !== undefined) { - bodyParams["alignment"] = input.Alignment; - } - if (input.BackgroundColor !== undefined) { - bodyParams["backgroundColor"] = input.BackgroundColor; - } - if (input.BackgroundOpacity !== undefined) { - bodyParams["backgroundOpacity"] = input.BackgroundOpacity; - } - if (input.FontColor !== undefined) { - bodyParams["fontColor"] = input.FontColor; - } - if (input.FontOpacity !== undefined) { - bodyParams["fontOpacity"] = input.FontOpacity; - } - if (input.FontResolution !== undefined) { - bodyParams["fontResolution"] = input.FontResolution; - } - if (input.FontScript !== undefined) { - bodyParams["fontScript"] = input.FontScript; - } - if (input.FontSize !== undefined) { - bodyParams["fontSize"] = input.FontSize; - } - if (input.OutlineColor !== undefined) { - bodyParams["outlineColor"] = input.OutlineColor; - } - if (input.OutlineSize !== undefined) { - bodyParams["outlineSize"] = input.OutlineSize; - } - if (input.ShadowColor !== undefined) { - bodyParams["shadowColor"] = input.ShadowColor; - } - if (input.ShadowOpacity !== undefined) { - bodyParams["shadowOpacity"] = input.ShadowOpacity; - } - if (input.ShadowXOffset !== undefined) { - bodyParams["shadowXOffset"] = input.ShadowXOffset; - } - if (input.ShadowYOffset !== undefined) { - bodyParams["shadowYOffset"] = input.ShadowYOffset; - } - if (input.TeletextSpacing !== undefined) { - bodyParams["teletextSpacing"] = input.TeletextSpacing; - } - if (input.XPosition !== undefined) { - bodyParams["xPosition"] = input.XPosition; - } - if (input.YPosition !== undefined) { - bodyParams["yPosition"] = input.YPosition; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CaptionDescription = ( input: CaptionDescription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionSelectorName !== undefined) { - bodyParams["captionSelectorName"] = input.CaptionSelectorName; - } - if (input.CustomLanguageCode !== undefined) { - bodyParams["customLanguageCode"] = input.CustomLanguageCode; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1CaptionDestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageDescription !== undefined) { - bodyParams["languageDescription"] = input.LanguageDescription; - } - return bodyParams; + return { + ...(input.CaptionSelectorName !== undefined && { + captionSelectorName: input.CaptionSelectorName + }), + ...(input.CustomLanguageCode !== undefined && { + customLanguageCode: input.CustomLanguageCode + }), + ...(input.DestinationSettings !== undefined && { + destinationSettings: serializeAws_restJson1_1CaptionDestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.LanguageDescription !== undefined && { + languageDescription: input.LanguageDescription + }) + }; }; const serializeAws_restJson1_1CaptionDescriptionPreset = ( input: CaptionDescriptionPreset, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomLanguageCode !== undefined) { - bodyParams["customLanguageCode"] = input.CustomLanguageCode; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1CaptionDestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageDescription !== undefined) { - bodyParams["languageDescription"] = input.LanguageDescription; - } - return bodyParams; + return { + ...(input.CustomLanguageCode !== undefined && { + customLanguageCode: input.CustomLanguageCode + }), + ...(input.DestinationSettings !== undefined && { + destinationSettings: serializeAws_restJson1_1CaptionDestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.LanguageDescription !== undefined && { + languageDescription: input.LanguageDescription + }) + }; }; const serializeAws_restJson1_1CaptionDestinationSettings = ( input: CaptionDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BurninDestinationSettings !== undefined) { - bodyParams[ - "burninDestinationSettings" - ] = serializeAws_restJson1_1BurninDestinationSettings( - input.BurninDestinationSettings, - context - ); - } - if (input.DestinationType !== undefined) { - bodyParams["destinationType"] = input.DestinationType; - } - if (input.DvbSubDestinationSettings !== undefined) { - bodyParams[ - "dvbSubDestinationSettings" - ] = serializeAws_restJson1_1DvbSubDestinationSettings( - input.DvbSubDestinationSettings, - context - ); - } - if (input.EmbeddedDestinationSettings !== undefined) { - bodyParams[ - "embeddedDestinationSettings" - ] = serializeAws_restJson1_1EmbeddedDestinationSettings( - input.EmbeddedDestinationSettings, - context - ); - } - if (input.ImscDestinationSettings !== undefined) { - bodyParams[ - "imscDestinationSettings" - ] = serializeAws_restJson1_1ImscDestinationSettings( - input.ImscDestinationSettings, - context - ); - } - if (input.SccDestinationSettings !== undefined) { - bodyParams[ - "sccDestinationSettings" - ] = serializeAws_restJson1_1SccDestinationSettings( - input.SccDestinationSettings, - context - ); - } - if (input.TeletextDestinationSettings !== undefined) { - bodyParams[ - "teletextDestinationSettings" - ] = serializeAws_restJson1_1TeletextDestinationSettings( - input.TeletextDestinationSettings, - context - ); - } - if (input.TtmlDestinationSettings !== undefined) { - bodyParams[ - "ttmlDestinationSettings" - ] = serializeAws_restJson1_1TtmlDestinationSettings( - input.TtmlDestinationSettings, - context - ); - } - return bodyParams; + return { + ...(input.BurninDestinationSettings !== undefined && { + burninDestinationSettings: serializeAws_restJson1_1BurninDestinationSettings( + input.BurninDestinationSettings, + context + ) + }), + ...(input.DestinationType !== undefined && { + destinationType: input.DestinationType + }), + ...(input.DvbSubDestinationSettings !== undefined && { + dvbSubDestinationSettings: serializeAws_restJson1_1DvbSubDestinationSettings( + input.DvbSubDestinationSettings, + context + ) + }), + ...(input.EmbeddedDestinationSettings !== undefined && { + embeddedDestinationSettings: serializeAws_restJson1_1EmbeddedDestinationSettings( + input.EmbeddedDestinationSettings, + context + ) + }), + ...(input.ImscDestinationSettings !== undefined && { + imscDestinationSettings: serializeAws_restJson1_1ImscDestinationSettings( + input.ImscDestinationSettings, + context + ) + }), + ...(input.SccDestinationSettings !== undefined && { + sccDestinationSettings: serializeAws_restJson1_1SccDestinationSettings( + input.SccDestinationSettings, + context + ) + }), + ...(input.TeletextDestinationSettings !== undefined && { + teletextDestinationSettings: serializeAws_restJson1_1TeletextDestinationSettings( + input.TeletextDestinationSettings, + context + ) + }), + ...(input.TtmlDestinationSettings !== undefined && { + ttmlDestinationSettings: serializeAws_restJson1_1TtmlDestinationSettings( + input.TtmlDestinationSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1CaptionSelector = ( input: CaptionSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomLanguageCode !== undefined) { - bodyParams["customLanguageCode"] = input.CustomLanguageCode; - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.SourceSettings !== undefined) { - bodyParams[ - "sourceSettings" - ] = serializeAws_restJson1_1CaptionSourceSettings( - input.SourceSettings, - context - ); - } - return bodyParams; + return { + ...(input.CustomLanguageCode !== undefined && { + customLanguageCode: input.CustomLanguageCode + }), + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.SourceSettings !== undefined && { + sourceSettings: serializeAws_restJson1_1CaptionSourceSettings( + input.SourceSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1CaptionSourceSettings = ( input: CaptionSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AncillarySourceSettings !== undefined) { - bodyParams[ - "ancillarySourceSettings" - ] = serializeAws_restJson1_1AncillarySourceSettings( - input.AncillarySourceSettings, - context - ); - } - if (input.DvbSubSourceSettings !== undefined) { - bodyParams[ - "dvbSubSourceSettings" - ] = serializeAws_restJson1_1DvbSubSourceSettings( - input.DvbSubSourceSettings, - context - ); - } - if (input.EmbeddedSourceSettings !== undefined) { - bodyParams[ - "embeddedSourceSettings" - ] = serializeAws_restJson1_1EmbeddedSourceSettings( - input.EmbeddedSourceSettings, - context - ); - } - if (input.FileSourceSettings !== undefined) { - bodyParams[ - "fileSourceSettings" - ] = serializeAws_restJson1_1FileSourceSettings( - input.FileSourceSettings, - context - ); - } - if (input.SourceType !== undefined) { - bodyParams["sourceType"] = input.SourceType; - } - if (input.TeletextSourceSettings !== undefined) { - bodyParams[ - "teletextSourceSettings" - ] = serializeAws_restJson1_1TeletextSourceSettings( - input.TeletextSourceSettings, - context - ); - } - if (input.TrackSourceSettings !== undefined) { - bodyParams[ - "trackSourceSettings" - ] = serializeAws_restJson1_1TrackSourceSettings( - input.TrackSourceSettings, - context - ); - } - return bodyParams; + return { + ...(input.AncillarySourceSettings !== undefined && { + ancillarySourceSettings: serializeAws_restJson1_1AncillarySourceSettings( + input.AncillarySourceSettings, + context + ) + }), + ...(input.DvbSubSourceSettings !== undefined && { + dvbSubSourceSettings: serializeAws_restJson1_1DvbSubSourceSettings( + input.DvbSubSourceSettings, + context + ) + }), + ...(input.EmbeddedSourceSettings !== undefined && { + embeddedSourceSettings: serializeAws_restJson1_1EmbeddedSourceSettings( + input.EmbeddedSourceSettings, + context + ) + }), + ...(input.FileSourceSettings !== undefined && { + fileSourceSettings: serializeAws_restJson1_1FileSourceSettings( + input.FileSourceSettings, + context + ) + }), + ...(input.SourceType !== undefined && { sourceType: input.SourceType }), + ...(input.TeletextSourceSettings !== undefined && { + teletextSourceSettings: serializeAws_restJson1_1TeletextSourceSettings( + input.TeletextSourceSettings, + context + ) + }), + ...(input.TrackSourceSettings !== undefined && { + trackSourceSettings: serializeAws_restJson1_1TrackSourceSettings( + input.TrackSourceSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1ChannelMapping = ( input: ChannelMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputChannels !== undefined) { - bodyParams[ - "outputChannels" - ] = serializeAws_restJson1_1__listOfOutputChannelMapping( - input.OutputChannels, - context - ); - } - return bodyParams; + return { + ...(input.OutputChannels !== undefined && { + outputChannels: serializeAws_restJson1_1__listOfOutputChannelMapping( + input.OutputChannels, + context + ) + }) + }; }; const serializeAws_restJson1_1CmafAdditionalManifest = ( input: CmafAdditionalManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestNameModifier !== undefined) { - bodyParams["manifestNameModifier"] = input.ManifestNameModifier; - } - if (input.SelectedOutputs !== undefined) { - bodyParams[ - "selectedOutputs" - ] = serializeAws_restJson1_1__listOf__stringMin1( - input.SelectedOutputs, - context - ); - } - return bodyParams; + return { + ...(input.ManifestNameModifier !== undefined && { + manifestNameModifier: input.ManifestNameModifier + }), + ...(input.SelectedOutputs !== undefined && { + selectedOutputs: serializeAws_restJson1_1__listOf__stringMin1( + input.SelectedOutputs, + context + ) + }) + }; }; const serializeAws_restJson1_1CmafEncryptionSettings = ( input: CmafEncryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConstantInitializationVector !== undefined) { - bodyParams["constantInitializationVector"] = - input.ConstantInitializationVector; - } - if (input.EncryptionMethod !== undefined) { - bodyParams["encryptionMethod"] = input.EncryptionMethod; - } - if (input.InitializationVectorInManifest !== undefined) { - bodyParams["initializationVectorInManifest"] = - input.InitializationVectorInManifest; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams[ - "spekeKeyProvider" - ] = serializeAws_restJson1_1SpekeKeyProviderCmaf( - input.SpekeKeyProvider, - context - ); - } - if (input.StaticKeyProvider !== undefined) { - bodyParams["staticKeyProvider"] = serializeAws_restJson1_1StaticKeyProvider( - input.StaticKeyProvider, - context - ); - } - if (input.Type !== undefined) { - bodyParams["type"] = input.Type; - } - return bodyParams; + return { + ...(input.ConstantInitializationVector !== undefined && { + constantInitializationVector: input.ConstantInitializationVector + }), + ...(input.EncryptionMethod !== undefined && { + encryptionMethod: input.EncryptionMethod + }), + ...(input.InitializationVectorInManifest !== undefined && { + initializationVectorInManifest: input.InitializationVectorInManifest + }), + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProviderCmaf( + input.SpekeKeyProvider, + context + ) + }), + ...(input.StaticKeyProvider !== undefined && { + staticKeyProvider: serializeAws_restJson1_1StaticKeyProvider( + input.StaticKeyProvider, + context + ) + }), + ...(input.Type !== undefined && { type: input.Type }) + }; }; const serializeAws_restJson1_1CmafGroupSettings = ( input: CmafGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalManifests !== undefined) { - bodyParams[ - "additionalManifests" - ] = serializeAws_restJson1_1__listOfCmafAdditionalManifest( - input.AdditionalManifests, - context - ); - } - if (input.BaseUrl !== undefined) { - bodyParams["baseUrl"] = input.BaseUrl; - } - if (input.ClientCache !== undefined) { - bodyParams["clientCache"] = input.ClientCache; - } - if (input.CodecSpecification !== undefined) { - bodyParams["codecSpecification"] = input.CodecSpecification; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = input.Destination; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1DestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1CmafEncryptionSettings( - input.Encryption, - context - ); - } - if (input.FragmentLength !== undefined) { - bodyParams["fragmentLength"] = input.FragmentLength; - } - if (input.ManifestCompression !== undefined) { - bodyParams["manifestCompression"] = input.ManifestCompression; - } - if (input.ManifestDurationFormat !== undefined) { - bodyParams["manifestDurationFormat"] = input.ManifestDurationFormat; - } - if (input.MinBufferTime !== undefined) { - bodyParams["minBufferTime"] = input.MinBufferTime; - } - if (input.MinFinalSegmentLength !== undefined) { - bodyParams["minFinalSegmentLength"] = input.MinFinalSegmentLength; - } - if (input.MpdProfile !== undefined) { - bodyParams["mpdProfile"] = input.MpdProfile; - } - if (input.SegmentControl !== undefined) { - bodyParams["segmentControl"] = input.SegmentControl; - } - if (input.SegmentLength !== undefined) { - bodyParams["segmentLength"] = input.SegmentLength; - } - if (input.StreamInfResolution !== undefined) { - bodyParams["streamInfResolution"] = input.StreamInfResolution; - } - if (input.WriteDashManifest !== undefined) { - bodyParams["writeDashManifest"] = input.WriteDashManifest; - } - if (input.WriteHlsManifest !== undefined) { - bodyParams["writeHlsManifest"] = input.WriteHlsManifest; - } - if (input.WriteSegmentTimelineInRepresentation !== undefined) { - bodyParams["writeSegmentTimelineInRepresentation"] = - input.WriteSegmentTimelineInRepresentation; - } - return bodyParams; + return { + ...(input.AdditionalManifests !== undefined && { + additionalManifests: serializeAws_restJson1_1__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_restJson1_1DestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1CmafEncryptionSettings( + 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 + }) + }; }; const serializeAws_restJson1_1CmfcSettings = ( input: CmfcSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Scte35Esam !== undefined) { - bodyParams["scte35Esam"] = input.Scte35Esam; - } - if (input.Scte35Source !== undefined) { - bodyParams["scte35Source"] = input.Scte35Source; - } - return bodyParams; + return { + ...(input.Scte35Esam !== undefined && { scte35Esam: input.Scte35Esam }), + ...(input.Scte35Source !== undefined && { + scte35Source: input.Scte35Source + }) + }; }; const serializeAws_restJson1_1ColorCorrector = ( input: ColorCorrector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Brightness !== undefined) { - bodyParams["brightness"] = input.Brightness; - } - if (input.ColorSpaceConversion !== undefined) { - bodyParams["colorSpaceConversion"] = input.ColorSpaceConversion; - } - if (input.Contrast !== undefined) { - bodyParams["contrast"] = input.Contrast; - } - if (input.Hdr10Metadata !== undefined) { - bodyParams["hdr10Metadata"] = serializeAws_restJson1_1Hdr10Metadata( - input.Hdr10Metadata, - context - ); - } - if (input.Hue !== undefined) { - bodyParams["hue"] = input.Hue; - } - if (input.Saturation !== undefined) { - bodyParams["saturation"] = input.Saturation; - } - return bodyParams; + return { + ...(input.Brightness !== undefined && { brightness: input.Brightness }), + ...(input.ColorSpaceConversion !== undefined && { + colorSpaceConversion: input.ColorSpaceConversion + }), + ...(input.Contrast !== undefined && { contrast: input.Contrast }), + ...(input.Hdr10Metadata !== undefined && { + hdr10Metadata: serializeAws_restJson1_1Hdr10Metadata( + input.Hdr10Metadata, + context + ) + }), + ...(input.Hue !== undefined && { hue: input.Hue }), + ...(input.Saturation !== undefined && { saturation: input.Saturation }) + }; }; const serializeAws_restJson1_1ContainerSettings = ( input: ContainerSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CmfcSettings !== undefined) { - bodyParams["cmfcSettings"] = serializeAws_restJson1_1CmfcSettings( - input.CmfcSettings, - context - ); - } - if (input.Container !== undefined) { - bodyParams["container"] = input.Container; - } - if (input.F4vSettings !== undefined) { - bodyParams["f4vSettings"] = serializeAws_restJson1_1F4vSettings( - input.F4vSettings, - context - ); - } - if (input.M2tsSettings !== undefined) { - bodyParams["m2tsSettings"] = serializeAws_restJson1_1M2tsSettings( - input.M2tsSettings, - context - ); - } - if (input.M3u8Settings !== undefined) { - bodyParams["m3u8Settings"] = serializeAws_restJson1_1M3u8Settings( - input.M3u8Settings, - context - ); - } - if (input.MovSettings !== undefined) { - bodyParams["movSettings"] = serializeAws_restJson1_1MovSettings( - input.MovSettings, - context - ); - } - if (input.Mp4Settings !== undefined) { - bodyParams["mp4Settings"] = serializeAws_restJson1_1Mp4Settings( - input.Mp4Settings, - context - ); - } - if (input.MpdSettings !== undefined) { - bodyParams["mpdSettings"] = serializeAws_restJson1_1MpdSettings( - input.MpdSettings, - context - ); - } - return bodyParams; + return { + ...(input.CmfcSettings !== undefined && { + cmfcSettings: serializeAws_restJson1_1CmfcSettings( + input.CmfcSettings, + context + ) + }), + ...(input.Container !== undefined && { container: input.Container }), + ...(input.F4vSettings !== undefined && { + f4vSettings: serializeAws_restJson1_1F4vSettings( + input.F4vSettings, + context + ) + }), + ...(input.M2tsSettings !== undefined && { + m2tsSettings: serializeAws_restJson1_1M2tsSettings( + input.M2tsSettings, + context + ) + }), + ...(input.M3u8Settings !== undefined && { + m3u8Settings: serializeAws_restJson1_1M3u8Settings( + input.M3u8Settings, + context + ) + }), + ...(input.MovSettings !== undefined && { + movSettings: serializeAws_restJson1_1MovSettings( + input.MovSettings, + context + ) + }), + ...(input.Mp4Settings !== undefined && { + mp4Settings: serializeAws_restJson1_1Mp4Settings( + input.Mp4Settings, + context + ) + }), + ...(input.MpdSettings !== undefined && { + mpdSettings: serializeAws_restJson1_1MpdSettings( + input.MpdSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1DashAdditionalManifest = ( input: DashAdditionalManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestNameModifier !== undefined) { - bodyParams["manifestNameModifier"] = input.ManifestNameModifier; - } - if (input.SelectedOutputs !== undefined) { - bodyParams[ - "selectedOutputs" - ] = serializeAws_restJson1_1__listOf__stringMin1( - input.SelectedOutputs, - context - ); - } - return bodyParams; + return { + ...(input.ManifestNameModifier !== undefined && { + manifestNameModifier: input.ManifestNameModifier + }), + ...(input.SelectedOutputs !== undefined && { + selectedOutputs: serializeAws_restJson1_1__listOf__stringMin1( + input.SelectedOutputs, + context + ) + }) + }; }; const serializeAws_restJson1_1DashIsoEncryptionSettings = ( input: DashIsoEncryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PlaybackDeviceCompatibility !== undefined) { - bodyParams["playbackDeviceCompatibility"] = - input.PlaybackDeviceCompatibility; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.PlaybackDeviceCompatibility !== undefined && { + playbackDeviceCompatibility: input.PlaybackDeviceCompatibility + }), + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1DashIsoGroupSettings = ( input: DashIsoGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalManifests !== undefined) { - bodyParams[ - "additionalManifests" - ] = serializeAws_restJson1_1__listOfDashAdditionalManifest( - input.AdditionalManifests, - context - ); - } - if (input.BaseUrl !== undefined) { - bodyParams["baseUrl"] = input.BaseUrl; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = input.Destination; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1DestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams[ - "encryption" - ] = serializeAws_restJson1_1DashIsoEncryptionSettings( - input.Encryption, - context - ); - } - if (input.FragmentLength !== undefined) { - bodyParams["fragmentLength"] = input.FragmentLength; - } - if (input.HbbtvCompliance !== undefined) { - bodyParams["hbbtvCompliance"] = input.HbbtvCompliance; - } - if (input.MinBufferTime !== undefined) { - bodyParams["minBufferTime"] = input.MinBufferTime; - } - if (input.MpdProfile !== undefined) { - bodyParams["mpdProfile"] = input.MpdProfile; - } - if (input.SegmentControl !== undefined) { - bodyParams["segmentControl"] = input.SegmentControl; - } - if (input.SegmentLength !== undefined) { - bodyParams["segmentLength"] = input.SegmentLength; - } - if (input.WriteSegmentTimelineInRepresentation !== undefined) { - bodyParams["writeSegmentTimelineInRepresentation"] = - input.WriteSegmentTimelineInRepresentation; - } - return bodyParams; + return { + ...(input.AdditionalManifests !== undefined && { + additionalManifests: serializeAws_restJson1_1__listOfDashAdditionalManifest( + input.AdditionalManifests, + context + ) + }), + ...(input.BaseUrl !== undefined && { baseUrl: input.BaseUrl }), + ...(input.Destination !== undefined && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && { + destinationSettings: serializeAws_restJson1_1DestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1DashIsoEncryptionSettings( + input.Encryption, + context + ) + }), + ...(input.FragmentLength !== undefined && { + fragmentLength: input.FragmentLength + }), + ...(input.HbbtvCompliance !== undefined && { + hbbtvCompliance: input.HbbtvCompliance + }), + ...(input.MinBufferTime !== undefined && { + minBufferTime: input.MinBufferTime + }), + ...(input.MpdProfile !== undefined && { mpdProfile: input.MpdProfile }), + ...(input.SegmentControl !== undefined && { + segmentControl: input.SegmentControl + }), + ...(input.SegmentLength !== undefined && { + segmentLength: input.SegmentLength + }), + ...(input.WriteSegmentTimelineInRepresentation !== undefined && { + writeSegmentTimelineInRepresentation: + input.WriteSegmentTimelineInRepresentation + }) + }; }; const serializeAws_restJson1_1Deinterlacer = ( input: Deinterlacer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Algorithm !== undefined) { - bodyParams["algorithm"] = input.Algorithm; - } - if (input.Control !== undefined) { - bodyParams["control"] = input.Control; - } - if (input.Mode !== undefined) { - bodyParams["mode"] = input.Mode; - } - return bodyParams; + return { + ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), + ...(input.Control !== undefined && { control: input.Control }), + ...(input.Mode !== undefined && { mode: input.Mode }) + }; }; const serializeAws_restJson1_1DestinationSettings = ( input: DestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Settings !== undefined) { - bodyParams["s3Settings"] = serializeAws_restJson1_1S3DestinationSettings( - input.S3Settings, - context - ); - } - return bodyParams; + return { + ...(input.S3Settings !== undefined && { + s3Settings: serializeAws_restJson1_1S3DestinationSettings( + input.S3Settings, + context + ) + }) + }; }; const serializeAws_restJson1_1DolbyVision = ( input: DolbyVision, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.L6Metadata !== undefined) { - bodyParams[ - "l6Metadata" - ] = serializeAws_restJson1_1DolbyVisionLevel6Metadata( - input.L6Metadata, - context - ); - } - if (input.L6Mode !== undefined) { - bodyParams["l6Mode"] = input.L6Mode; - } - if (input.Profile !== undefined) { - bodyParams["profile"] = input.Profile; - } - return bodyParams; + return { + ...(input.L6Metadata !== undefined && { + l6Metadata: serializeAws_restJson1_1DolbyVisionLevel6Metadata( + input.L6Metadata, + context + ) + }), + ...(input.L6Mode !== undefined && { l6Mode: input.L6Mode }), + ...(input.Profile !== undefined && { profile: input.Profile }) + }; }; const serializeAws_restJson1_1DolbyVisionLevel6Metadata = ( input: DolbyVisionLevel6Metadata, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxCll !== undefined) { - bodyParams["maxCll"] = input.MaxCll; - } - if (input.MaxFall !== undefined) { - bodyParams["maxFall"] = input.MaxFall; - } - return bodyParams; + return { + ...(input.MaxCll !== undefined && { maxCll: input.MaxCll }), + ...(input.MaxFall !== undefined && { maxFall: input.MaxFall }) + }; }; const serializeAws_restJson1_1DvbNitSettings = ( input: DvbNitSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NetworkId !== undefined) { - bodyParams["networkId"] = input.NetworkId; - } - if (input.NetworkName !== undefined) { - bodyParams["networkName"] = input.NetworkName; - } - if (input.NitInterval !== undefined) { - bodyParams["nitInterval"] = input.NitInterval; - } - return bodyParams; + return { + ...(input.NetworkId !== undefined && { networkId: input.NetworkId }), + ...(input.NetworkName !== undefined && { networkName: input.NetworkName }), + ...(input.NitInterval !== undefined && { nitInterval: input.NitInterval }) + }; }; const serializeAws_restJson1_1DvbSdtSettings = ( input: DvbSdtSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputSdt !== undefined) { - bodyParams["outputSdt"] = input.OutputSdt; - } - if (input.SdtInterval !== undefined) { - bodyParams["sdtInterval"] = input.SdtInterval; - } - if (input.ServiceName !== undefined) { - bodyParams["serviceName"] = input.ServiceName; - } - if (input.ServiceProviderName !== undefined) { - bodyParams["serviceProviderName"] = input.ServiceProviderName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1DvbSubDestinationSettings = ( input: DvbSubDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alignment !== undefined) { - bodyParams["alignment"] = input.Alignment; - } - if (input.BackgroundColor !== undefined) { - bodyParams["backgroundColor"] = input.BackgroundColor; - } - if (input.BackgroundOpacity !== undefined) { - bodyParams["backgroundOpacity"] = input.BackgroundOpacity; - } - if (input.FontColor !== undefined) { - bodyParams["fontColor"] = input.FontColor; - } - if (input.FontOpacity !== undefined) { - bodyParams["fontOpacity"] = input.FontOpacity; - } - if (input.FontResolution !== undefined) { - bodyParams["fontResolution"] = input.FontResolution; - } - if (input.FontScript !== undefined) { - bodyParams["fontScript"] = input.FontScript; - } - if (input.FontSize !== undefined) { - bodyParams["fontSize"] = input.FontSize; - } - if (input.OutlineColor !== undefined) { - bodyParams["outlineColor"] = input.OutlineColor; - } - if (input.OutlineSize !== undefined) { - bodyParams["outlineSize"] = input.OutlineSize; - } - if (input.ShadowColor !== undefined) { - bodyParams["shadowColor"] = input.ShadowColor; - } - if (input.ShadowOpacity !== undefined) { - bodyParams["shadowOpacity"] = input.ShadowOpacity; - } - if (input.ShadowXOffset !== undefined) { - bodyParams["shadowXOffset"] = input.ShadowXOffset; - } - if (input.ShadowYOffset !== undefined) { - bodyParams["shadowYOffset"] = input.ShadowYOffset; - } - if (input.SubtitlingType !== undefined) { - bodyParams["subtitlingType"] = input.SubtitlingType; - } - if (input.TeletextSpacing !== undefined) { - bodyParams["teletextSpacing"] = input.TeletextSpacing; - } - if (input.XPosition !== undefined) { - bodyParams["xPosition"] = input.XPosition; - } - if (input.YPosition !== undefined) { - bodyParams["yPosition"] = input.YPosition; - } - return bodyParams; -}; - + 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 }) + }; +}; + const serializeAws_restJson1_1DvbSubSourceSettings = ( input: DvbSubSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pid !== undefined) { - bodyParams["pid"] = input.Pid; - } - return bodyParams; + return { + ...(input.Pid !== undefined && { pid: input.Pid }) + }; }; const serializeAws_restJson1_1DvbTdtSettings = ( input: DvbTdtSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TdtInterval !== undefined) { - bodyParams["tdtInterval"] = input.TdtInterval; - } - return bodyParams; + return { + ...(input.TdtInterval !== undefined && { tdtInterval: input.TdtInterval }) + }; }; const serializeAws_restJson1_1Eac3AtmosSettings = ( input: Eac3AtmosSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BitstreamMode !== undefined) { - bodyParams["bitstreamMode"] = input.BitstreamMode; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.DialogueIntelligence !== undefined) { - bodyParams["dialogueIntelligence"] = input.DialogueIntelligence; - } - if (input.DynamicRangeCompressionLine !== undefined) { - bodyParams["dynamicRangeCompressionLine"] = - input.DynamicRangeCompressionLine; - } - if (input.DynamicRangeCompressionRf !== undefined) { - bodyParams["dynamicRangeCompressionRf"] = input.DynamicRangeCompressionRf; - } - if (input.LoRoCenterMixLevel !== undefined) { - bodyParams["loRoCenterMixLevel"] = input.LoRoCenterMixLevel; - } - if (input.LoRoSurroundMixLevel !== undefined) { - bodyParams["loRoSurroundMixLevel"] = input.LoRoSurroundMixLevel; - } - if (input.LtRtCenterMixLevel !== undefined) { - bodyParams["ltRtCenterMixLevel"] = input.LtRtCenterMixLevel; - } - if (input.LtRtSurroundMixLevel !== undefined) { - bodyParams["ltRtSurroundMixLevel"] = input.LtRtSurroundMixLevel; - } - if (input.MeteringMode !== undefined) { - bodyParams["meteringMode"] = input.MeteringMode; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - if (input.SpeechThreshold !== undefined) { - bodyParams["speechThreshold"] = input.SpeechThreshold; - } - if (input.StereoDownmix !== undefined) { - bodyParams["stereoDownmix"] = input.StereoDownmix; - } - if (input.SurroundExMode !== undefined) { - bodyParams["surroundExMode"] = input.SurroundExMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1Eac3Settings = ( input: Eac3Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttenuationControl !== undefined) { - bodyParams["attenuationControl"] = input.AttenuationControl; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BitstreamMode !== undefined) { - bodyParams["bitstreamMode"] = input.BitstreamMode; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.DcFilter !== undefined) { - bodyParams["dcFilter"] = input.DcFilter; - } - if (input.Dialnorm !== undefined) { - bodyParams["dialnorm"] = input.Dialnorm; - } - if (input.DynamicRangeCompressionLine !== undefined) { - bodyParams["dynamicRangeCompressionLine"] = - input.DynamicRangeCompressionLine; - } - if (input.DynamicRangeCompressionRf !== undefined) { - bodyParams["dynamicRangeCompressionRf"] = input.DynamicRangeCompressionRf; - } - if (input.LfeControl !== undefined) { - bodyParams["lfeControl"] = input.LfeControl; - } - if (input.LfeFilter !== undefined) { - bodyParams["lfeFilter"] = input.LfeFilter; - } - if (input.LoRoCenterMixLevel !== undefined) { - bodyParams["loRoCenterMixLevel"] = input.LoRoCenterMixLevel; - } - if (input.LoRoSurroundMixLevel !== undefined) { - bodyParams["loRoSurroundMixLevel"] = input.LoRoSurroundMixLevel; - } - if (input.LtRtCenterMixLevel !== undefined) { - bodyParams["ltRtCenterMixLevel"] = input.LtRtCenterMixLevel; - } - if (input.LtRtSurroundMixLevel !== undefined) { - bodyParams["ltRtSurroundMixLevel"] = input.LtRtSurroundMixLevel; - } - if (input.MetadataControl !== undefined) { - bodyParams["metadataControl"] = input.MetadataControl; - } - if (input.PassthroughControl !== undefined) { - bodyParams["passthroughControl"] = input.PassthroughControl; - } - if (input.PhaseControl !== undefined) { - bodyParams["phaseControl"] = input.PhaseControl; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - if (input.StereoDownmix !== undefined) { - bodyParams["stereoDownmix"] = input.StereoDownmix; - } - if (input.SurroundExMode !== undefined) { - bodyParams["surroundExMode"] = input.SurroundExMode; - } - if (input.SurroundMode !== undefined) { - bodyParams["surroundMode"] = input.SurroundMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1EmbeddedDestinationSettings = ( input: EmbeddedDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination608ChannelNumber !== undefined) { - bodyParams["destination608ChannelNumber"] = - input.Destination608ChannelNumber; - } - if (input.Destination708ServiceNumber !== undefined) { - bodyParams["destination708ServiceNumber"] = - input.Destination708ServiceNumber; - } - return bodyParams; + return { + ...(input.Destination608ChannelNumber !== undefined && { + destination608ChannelNumber: input.Destination608ChannelNumber + }), + ...(input.Destination708ServiceNumber !== undefined && { + destination708ServiceNumber: input.Destination708ServiceNumber + }) + }; }; const serializeAws_restJson1_1EmbeddedSourceSettings = ( input: EmbeddedSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Convert608To708 !== undefined) { - bodyParams["convert608To708"] = input.Convert608To708; - } - if (input.Source608ChannelNumber !== undefined) { - bodyParams["source608ChannelNumber"] = input.Source608ChannelNumber; - } - if (input.Source608TrackNumber !== undefined) { - bodyParams["source608TrackNumber"] = input.Source608TrackNumber; - } - if (input.TerminateCaptions !== undefined) { - bodyParams["terminateCaptions"] = input.TerminateCaptions; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1EsamManifestConfirmConditionNotification = ( input: EsamManifestConfirmConditionNotification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MccXml !== undefined) { - bodyParams["mccXml"] = input.MccXml; - } - return bodyParams; + return { + ...(input.MccXml !== undefined && { mccXml: input.MccXml }) + }; }; const serializeAws_restJson1_1EsamSettings = ( input: EsamSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestConfirmConditionNotification !== undefined) { - bodyParams[ - "manifestConfirmConditionNotification" - ] = serializeAws_restJson1_1EsamManifestConfirmConditionNotification( - input.ManifestConfirmConditionNotification, - context - ); - } - if (input.ResponseSignalPreroll !== undefined) { - bodyParams["responseSignalPreroll"] = input.ResponseSignalPreroll; - } - if (input.SignalProcessingNotification !== undefined) { - bodyParams[ - "signalProcessingNotification" - ] = serializeAws_restJson1_1EsamSignalProcessingNotification( - input.SignalProcessingNotification, - context - ); - } - return bodyParams; + return { + ...(input.ManifestConfirmConditionNotification !== undefined && { + manifestConfirmConditionNotification: serializeAws_restJson1_1EsamManifestConfirmConditionNotification( + input.ManifestConfirmConditionNotification, + context + ) + }), + ...(input.ResponseSignalPreroll !== undefined && { + responseSignalPreroll: input.ResponseSignalPreroll + }), + ...(input.SignalProcessingNotification !== undefined && { + signalProcessingNotification: serializeAws_restJson1_1EsamSignalProcessingNotification( + input.SignalProcessingNotification, + context + ) + }) + }; }; const serializeAws_restJson1_1EsamSignalProcessingNotification = ( input: EsamSignalProcessingNotification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SccXml !== undefined) { - bodyParams["sccXml"] = input.SccXml; - } - return bodyParams; + return { + ...(input.SccXml !== undefined && { sccXml: input.SccXml }) + }; }; const serializeAws_restJson1_1F4vSettings = ( input: F4vSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MoovPlacement !== undefined) { - bodyParams["moovPlacement"] = input.MoovPlacement; - } - return bodyParams; + return { + ...(input.MoovPlacement !== undefined && { + moovPlacement: input.MoovPlacement + }) + }; }; const serializeAws_restJson1_1FileGroupSettings = ( input: FileGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["destination"] = input.Destination; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1DestinationSettings( - input.DestinationSettings, - context - ); - } - return bodyParams; + return { + ...(input.Destination !== undefined && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && { + destinationSettings: serializeAws_restJson1_1DestinationSettings( + input.DestinationSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1FileSourceSettings = ( input: FileSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Convert608To708 !== undefined) { - bodyParams["convert608To708"] = input.Convert608To708; - } - if (input.SourceFile !== undefined) { - bodyParams["sourceFile"] = input.SourceFile; - } - if (input.TimeDelta !== undefined) { - bodyParams["timeDelta"] = input.TimeDelta; - } - return bodyParams; + return { + ...(input.Convert608To708 !== undefined && { + convert608To708: input.Convert608To708 + }), + ...(input.SourceFile !== undefined && { sourceFile: input.SourceFile }), + ...(input.TimeDelta !== undefined && { timeDelta: input.TimeDelta }) + }; }; const serializeAws_restJson1_1FrameCaptureSettings = ( input: FrameCaptureSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.MaxCaptures !== undefined) { - bodyParams["maxCaptures"] = input.MaxCaptures; - } - if (input.Quality !== undefined) { - bodyParams["quality"] = input.Quality; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1H264QvbrSettings = ( input: H264QvbrSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxAverageBitrate !== undefined) { - bodyParams["maxAverageBitrate"] = input.MaxAverageBitrate; - } - if (input.QvbrQualityLevel !== undefined) { - bodyParams["qvbrQualityLevel"] = input.QvbrQualityLevel; - } - return bodyParams; + return { + ...(input.MaxAverageBitrate !== undefined && { + maxAverageBitrate: input.MaxAverageBitrate + }), + ...(input.QvbrQualityLevel !== undefined && { + qvbrQualityLevel: input.QvbrQualityLevel + }) + }; }; const serializeAws_restJson1_1H264Settings = ( input: H264Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdaptiveQuantization !== undefined) { - bodyParams["adaptiveQuantization"] = input.AdaptiveQuantization; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.CodecLevel !== undefined) { - bodyParams["codecLevel"] = input.CodecLevel; - } - if (input.CodecProfile !== undefined) { - bodyParams["codecProfile"] = input.CodecProfile; - } - if (input.DynamicSubGop !== undefined) { - bodyParams["dynamicSubGop"] = input.DynamicSubGop; - } - if (input.EntropyEncoding !== undefined) { - bodyParams["entropyEncoding"] = input.EntropyEncoding; - } - if (input.FieldEncoding !== undefined) { - bodyParams["fieldEncoding"] = input.FieldEncoding; - } - if (input.FlickerAdaptiveQuantization !== undefined) { - bodyParams["flickerAdaptiveQuantization"] = - input.FlickerAdaptiveQuantization; - } - if (input.FramerateControl !== undefined) { - bodyParams["framerateControl"] = input.FramerateControl; - } - if (input.FramerateConversionAlgorithm !== undefined) { - bodyParams["framerateConversionAlgorithm"] = - input.FramerateConversionAlgorithm; - } - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.GopBReference !== undefined) { - bodyParams["gopBReference"] = input.GopBReference; - } - if (input.GopClosedCadence !== undefined) { - bodyParams["gopClosedCadence"] = input.GopClosedCadence; - } - if (input.GopSize !== undefined) { - bodyParams["gopSize"] = input.GopSize; - } - if (input.GopSizeUnits !== undefined) { - bodyParams["gopSizeUnits"] = input.GopSizeUnits; - } - if (input.HrdBufferInitialFillPercentage !== undefined) { - bodyParams["hrdBufferInitialFillPercentage"] = - input.HrdBufferInitialFillPercentage; - } - if (input.HrdBufferSize !== undefined) { - bodyParams["hrdBufferSize"] = input.HrdBufferSize; - } - if (input.InterlaceMode !== undefined) { - bodyParams["interlaceMode"] = input.InterlaceMode; - } - if (input.MaxBitrate !== undefined) { - bodyParams["maxBitrate"] = input.MaxBitrate; - } - if (input.MinIInterval !== undefined) { - bodyParams["minIInterval"] = input.MinIInterval; - } - if (input.NumberBFramesBetweenReferenceFrames !== undefined) { - bodyParams["numberBFramesBetweenReferenceFrames"] = - input.NumberBFramesBetweenReferenceFrames; - } - if (input.NumberReferenceFrames !== undefined) { - bodyParams["numberReferenceFrames"] = input.NumberReferenceFrames; - } - if (input.ParControl !== undefined) { - bodyParams["parControl"] = input.ParControl; - } - if (input.ParDenominator !== undefined) { - bodyParams["parDenominator"] = input.ParDenominator; - } - if (input.ParNumerator !== undefined) { - bodyParams["parNumerator"] = input.ParNumerator; - } - if (input.QualityTuningLevel !== undefined) { - bodyParams["qualityTuningLevel"] = input.QualityTuningLevel; - } - if (input.QvbrSettings !== undefined) { - bodyParams["qvbrSettings"] = serializeAws_restJson1_1H264QvbrSettings( - input.QvbrSettings, - context - ); - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.RepeatPps !== undefined) { - bodyParams["repeatPps"] = input.RepeatPps; - } - if (input.SceneChangeDetect !== undefined) { - bodyParams["sceneChangeDetect"] = input.SceneChangeDetect; - } - if (input.Slices !== undefined) { - bodyParams["slices"] = input.Slices; - } - if (input.SlowPal !== undefined) { - bodyParams["slowPal"] = input.SlowPal; - } - if (input.Softness !== undefined) { - bodyParams["softness"] = input.Softness; - } - if (input.SpatialAdaptiveQuantization !== undefined) { - bodyParams["spatialAdaptiveQuantization"] = - input.SpatialAdaptiveQuantization; - } - if (input.Syntax !== undefined) { - bodyParams["syntax"] = input.Syntax; - } - if (input.Telecine !== undefined) { - bodyParams["telecine"] = input.Telecine; - } - if (input.TemporalAdaptiveQuantization !== undefined) { - bodyParams["temporalAdaptiveQuantization"] = - input.TemporalAdaptiveQuantization; - } - if (input.UnregisteredSeiTimecode !== undefined) { - bodyParams["unregisteredSeiTimecode"] = input.UnregisteredSeiTimecode; - } - return bodyParams; + 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_restJson1_1H264QvbrSettings( + 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 + }) + }; }; const serializeAws_restJson1_1H265QvbrSettings = ( input: H265QvbrSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxAverageBitrate !== undefined) { - bodyParams["maxAverageBitrate"] = input.MaxAverageBitrate; - } - if (input.QvbrQualityLevel !== undefined) { - bodyParams["qvbrQualityLevel"] = input.QvbrQualityLevel; - } - return bodyParams; + return { + ...(input.MaxAverageBitrate !== undefined && { + maxAverageBitrate: input.MaxAverageBitrate + }), + ...(input.QvbrQualityLevel !== undefined && { + qvbrQualityLevel: input.QvbrQualityLevel + }) + }; }; const serializeAws_restJson1_1H265Settings = ( input: H265Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdaptiveQuantization !== undefined) { - bodyParams["adaptiveQuantization"] = input.AdaptiveQuantization; - } - if (input.AlternateTransferFunctionSei !== undefined) { - bodyParams["alternateTransferFunctionSei"] = - input.AlternateTransferFunctionSei; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.CodecLevel !== undefined) { - bodyParams["codecLevel"] = input.CodecLevel; - } - if (input.CodecProfile !== undefined) { - bodyParams["codecProfile"] = input.CodecProfile; - } - if (input.DynamicSubGop !== undefined) { - bodyParams["dynamicSubGop"] = input.DynamicSubGop; - } - if (input.FlickerAdaptiveQuantization !== undefined) { - bodyParams["flickerAdaptiveQuantization"] = - input.FlickerAdaptiveQuantization; - } - if (input.FramerateControl !== undefined) { - bodyParams["framerateControl"] = input.FramerateControl; - } - if (input.FramerateConversionAlgorithm !== undefined) { - bodyParams["framerateConversionAlgorithm"] = - input.FramerateConversionAlgorithm; - } - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.GopBReference !== undefined) { - bodyParams["gopBReference"] = input.GopBReference; - } - if (input.GopClosedCadence !== undefined) { - bodyParams["gopClosedCadence"] = input.GopClosedCadence; - } - if (input.GopSize !== undefined) { - bodyParams["gopSize"] = input.GopSize; - } - if (input.GopSizeUnits !== undefined) { - bodyParams["gopSizeUnits"] = input.GopSizeUnits; - } - if (input.HrdBufferInitialFillPercentage !== undefined) { - bodyParams["hrdBufferInitialFillPercentage"] = - input.HrdBufferInitialFillPercentage; - } - if (input.HrdBufferSize !== undefined) { - bodyParams["hrdBufferSize"] = input.HrdBufferSize; - } - if (input.InterlaceMode !== undefined) { - bodyParams["interlaceMode"] = input.InterlaceMode; - } - if (input.MaxBitrate !== undefined) { - bodyParams["maxBitrate"] = input.MaxBitrate; - } - if (input.MinIInterval !== undefined) { - bodyParams["minIInterval"] = input.MinIInterval; - } - if (input.NumberBFramesBetweenReferenceFrames !== undefined) { - bodyParams["numberBFramesBetweenReferenceFrames"] = - input.NumberBFramesBetweenReferenceFrames; - } - if (input.NumberReferenceFrames !== undefined) { - bodyParams["numberReferenceFrames"] = input.NumberReferenceFrames; - } - if (input.ParControl !== undefined) { - bodyParams["parControl"] = input.ParControl; - } - if (input.ParDenominator !== undefined) { - bodyParams["parDenominator"] = input.ParDenominator; - } - if (input.ParNumerator !== undefined) { - bodyParams["parNumerator"] = input.ParNumerator; - } - if (input.QualityTuningLevel !== undefined) { - bodyParams["qualityTuningLevel"] = input.QualityTuningLevel; - } - if (input.QvbrSettings !== undefined) { - bodyParams["qvbrSettings"] = serializeAws_restJson1_1H265QvbrSettings( - input.QvbrSettings, - context - ); - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.SampleAdaptiveOffsetFilterMode !== undefined) { - bodyParams["sampleAdaptiveOffsetFilterMode"] = - input.SampleAdaptiveOffsetFilterMode; - } - if (input.SceneChangeDetect !== undefined) { - bodyParams["sceneChangeDetect"] = input.SceneChangeDetect; - } - if (input.Slices !== undefined) { - bodyParams["slices"] = input.Slices; - } - if (input.SlowPal !== undefined) { - bodyParams["slowPal"] = input.SlowPal; - } - if (input.SpatialAdaptiveQuantization !== undefined) { - bodyParams["spatialAdaptiveQuantization"] = - input.SpatialAdaptiveQuantization; - } - if (input.Telecine !== undefined) { - bodyParams["telecine"] = input.Telecine; - } - if (input.TemporalAdaptiveQuantization !== undefined) { - bodyParams["temporalAdaptiveQuantization"] = - input.TemporalAdaptiveQuantization; - } - if (input.TemporalIds !== undefined) { - bodyParams["temporalIds"] = input.TemporalIds; - } - if (input.Tiles !== undefined) { - bodyParams["tiles"] = input.Tiles; - } - if (input.UnregisteredSeiTimecode !== undefined) { - bodyParams["unregisteredSeiTimecode"] = input.UnregisteredSeiTimecode; - } - if (input.WriteMp4PackagingType !== undefined) { - bodyParams["writeMp4PackagingType"] = input.WriteMp4PackagingType; - } - return bodyParams; + 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_restJson1_1H265QvbrSettings( + 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 + }) + }; }; const serializeAws_restJson1_1Hdr10Metadata = ( input: Hdr10Metadata, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BluePrimaryX !== undefined) { - bodyParams["bluePrimaryX"] = input.BluePrimaryX; - } - if (input.BluePrimaryY !== undefined) { - bodyParams["bluePrimaryY"] = input.BluePrimaryY; - } - if (input.GreenPrimaryX !== undefined) { - bodyParams["greenPrimaryX"] = input.GreenPrimaryX; - } - if (input.GreenPrimaryY !== undefined) { - bodyParams["greenPrimaryY"] = input.GreenPrimaryY; - } - if (input.MaxContentLightLevel !== undefined) { - bodyParams["maxContentLightLevel"] = input.MaxContentLightLevel; - } - if (input.MaxFrameAverageLightLevel !== undefined) { - bodyParams["maxFrameAverageLightLevel"] = input.MaxFrameAverageLightLevel; - } - if (input.MaxLuminance !== undefined) { - bodyParams["maxLuminance"] = input.MaxLuminance; - } - if (input.MinLuminance !== undefined) { - bodyParams["minLuminance"] = input.MinLuminance; - } - if (input.RedPrimaryX !== undefined) { - bodyParams["redPrimaryX"] = input.RedPrimaryX; - } - if (input.RedPrimaryY !== undefined) { - bodyParams["redPrimaryY"] = input.RedPrimaryY; - } - if (input.WhitePointX !== undefined) { - bodyParams["whitePointX"] = input.WhitePointX; - } - if (input.WhitePointY !== undefined) { - bodyParams["whitePointY"] = input.WhitePointY; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1HlsAdditionalManifest = ( input: HlsAdditionalManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestNameModifier !== undefined) { - bodyParams["manifestNameModifier"] = input.ManifestNameModifier; - } - if (input.SelectedOutputs !== undefined) { - bodyParams[ - "selectedOutputs" - ] = serializeAws_restJson1_1__listOf__stringMin1( - input.SelectedOutputs, - context - ); - } - return bodyParams; + return { + ...(input.ManifestNameModifier !== undefined && { + manifestNameModifier: input.ManifestNameModifier + }), + ...(input.SelectedOutputs !== undefined && { + selectedOutputs: serializeAws_restJson1_1__listOf__stringMin1( + input.SelectedOutputs, + context + ) + }) + }; }; const serializeAws_restJson1_1HlsCaptionLanguageMapping = ( input: HlsCaptionLanguageMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionChannel !== undefined) { - bodyParams["captionChannel"] = input.CaptionChannel; - } - if (input.CustomLanguageCode !== undefined) { - bodyParams["customLanguageCode"] = input.CustomLanguageCode; - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageDescription !== undefined) { - bodyParams["languageDescription"] = input.LanguageDescription; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1HlsEncryptionSettings = ( input: HlsEncryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConstantInitializationVector !== undefined) { - bodyParams["constantInitializationVector"] = - input.ConstantInitializationVector; - } - if (input.EncryptionMethod !== undefined) { - bodyParams["encryptionMethod"] = input.EncryptionMethod; - } - if (input.InitializationVectorInManifest !== undefined) { - bodyParams["initializationVectorInManifest"] = - input.InitializationVectorInManifest; - } - if (input.OfflineEncrypted !== undefined) { - bodyParams["offlineEncrypted"] = input.OfflineEncrypted; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - if (input.StaticKeyProvider !== undefined) { - bodyParams["staticKeyProvider"] = serializeAws_restJson1_1StaticKeyProvider( - input.StaticKeyProvider, - context - ); - } - if (input.Type !== undefined) { - bodyParams["type"] = input.Type; - } - return bodyParams; + 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_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }), + ...(input.StaticKeyProvider !== undefined && { + staticKeyProvider: serializeAws_restJson1_1StaticKeyProvider( + input.StaticKeyProvider, + context + ) + }), + ...(input.Type !== undefined && { type: input.Type }) + }; }; const serializeAws_restJson1_1HlsGroupSettings = ( input: HlsGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdMarkers !== undefined) { - bodyParams["adMarkers"] = serializeAws_restJson1_1__listOfHlsAdMarkers( - input.AdMarkers, - context - ); - } - if (input.AdditionalManifests !== undefined) { - bodyParams[ - "additionalManifests" - ] = serializeAws_restJson1_1__listOfHlsAdditionalManifest( - input.AdditionalManifests, - context - ); - } - if (input.BaseUrl !== undefined) { - bodyParams["baseUrl"] = input.BaseUrl; - } - if (input.CaptionLanguageMappings !== undefined) { - bodyParams[ - "captionLanguageMappings" - ] = serializeAws_restJson1_1__listOfHlsCaptionLanguageMapping( - input.CaptionLanguageMappings, - context - ); - } - if (input.CaptionLanguageSetting !== undefined) { - bodyParams["captionLanguageSetting"] = input.CaptionLanguageSetting; - } - if (input.ClientCache !== undefined) { - bodyParams["clientCache"] = input.ClientCache; - } - if (input.CodecSpecification !== undefined) { - bodyParams["codecSpecification"] = input.CodecSpecification; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = input.Destination; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1DestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.DirectoryStructure !== undefined) { - bodyParams["directoryStructure"] = input.DirectoryStructure; - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1HlsEncryptionSettings( - input.Encryption, - context - ); - } - if (input.ManifestCompression !== undefined) { - bodyParams["manifestCompression"] = input.ManifestCompression; - } - if (input.ManifestDurationFormat !== undefined) { - bodyParams["manifestDurationFormat"] = input.ManifestDurationFormat; - } - if (input.MinFinalSegmentLength !== undefined) { - bodyParams["minFinalSegmentLength"] = input.MinFinalSegmentLength; - } - if (input.MinSegmentLength !== undefined) { - bodyParams["minSegmentLength"] = input.MinSegmentLength; - } - if (input.OutputSelection !== undefined) { - bodyParams["outputSelection"] = input.OutputSelection; - } - if (input.ProgramDateTime !== undefined) { - bodyParams["programDateTime"] = input.ProgramDateTime; - } - if (input.ProgramDateTimePeriod !== undefined) { - bodyParams["programDateTimePeriod"] = input.ProgramDateTimePeriod; - } - if (input.SegmentControl !== undefined) { - bodyParams["segmentControl"] = input.SegmentControl; - } - if (input.SegmentLength !== undefined) { - bodyParams["segmentLength"] = input.SegmentLength; - } - if (input.SegmentsPerSubdirectory !== undefined) { - bodyParams["segmentsPerSubdirectory"] = input.SegmentsPerSubdirectory; - } - if (input.StreamInfResolution !== undefined) { - bodyParams["streamInfResolution"] = input.StreamInfResolution; - } - if (input.TimedMetadataId3Frame !== undefined) { - bodyParams["timedMetadataId3Frame"] = input.TimedMetadataId3Frame; - } - if (input.TimedMetadataId3Period !== undefined) { - bodyParams["timedMetadataId3Period"] = input.TimedMetadataId3Period; - } - if (input.TimestampDeltaMilliseconds !== undefined) { - bodyParams["timestampDeltaMilliseconds"] = input.TimestampDeltaMilliseconds; - } - return bodyParams; + return { + ...(input.AdMarkers !== undefined && { + adMarkers: serializeAws_restJson1_1__listOfHlsAdMarkers( + input.AdMarkers, + context + ) + }), + ...(input.AdditionalManifests !== undefined && { + additionalManifests: serializeAws_restJson1_1__listOfHlsAdditionalManifest( + input.AdditionalManifests, + context + ) + }), + ...(input.BaseUrl !== undefined && { baseUrl: input.BaseUrl }), + ...(input.CaptionLanguageMappings !== undefined && { + captionLanguageMappings: serializeAws_restJson1_1__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_restJson1_1DestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.DirectoryStructure !== undefined && { + directoryStructure: input.DirectoryStructure + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1HlsEncryptionSettings( + 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 + }) + }; }; const serializeAws_restJson1_1HlsSettings = ( input: HlsSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioGroupId !== undefined) { - bodyParams["audioGroupId"] = input.AudioGroupId; - } - if (input.AudioOnlyContainer !== undefined) { - bodyParams["audioOnlyContainer"] = input.AudioOnlyContainer; - } - if (input.AudioRenditionSets !== undefined) { - bodyParams["audioRenditionSets"] = input.AudioRenditionSets; - } - if (input.AudioTrackType !== undefined) { - bodyParams["audioTrackType"] = input.AudioTrackType; - } - if (input.IFrameOnlyManifest !== undefined) { - bodyParams["iFrameOnlyManifest"] = input.IFrameOnlyManifest; - } - if (input.SegmentModifier !== undefined) { - bodyParams["segmentModifier"] = input.SegmentModifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1Id3Insertion = ( input: Id3Insertion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id3 !== undefined) { - bodyParams["id3"] = input.Id3; - } - if (input.Timecode !== undefined) { - bodyParams["timecode"] = input.Timecode; - } - return bodyParams; + return { + ...(input.Id3 !== undefined && { id3: input.Id3 }), + ...(input.Timecode !== undefined && { timecode: input.Timecode }) + }; }; const serializeAws_restJson1_1ImageInserter = ( input: ImageInserter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InsertableImages !== undefined) { - bodyParams[ - "insertableImages" - ] = serializeAws_restJson1_1__listOfInsertableImage( - input.InsertableImages, - context - ); - } - return bodyParams; + return { + ...(input.InsertableImages !== undefined && { + insertableImages: serializeAws_restJson1_1__listOfInsertableImage( + input.InsertableImages, + context + ) + }) + }; }; const serializeAws_restJson1_1ImscDestinationSettings = ( input: ImscDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StylePassthrough !== undefined) { - bodyParams["stylePassthrough"] = input.StylePassthrough; - } - return bodyParams; + return { + ...(input.StylePassthrough !== undefined && { + stylePassthrough: input.StylePassthrough + }) + }; }; const serializeAws_restJson1_1Input = ( input: Input, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioSelectorGroups !== undefined) { - bodyParams[ - "audioSelectorGroups" - ] = serializeAws_restJson1_1__mapOfAudioSelectorGroup( - input.AudioSelectorGroups, - context - ); - } - if (input.AudioSelectors !== undefined) { - bodyParams["audioSelectors"] = serializeAws_restJson1_1__mapOfAudioSelector( - input.AudioSelectors, - context - ); - } - if (input.CaptionSelectors !== undefined) { - bodyParams[ - "captionSelectors" - ] = serializeAws_restJson1_1__mapOfCaptionSelector( - input.CaptionSelectors, - context - ); - } - if (input.Crop !== undefined) { - bodyParams["crop"] = serializeAws_restJson1_1Rectangle(input.Crop, context); - } - if (input.DeblockFilter !== undefined) { - bodyParams["deblockFilter"] = input.DeblockFilter; - } - if (input.DecryptionSettings !== undefined) { - bodyParams[ - "decryptionSettings" - ] = serializeAws_restJson1_1InputDecryptionSettings( - input.DecryptionSettings, - context - ); - } - if (input.DenoiseFilter !== undefined) { - bodyParams["denoiseFilter"] = input.DenoiseFilter; - } - if (input.FileInput !== undefined) { - bodyParams["fileInput"] = input.FileInput; - } - if (input.FilterEnable !== undefined) { - bodyParams["filterEnable"] = input.FilterEnable; - } - if (input.FilterStrength !== undefined) { - bodyParams["filterStrength"] = input.FilterStrength; - } - if (input.ImageInserter !== undefined) { - bodyParams["imageInserter"] = serializeAws_restJson1_1ImageInserter( - input.ImageInserter, - context - ); - } - if (input.InputClippings !== undefined) { - bodyParams[ - "inputClippings" - ] = serializeAws_restJson1_1__listOfInputClipping( - input.InputClippings, - context - ); - } - if (input.Position !== undefined) { - bodyParams["position"] = serializeAws_restJson1_1Rectangle( - input.Position, - context - ); - } - if (input.ProgramNumber !== undefined) { - bodyParams["programNumber"] = input.ProgramNumber; - } - if (input.PsiControl !== undefined) { - bodyParams["psiControl"] = input.PsiControl; - } - if (input.SupplementalImps !== undefined) { - bodyParams[ - "supplementalImps" - ] = serializeAws_restJson1_1__listOf__stringPatternS3ASSETMAPXml( - input.SupplementalImps, - context - ); - } - if (input.TimecodeSource !== undefined) { - bodyParams["timecodeSource"] = input.TimecodeSource; - } - if (input.TimecodeStart !== undefined) { - bodyParams["timecodeStart"] = input.TimecodeStart; - } - if (input.VideoSelector !== undefined) { - bodyParams["videoSelector"] = serializeAws_restJson1_1VideoSelector( - input.VideoSelector, - context - ); - } - return bodyParams; + return { + ...(input.AudioSelectorGroups !== undefined && { + audioSelectorGroups: serializeAws_restJson1_1__mapOfAudioSelectorGroup( + input.AudioSelectorGroups, + context + ) + }), + ...(input.AudioSelectors !== undefined && { + audioSelectors: serializeAws_restJson1_1__mapOfAudioSelector( + input.AudioSelectors, + context + ) + }), + ...(input.CaptionSelectors !== undefined && { + captionSelectors: serializeAws_restJson1_1__mapOfCaptionSelector( + input.CaptionSelectors, + context + ) + }), + ...(input.Crop !== undefined && { + crop: serializeAws_restJson1_1Rectangle(input.Crop, context) + }), + ...(input.DeblockFilter !== undefined && { + deblockFilter: input.DeblockFilter + }), + ...(input.DecryptionSettings !== undefined && { + decryptionSettings: serializeAws_restJson1_1InputDecryptionSettings( + 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_restJson1_1ImageInserter( + input.ImageInserter, + context + ) + }), + ...(input.InputClippings !== undefined && { + inputClippings: serializeAws_restJson1_1__listOfInputClipping( + input.InputClippings, + context + ) + }), + ...(input.Position !== undefined && { + position: serializeAws_restJson1_1Rectangle(input.Position, context) + }), + ...(input.ProgramNumber !== undefined && { + programNumber: input.ProgramNumber + }), + ...(input.PsiControl !== undefined && { psiControl: input.PsiControl }), + ...(input.SupplementalImps !== undefined && { + supplementalImps: serializeAws_restJson1_1__listOf__stringPatternS3ASSETMAPXml( + input.SupplementalImps, + context + ) + }), + ...(input.TimecodeSource !== undefined && { + timecodeSource: input.TimecodeSource + }), + ...(input.TimecodeStart !== undefined && { + timecodeStart: input.TimecodeStart + }), + ...(input.VideoSelector !== undefined && { + videoSelector: serializeAws_restJson1_1VideoSelector( + input.VideoSelector, + context + ) + }) + }; }; const serializeAws_restJson1_1InputClipping = ( input: InputClipping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTimecode !== undefined) { - bodyParams["endTimecode"] = input.EndTimecode; - } - if (input.StartTimecode !== undefined) { - bodyParams["startTimecode"] = input.StartTimecode; - } - return bodyParams; + return { + ...(input.EndTimecode !== undefined && { endTimecode: input.EndTimecode }), + ...(input.StartTimecode !== undefined && { + startTimecode: input.StartTimecode + }) + }; }; const serializeAws_restJson1_1InputDecryptionSettings = ( input: InputDecryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DecryptionMode !== undefined) { - bodyParams["decryptionMode"] = input.DecryptionMode; - } - if (input.EncryptedDecryptionKey !== undefined) { - bodyParams["encryptedDecryptionKey"] = input.EncryptedDecryptionKey; - } - if (input.InitializationVector !== undefined) { - bodyParams["initializationVector"] = input.InitializationVector; - } - if (input.KmsKeyRegion !== undefined) { - bodyParams["kmsKeyRegion"] = input.KmsKeyRegion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1InputTemplate = ( input: InputTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioSelectorGroups !== undefined) { - bodyParams[ - "audioSelectorGroups" - ] = serializeAws_restJson1_1__mapOfAudioSelectorGroup( - input.AudioSelectorGroups, - context - ); - } - if (input.AudioSelectors !== undefined) { - bodyParams["audioSelectors"] = serializeAws_restJson1_1__mapOfAudioSelector( - input.AudioSelectors, - context - ); - } - if (input.CaptionSelectors !== undefined) { - bodyParams[ - "captionSelectors" - ] = serializeAws_restJson1_1__mapOfCaptionSelector( - input.CaptionSelectors, - context - ); - } - if (input.Crop !== undefined) { - bodyParams["crop"] = serializeAws_restJson1_1Rectangle(input.Crop, context); - } - if (input.DeblockFilter !== undefined) { - bodyParams["deblockFilter"] = input.DeblockFilter; - } - if (input.DenoiseFilter !== undefined) { - bodyParams["denoiseFilter"] = input.DenoiseFilter; - } - if (input.FilterEnable !== undefined) { - bodyParams["filterEnable"] = input.FilterEnable; - } - if (input.FilterStrength !== undefined) { - bodyParams["filterStrength"] = input.FilterStrength; - } - if (input.ImageInserter !== undefined) { - bodyParams["imageInserter"] = serializeAws_restJson1_1ImageInserter( - input.ImageInserter, - context - ); - } - if (input.InputClippings !== undefined) { - bodyParams[ - "inputClippings" - ] = serializeAws_restJson1_1__listOfInputClipping( - input.InputClippings, - context - ); - } - if (input.Position !== undefined) { - bodyParams["position"] = serializeAws_restJson1_1Rectangle( - input.Position, - context - ); - } - if (input.ProgramNumber !== undefined) { - bodyParams["programNumber"] = input.ProgramNumber; - } - if (input.PsiControl !== undefined) { - bodyParams["psiControl"] = input.PsiControl; - } - if (input.TimecodeSource !== undefined) { - bodyParams["timecodeSource"] = input.TimecodeSource; - } - if (input.TimecodeStart !== undefined) { - bodyParams["timecodeStart"] = input.TimecodeStart; - } - if (input.VideoSelector !== undefined) { - bodyParams["videoSelector"] = serializeAws_restJson1_1VideoSelector( - input.VideoSelector, - context - ); - } - return bodyParams; + return { + ...(input.AudioSelectorGroups !== undefined && { + audioSelectorGroups: serializeAws_restJson1_1__mapOfAudioSelectorGroup( + input.AudioSelectorGroups, + context + ) + }), + ...(input.AudioSelectors !== undefined && { + audioSelectors: serializeAws_restJson1_1__mapOfAudioSelector( + input.AudioSelectors, + context + ) + }), + ...(input.CaptionSelectors !== undefined && { + captionSelectors: serializeAws_restJson1_1__mapOfCaptionSelector( + input.CaptionSelectors, + context + ) + }), + ...(input.Crop !== undefined && { + crop: serializeAws_restJson1_1Rectangle(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_restJson1_1ImageInserter( + input.ImageInserter, + context + ) + }), + ...(input.InputClippings !== undefined && { + inputClippings: serializeAws_restJson1_1__listOfInputClipping( + input.InputClippings, + context + ) + }), + ...(input.Position !== undefined && { + position: serializeAws_restJson1_1Rectangle(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_restJson1_1VideoSelector( + input.VideoSelector, + context + ) + }) + }; }; const serializeAws_restJson1_1InsertableImage = ( input: InsertableImage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["duration"] = input.Duration; - } - if (input.FadeIn !== undefined) { - bodyParams["fadeIn"] = input.FadeIn; - } - if (input.FadeOut !== undefined) { - bodyParams["fadeOut"] = input.FadeOut; - } - if (input.Height !== undefined) { - bodyParams["height"] = input.Height; - } - if (input.ImageInserterInput !== undefined) { - bodyParams["imageInserterInput"] = input.ImageInserterInput; - } - if (input.ImageX !== undefined) { - bodyParams["imageX"] = input.ImageX; - } - if (input.ImageY !== undefined) { - bodyParams["imageY"] = input.ImageY; - } - if (input.Layer !== undefined) { - bodyParams["layer"] = input.Layer; - } - if (input.Opacity !== undefined) { - bodyParams["opacity"] = input.Opacity; - } - if (input.StartTime !== undefined) { - bodyParams["startTime"] = input.StartTime; - } - if (input.Width !== undefined) { - bodyParams["width"] = input.Width; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1JobSettings = ( input: JobSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdAvailOffset !== undefined) { - bodyParams["adAvailOffset"] = input.AdAvailOffset; - } - if (input.AvailBlanking !== undefined) { - bodyParams["availBlanking"] = serializeAws_restJson1_1AvailBlanking( - input.AvailBlanking, - context - ); - } - if (input.Esam !== undefined) { - bodyParams["esam"] = serializeAws_restJson1_1EsamSettings( - input.Esam, - context - ); - } - if (input.Inputs !== undefined) { - bodyParams["inputs"] = serializeAws_restJson1_1__listOfInput( - input.Inputs, - context - ); - } - if (input.MotionImageInserter !== undefined) { - bodyParams[ - "motionImageInserter" - ] = serializeAws_restJson1_1MotionImageInserter( - input.MotionImageInserter, - context - ); - } - if (input.NielsenConfiguration !== undefined) { - bodyParams[ - "nielsenConfiguration" - ] = serializeAws_restJson1_1NielsenConfiguration( - input.NielsenConfiguration, - context - ); - } - if (input.OutputGroups !== undefined) { - bodyParams["outputGroups"] = serializeAws_restJson1_1__listOfOutputGroup( - input.OutputGroups, - context - ); - } - if (input.TimecodeConfig !== undefined) { - bodyParams["timecodeConfig"] = serializeAws_restJson1_1TimecodeConfig( - input.TimecodeConfig, - context - ); - } - if (input.TimedMetadataInsertion !== undefined) { - bodyParams[ - "timedMetadataInsertion" - ] = serializeAws_restJson1_1TimedMetadataInsertion( - input.TimedMetadataInsertion, - context - ); - } - return bodyParams; + return { + ...(input.AdAvailOffset !== undefined && { + adAvailOffset: input.AdAvailOffset + }), + ...(input.AvailBlanking !== undefined && { + availBlanking: serializeAws_restJson1_1AvailBlanking( + input.AvailBlanking, + context + ) + }), + ...(input.Esam !== undefined && { + esam: serializeAws_restJson1_1EsamSettings(input.Esam, context) + }), + ...(input.Inputs !== undefined && { + inputs: serializeAws_restJson1_1__listOfInput(input.Inputs, context) + }), + ...(input.MotionImageInserter !== undefined && { + motionImageInserter: serializeAws_restJson1_1MotionImageInserter( + input.MotionImageInserter, + context + ) + }), + ...(input.NielsenConfiguration !== undefined && { + nielsenConfiguration: serializeAws_restJson1_1NielsenConfiguration( + input.NielsenConfiguration, + context + ) + }), + ...(input.OutputGroups !== undefined && { + outputGroups: serializeAws_restJson1_1__listOfOutputGroup( + input.OutputGroups, + context + ) + }), + ...(input.TimecodeConfig !== undefined && { + timecodeConfig: serializeAws_restJson1_1TimecodeConfig( + input.TimecodeConfig, + context + ) + }), + ...(input.TimedMetadataInsertion !== undefined && { + timedMetadataInsertion: serializeAws_restJson1_1TimedMetadataInsertion( + input.TimedMetadataInsertion, + context + ) + }) + }; }; const serializeAws_restJson1_1JobTemplateSettings = ( input: JobTemplateSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdAvailOffset !== undefined) { - bodyParams["adAvailOffset"] = input.AdAvailOffset; - } - if (input.AvailBlanking !== undefined) { - bodyParams["availBlanking"] = serializeAws_restJson1_1AvailBlanking( - input.AvailBlanking, - context - ); - } - if (input.Esam !== undefined) { - bodyParams["esam"] = serializeAws_restJson1_1EsamSettings( - input.Esam, - context - ); - } - if (input.Inputs !== undefined) { - bodyParams["inputs"] = serializeAws_restJson1_1__listOfInputTemplate( - input.Inputs, - context - ); - } - if (input.MotionImageInserter !== undefined) { - bodyParams[ - "motionImageInserter" - ] = serializeAws_restJson1_1MotionImageInserter( - input.MotionImageInserter, - context - ); - } - if (input.NielsenConfiguration !== undefined) { - bodyParams[ - "nielsenConfiguration" - ] = serializeAws_restJson1_1NielsenConfiguration( - input.NielsenConfiguration, - context - ); - } - if (input.OutputGroups !== undefined) { - bodyParams["outputGroups"] = serializeAws_restJson1_1__listOfOutputGroup( - input.OutputGroups, - context - ); - } - if (input.TimecodeConfig !== undefined) { - bodyParams["timecodeConfig"] = serializeAws_restJson1_1TimecodeConfig( - input.TimecodeConfig, - context - ); - } - if (input.TimedMetadataInsertion !== undefined) { - bodyParams[ - "timedMetadataInsertion" - ] = serializeAws_restJson1_1TimedMetadataInsertion( - input.TimedMetadataInsertion, - context - ); - } - return bodyParams; + return { + ...(input.AdAvailOffset !== undefined && { + adAvailOffset: input.AdAvailOffset + }), + ...(input.AvailBlanking !== undefined && { + availBlanking: serializeAws_restJson1_1AvailBlanking( + input.AvailBlanking, + context + ) + }), + ...(input.Esam !== undefined && { + esam: serializeAws_restJson1_1EsamSettings(input.Esam, context) + }), + ...(input.Inputs !== undefined && { + inputs: serializeAws_restJson1_1__listOfInputTemplate( + input.Inputs, + context + ) + }), + ...(input.MotionImageInserter !== undefined && { + motionImageInserter: serializeAws_restJson1_1MotionImageInserter( + input.MotionImageInserter, + context + ) + }), + ...(input.NielsenConfiguration !== undefined && { + nielsenConfiguration: serializeAws_restJson1_1NielsenConfiguration( + input.NielsenConfiguration, + context + ) + }), + ...(input.OutputGroups !== undefined && { + outputGroups: serializeAws_restJson1_1__listOfOutputGroup( + input.OutputGroups, + context + ) + }), + ...(input.TimecodeConfig !== undefined && { + timecodeConfig: serializeAws_restJson1_1TimecodeConfig( + input.TimecodeConfig, + context + ) + }), + ...(input.TimedMetadataInsertion !== undefined && { + timedMetadataInsertion: serializeAws_restJson1_1TimedMetadataInsertion( + input.TimedMetadataInsertion, + context + ) + }) + }; }; const serializeAws_restJson1_1M2tsScte35Esam = ( input: M2tsScte35Esam, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Scte35EsamPid !== undefined) { - bodyParams["scte35EsamPid"] = input.Scte35EsamPid; - } - return bodyParams; + return { + ...(input.Scte35EsamPid !== undefined && { + scte35EsamPid: input.Scte35EsamPid + }) + }; }; const serializeAws_restJson1_1M2tsSettings = ( input: M2tsSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioBufferModel !== undefined) { - bodyParams["audioBufferModel"] = input.AudioBufferModel; - } - if (input.AudioFramesPerPes !== undefined) { - bodyParams["audioFramesPerPes"] = input.AudioFramesPerPes; - } - if (input.AudioPids !== undefined) { - bodyParams[ - "audioPids" - ] = serializeAws_restJson1_1__listOf__integerMin32Max8182( - input.AudioPids, - context - ); - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BufferModel !== undefined) { - bodyParams["bufferModel"] = input.BufferModel; - } - if (input.DvbNitSettings !== undefined) { - bodyParams["dvbNitSettings"] = serializeAws_restJson1_1DvbNitSettings( - input.DvbNitSettings, - context - ); - } - if (input.DvbSdtSettings !== undefined) { - bodyParams["dvbSdtSettings"] = serializeAws_restJson1_1DvbSdtSettings( - input.DvbSdtSettings, - context - ); - } - if (input.DvbSubPids !== undefined) { - bodyParams[ - "dvbSubPids" - ] = serializeAws_restJson1_1__listOf__integerMin32Max8182( - input.DvbSubPids, - context - ); - } - if (input.DvbTdtSettings !== undefined) { - bodyParams["dvbTdtSettings"] = serializeAws_restJson1_1DvbTdtSettings( - input.DvbTdtSettings, - context - ); - } - if (input.DvbTeletextPid !== undefined) { - bodyParams["dvbTeletextPid"] = input.DvbTeletextPid; - } - if (input.EbpAudioInterval !== undefined) { - bodyParams["ebpAudioInterval"] = input.EbpAudioInterval; - } - if (input.EbpPlacement !== undefined) { - bodyParams["ebpPlacement"] = input.EbpPlacement; - } - if (input.EsRateInPes !== undefined) { - bodyParams["esRateInPes"] = input.EsRateInPes; - } - if (input.ForceTsVideoEbpOrder !== undefined) { - bodyParams["forceTsVideoEbpOrder"] = input.ForceTsVideoEbpOrder; - } - if (input.FragmentTime !== undefined) { - bodyParams["fragmentTime"] = input.FragmentTime; - } - if (input.MaxPcrInterval !== undefined) { - bodyParams["maxPcrInterval"] = input.MaxPcrInterval; - } - if (input.MinEbpInterval !== undefined) { - bodyParams["minEbpInterval"] = input.MinEbpInterval; - } - if (input.NielsenId3 !== undefined) { - bodyParams["nielsenId3"] = input.NielsenId3; - } - if (input.NullPacketBitrate !== undefined) { - bodyParams["nullPacketBitrate"] = input.NullPacketBitrate; - } - if (input.PatInterval !== undefined) { - bodyParams["patInterval"] = input.PatInterval; - } - if (input.PcrControl !== undefined) { - bodyParams["pcrControl"] = input.PcrControl; - } - if (input.PcrPid !== undefined) { - bodyParams["pcrPid"] = input.PcrPid; - } - if (input.PmtInterval !== undefined) { - bodyParams["pmtInterval"] = input.PmtInterval; - } - if (input.PmtPid !== undefined) { - bodyParams["pmtPid"] = input.PmtPid; - } - if (input.PrivateMetadataPid !== undefined) { - bodyParams["privateMetadataPid"] = input.PrivateMetadataPid; - } - if (input.ProgramNumber !== undefined) { - bodyParams["programNumber"] = input.ProgramNumber; - } - if (input.RateMode !== undefined) { - bodyParams["rateMode"] = input.RateMode; - } - if (input.Scte35Esam !== undefined) { - bodyParams["scte35Esam"] = serializeAws_restJson1_1M2tsScte35Esam( - input.Scte35Esam, - context - ); - } - if (input.Scte35Pid !== undefined) { - bodyParams["scte35Pid"] = input.Scte35Pid; - } - if (input.Scte35Source !== undefined) { - bodyParams["scte35Source"] = input.Scte35Source; - } - if (input.SegmentationMarkers !== undefined) { - bodyParams["segmentationMarkers"] = input.SegmentationMarkers; - } - if (input.SegmentationStyle !== undefined) { - bodyParams["segmentationStyle"] = input.SegmentationStyle; - } - if (input.SegmentationTime !== undefined) { - bodyParams["segmentationTime"] = input.SegmentationTime; - } - if (input.TimedMetadataPid !== undefined) { - bodyParams["timedMetadataPid"] = input.TimedMetadataPid; - } - if (input.TransportStreamId !== undefined) { - bodyParams["transportStreamId"] = input.TransportStreamId; - } - if (input.VideoPid !== undefined) { - bodyParams["videoPid"] = input.VideoPid; - } - return bodyParams; + return { + ...(input.AudioBufferModel !== undefined && { + audioBufferModel: input.AudioBufferModel + }), + ...(input.AudioFramesPerPes !== undefined && { + audioFramesPerPes: input.AudioFramesPerPes + }), + ...(input.AudioPids !== undefined && { + audioPids: serializeAws_restJson1_1__listOf__integerMin32Max8182( + input.AudioPids, + context + ) + }), + ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), + ...(input.BufferModel !== undefined && { bufferModel: input.BufferModel }), + ...(input.DvbNitSettings !== undefined && { + dvbNitSettings: serializeAws_restJson1_1DvbNitSettings( + input.DvbNitSettings, + context + ) + }), + ...(input.DvbSdtSettings !== undefined && { + dvbSdtSettings: serializeAws_restJson1_1DvbSdtSettings( + input.DvbSdtSettings, + context + ) + }), + ...(input.DvbSubPids !== undefined && { + dvbSubPids: serializeAws_restJson1_1__listOf__integerMin32Max8182( + input.DvbSubPids, + context + ) + }), + ...(input.DvbTdtSettings !== undefined && { + dvbTdtSettings: serializeAws_restJson1_1DvbTdtSettings( + 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_restJson1_1M2tsScte35Esam( + 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 }) + }; }; const serializeAws_restJson1_1M3u8Settings = ( input: M3u8Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioFramesPerPes !== undefined) { - bodyParams["audioFramesPerPes"] = input.AudioFramesPerPes; - } - if (input.AudioPids !== undefined) { - bodyParams[ - "audioPids" - ] = serializeAws_restJson1_1__listOf__integerMin32Max8182( - input.AudioPids, - context - ); - } - if (input.NielsenId3 !== undefined) { - bodyParams["nielsenId3"] = input.NielsenId3; - } - if (input.PatInterval !== undefined) { - bodyParams["patInterval"] = input.PatInterval; - } - if (input.PcrControl !== undefined) { - bodyParams["pcrControl"] = input.PcrControl; - } - if (input.PcrPid !== undefined) { - bodyParams["pcrPid"] = input.PcrPid; - } - if (input.PmtInterval !== undefined) { - bodyParams["pmtInterval"] = input.PmtInterval; - } - if (input.PmtPid !== undefined) { - bodyParams["pmtPid"] = input.PmtPid; - } - if (input.PrivateMetadataPid !== undefined) { - bodyParams["privateMetadataPid"] = input.PrivateMetadataPid; - } - if (input.ProgramNumber !== undefined) { - bodyParams["programNumber"] = input.ProgramNumber; - } - if (input.Scte35Pid !== undefined) { - bodyParams["scte35Pid"] = input.Scte35Pid; - } - if (input.Scte35Source !== undefined) { - bodyParams["scte35Source"] = input.Scte35Source; - } - if (input.TimedMetadata !== undefined) { - bodyParams["timedMetadata"] = input.TimedMetadata; - } - if (input.TimedMetadataPid !== undefined) { - bodyParams["timedMetadataPid"] = input.TimedMetadataPid; - } - if (input.TransportStreamId !== undefined) { - bodyParams["transportStreamId"] = input.TransportStreamId; - } - if (input.VideoPid !== undefined) { - bodyParams["videoPid"] = input.VideoPid; - } - return bodyParams; -}; - -const serializeAws_restJson1_1MotionImageInserter = ( - input: MotionImageInserter, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Framerate !== undefined) { - bodyParams[ - "framerate" - ] = serializeAws_restJson1_1MotionImageInsertionFramerate( - input.Framerate, - context - ); - } - if (input.Input !== undefined) { - bodyParams["input"] = input.Input; - } - if (input.InsertionMode !== undefined) { - bodyParams["insertionMode"] = input.InsertionMode; - } - if (input.Offset !== undefined) { - bodyParams["offset"] = serializeAws_restJson1_1MotionImageInsertionOffset( - input.Offset, - context - ); - } - if (input.Playback !== undefined) { - bodyParams["playback"] = input.Playback; - } - if (input.StartTime !== undefined) { - bodyParams["startTime"] = input.StartTime; - } - return bodyParams; + return { + ...(input.AudioFramesPerPes !== undefined && { + audioFramesPerPes: input.AudioFramesPerPes + }), + ...(input.AudioPids !== undefined && { + audioPids: serializeAws_restJson1_1__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 }) + }; +}; + +const serializeAws_restJson1_1MotionImageInserter = ( + input: MotionImageInserter, + context: __SerdeContext +): any => { + return { + ...(input.Framerate !== undefined && { + framerate: serializeAws_restJson1_1MotionImageInsertionFramerate( + input.Framerate, + context + ) + }), + ...(input.Input !== undefined && { input: input.Input }), + ...(input.InsertionMode !== undefined && { + insertionMode: input.InsertionMode + }), + ...(input.Offset !== undefined && { + offset: serializeAws_restJson1_1MotionImageInsertionOffset( + input.Offset, + context + ) + }), + ...(input.Playback !== undefined && { playback: input.Playback }), + ...(input.StartTime !== undefined && { startTime: input.StartTime }) + }; }; const serializeAws_restJson1_1MotionImageInsertionFramerate = ( input: MotionImageInsertionFramerate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - return bodyParams; + return { + ...(input.FramerateDenominator !== undefined && { + framerateDenominator: input.FramerateDenominator + }), + ...(input.FramerateNumerator !== undefined && { + framerateNumerator: input.FramerateNumerator + }) + }; }; const serializeAws_restJson1_1MotionImageInsertionOffset = ( input: MotionImageInsertionOffset, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ImageX !== undefined) { - bodyParams["imageX"] = input.ImageX; - } - if (input.ImageY !== undefined) { - bodyParams["imageY"] = input.ImageY; - } - return bodyParams; + return { + ...(input.ImageX !== undefined && { imageX: input.ImageX }), + ...(input.ImageY !== undefined && { imageY: input.ImageY }) + }; }; const serializeAws_restJson1_1MovSettings = ( input: MovSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClapAtom !== undefined) { - bodyParams["clapAtom"] = input.ClapAtom; - } - if (input.CslgAtom !== undefined) { - bodyParams["cslgAtom"] = input.CslgAtom; - } - if (input.Mpeg2FourCCControl !== undefined) { - bodyParams["mpeg2FourCCControl"] = input.Mpeg2FourCCControl; - } - if (input.PaddingControl !== undefined) { - bodyParams["paddingControl"] = input.PaddingControl; - } - if (input.Reference !== undefined) { - bodyParams["reference"] = input.Reference; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Mp2Settings = ( input: Mp2Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.Channels !== undefined) { - bodyParams["channels"] = input.Channels; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - return bodyParams; + return { + ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), + ...(input.Channels !== undefined && { channels: input.Channels }), + ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }) + }; }; const serializeAws_restJson1_1Mp3Settings = ( input: Mp3Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.Channels !== undefined) { - bodyParams["channels"] = input.Channels; - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - if (input.VbrQuality !== undefined) { - bodyParams["vbrQuality"] = input.VbrQuality; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Mp4Settings = ( input: Mp4Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CslgAtom !== undefined) { - bodyParams["cslgAtom"] = input.CslgAtom; - } - if (input.CttsVersion !== undefined) { - bodyParams["cttsVersion"] = input.CttsVersion; - } - if (input.FreeSpaceBox !== undefined) { - bodyParams["freeSpaceBox"] = input.FreeSpaceBox; - } - if (input.MoovPlacement !== undefined) { - bodyParams["moovPlacement"] = input.MoovPlacement; - } - if (input.Mp4MajorBrand !== undefined) { - bodyParams["mp4MajorBrand"] = input.Mp4MajorBrand; - } - return bodyParams; + return { + ...(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 + }) + }; }; const serializeAws_restJson1_1MpdSettings = ( input: MpdSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionContainerType !== undefined) { - bodyParams["captionContainerType"] = input.CaptionContainerType; - } - if (input.Scte35Esam !== undefined) { - bodyParams["scte35Esam"] = input.Scte35Esam; - } - if (input.Scte35Source !== undefined) { - bodyParams["scte35Source"] = input.Scte35Source; - } - return bodyParams; + return { + ...(input.CaptionContainerType !== undefined && { + captionContainerType: input.CaptionContainerType + }), + ...(input.Scte35Esam !== undefined && { scte35Esam: input.Scte35Esam }), + ...(input.Scte35Source !== undefined && { + scte35Source: input.Scte35Source + }) + }; }; const serializeAws_restJson1_1Mpeg2Settings = ( input: Mpeg2Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdaptiveQuantization !== undefined) { - bodyParams["adaptiveQuantization"] = input.AdaptiveQuantization; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.CodecLevel !== undefined) { - bodyParams["codecLevel"] = input.CodecLevel; - } - if (input.CodecProfile !== undefined) { - bodyParams["codecProfile"] = input.CodecProfile; - } - if (input.DynamicSubGop !== undefined) { - bodyParams["dynamicSubGop"] = input.DynamicSubGop; - } - if (input.FramerateControl !== undefined) { - bodyParams["framerateControl"] = input.FramerateControl; - } - if (input.FramerateConversionAlgorithm !== undefined) { - bodyParams["framerateConversionAlgorithm"] = - input.FramerateConversionAlgorithm; - } - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.GopClosedCadence !== undefined) { - bodyParams["gopClosedCadence"] = input.GopClosedCadence; - } - if (input.GopSize !== undefined) { - bodyParams["gopSize"] = input.GopSize; - } - if (input.GopSizeUnits !== undefined) { - bodyParams["gopSizeUnits"] = input.GopSizeUnits; - } - if (input.HrdBufferInitialFillPercentage !== undefined) { - bodyParams["hrdBufferInitialFillPercentage"] = - input.HrdBufferInitialFillPercentage; - } - if (input.HrdBufferSize !== undefined) { - bodyParams["hrdBufferSize"] = input.HrdBufferSize; - } - if (input.InterlaceMode !== undefined) { - bodyParams["interlaceMode"] = input.InterlaceMode; - } - if (input.IntraDcPrecision !== undefined) { - bodyParams["intraDcPrecision"] = input.IntraDcPrecision; - } - if (input.MaxBitrate !== undefined) { - bodyParams["maxBitrate"] = input.MaxBitrate; - } - if (input.MinIInterval !== undefined) { - bodyParams["minIInterval"] = input.MinIInterval; - } - if (input.NumberBFramesBetweenReferenceFrames !== undefined) { - bodyParams["numberBFramesBetweenReferenceFrames"] = - input.NumberBFramesBetweenReferenceFrames; - } - if (input.ParControl !== undefined) { - bodyParams["parControl"] = input.ParControl; - } - if (input.ParDenominator !== undefined) { - bodyParams["parDenominator"] = input.ParDenominator; - } - if (input.ParNumerator !== undefined) { - bodyParams["parNumerator"] = input.ParNumerator; - } - if (input.QualityTuningLevel !== undefined) { - bodyParams["qualityTuningLevel"] = input.QualityTuningLevel; - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.SceneChangeDetect !== undefined) { - bodyParams["sceneChangeDetect"] = input.SceneChangeDetect; - } - if (input.SlowPal !== undefined) { - bodyParams["slowPal"] = input.SlowPal; - } - if (input.Softness !== undefined) { - bodyParams["softness"] = input.Softness; - } - if (input.SpatialAdaptiveQuantization !== undefined) { - bodyParams["spatialAdaptiveQuantization"] = - input.SpatialAdaptiveQuantization; - } - if (input.Syntax !== undefined) { - bodyParams["syntax"] = input.Syntax; - } - if (input.Telecine !== undefined) { - bodyParams["telecine"] = input.Telecine; - } - if (input.TemporalAdaptiveQuantization !== undefined) { - bodyParams["temporalAdaptiveQuantization"] = - input.TemporalAdaptiveQuantization; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1MsSmoothAdditionalManifest = ( input: MsSmoothAdditionalManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestNameModifier !== undefined) { - bodyParams["manifestNameModifier"] = input.ManifestNameModifier; - } - if (input.SelectedOutputs !== undefined) { - bodyParams[ - "selectedOutputs" - ] = serializeAws_restJson1_1__listOf__stringMin1( - input.SelectedOutputs, - context - ); - } - return bodyParams; + return { + ...(input.ManifestNameModifier !== undefined && { + manifestNameModifier: input.ManifestNameModifier + }), + ...(input.SelectedOutputs !== undefined && { + selectedOutputs: serializeAws_restJson1_1__listOf__stringMin1( + input.SelectedOutputs, + context + ) + }) + }; }; const serializeAws_restJson1_1MsSmoothEncryptionSettings = ( input: MsSmoothEncryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1MsSmoothGroupSettings = ( input: MsSmoothGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalManifests !== undefined) { - bodyParams[ - "additionalManifests" - ] = serializeAws_restJson1_1__listOfMsSmoothAdditionalManifest( - input.AdditionalManifests, - context - ); - } - if (input.AudioDeduplication !== undefined) { - bodyParams["audioDeduplication"] = input.AudioDeduplication; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = input.Destination; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1DestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams[ - "encryption" - ] = serializeAws_restJson1_1MsSmoothEncryptionSettings( - input.Encryption, - context - ); - } - if (input.FragmentLength !== undefined) { - bodyParams["fragmentLength"] = input.FragmentLength; - } - if (input.ManifestEncoding !== undefined) { - bodyParams["manifestEncoding"] = input.ManifestEncoding; - } - return bodyParams; + return { + ...(input.AdditionalManifests !== undefined && { + additionalManifests: serializeAws_restJson1_1__listOfMsSmoothAdditionalManifest( + input.AdditionalManifests, + context + ) + }), + ...(input.AudioDeduplication !== undefined && { + audioDeduplication: input.AudioDeduplication + }), + ...(input.Destination !== undefined && { destination: input.Destination }), + ...(input.DestinationSettings !== undefined && { + destinationSettings: serializeAws_restJson1_1DestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1MsSmoothEncryptionSettings( + input.Encryption, + context + ) + }), + ...(input.FragmentLength !== undefined && { + fragmentLength: input.FragmentLength + }), + ...(input.ManifestEncoding !== undefined && { + manifestEncoding: input.ManifestEncoding + }) + }; }; const serializeAws_restJson1_1NielsenConfiguration = ( input: NielsenConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BreakoutCode !== undefined) { - bodyParams["breakoutCode"] = input.BreakoutCode; - } - if (input.DistributorId !== undefined) { - bodyParams["distributorId"] = input.DistributorId; - } - return bodyParams; + return { + ...(input.BreakoutCode !== undefined && { + breakoutCode: input.BreakoutCode + }), + ...(input.DistributorId !== undefined && { + distributorId: input.DistributorId + }) + }; }; const serializeAws_restJson1_1NoiseReducer = ( input: NoiseReducer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["filter"] = input.Filter; - } - if (input.FilterSettings !== undefined) { - bodyParams[ - "filterSettings" - ] = serializeAws_restJson1_1NoiseReducerFilterSettings( - input.FilterSettings, - context - ); - } - if (input.SpatialFilterSettings !== undefined) { - bodyParams[ - "spatialFilterSettings" - ] = serializeAws_restJson1_1NoiseReducerSpatialFilterSettings( - input.SpatialFilterSettings, - context - ); - } - if (input.TemporalFilterSettings !== undefined) { - bodyParams[ - "temporalFilterSettings" - ] = serializeAws_restJson1_1NoiseReducerTemporalFilterSettings( - input.TemporalFilterSettings, - context - ); - } - return bodyParams; + return { + ...(input.Filter !== undefined && { filter: input.Filter }), + ...(input.FilterSettings !== undefined && { + filterSettings: serializeAws_restJson1_1NoiseReducerFilterSettings( + input.FilterSettings, + context + ) + }), + ...(input.SpatialFilterSettings !== undefined && { + spatialFilterSettings: serializeAws_restJson1_1NoiseReducerSpatialFilterSettings( + input.SpatialFilterSettings, + context + ) + }), + ...(input.TemporalFilterSettings !== undefined && { + temporalFilterSettings: serializeAws_restJson1_1NoiseReducerTemporalFilterSettings( + input.TemporalFilterSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1NoiseReducerFilterSettings = ( input: NoiseReducerFilterSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Strength !== undefined) { - bodyParams["strength"] = input.Strength; - } - return bodyParams; + return { + ...(input.Strength !== undefined && { strength: input.Strength }) + }; }; const serializeAws_restJson1_1NoiseReducerSpatialFilterSettings = ( input: NoiseReducerSpatialFilterSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PostFilterSharpenStrength !== undefined) { - bodyParams["postFilterSharpenStrength"] = input.PostFilterSharpenStrength; - } - if (input.Speed !== undefined) { - bodyParams["speed"] = input.Speed; - } - if (input.Strength !== undefined) { - bodyParams["strength"] = input.Strength; - } - return bodyParams; + return { + ...(input.PostFilterSharpenStrength !== undefined && { + postFilterSharpenStrength: input.PostFilterSharpenStrength + }), + ...(input.Speed !== undefined && { speed: input.Speed }), + ...(input.Strength !== undefined && { strength: input.Strength }) + }; }; const serializeAws_restJson1_1NoiseReducerTemporalFilterSettings = ( input: NoiseReducerTemporalFilterSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AggressiveMode !== undefined) { - bodyParams["aggressiveMode"] = input.AggressiveMode; - } - if (input.Speed !== undefined) { - bodyParams["speed"] = input.Speed; - } - if (input.Strength !== undefined) { - bodyParams["strength"] = input.Strength; - } - return bodyParams; + return { + ...(input.AggressiveMode !== undefined && { + aggressiveMode: input.AggressiveMode + }), + ...(input.Speed !== undefined && { speed: input.Speed }), + ...(input.Strength !== undefined && { strength: input.Strength }) + }; }; const serializeAws_restJson1_1Output = ( input: Output, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioDescriptions !== undefined) { - bodyParams[ - "audioDescriptions" - ] = serializeAws_restJson1_1__listOfAudioDescription( - input.AudioDescriptions, - context - ); - } - if (input.CaptionDescriptions !== undefined) { - bodyParams[ - "captionDescriptions" - ] = serializeAws_restJson1_1__listOfCaptionDescription( - input.CaptionDescriptions, - context - ); - } - if (input.ContainerSettings !== undefined) { - bodyParams["containerSettings"] = serializeAws_restJson1_1ContainerSettings( - input.ContainerSettings, - context - ); - } - if (input.Extension !== undefined) { - bodyParams["extension"] = input.Extension; - } - if (input.NameModifier !== undefined) { - bodyParams["nameModifier"] = input.NameModifier; - } - if (input.OutputSettings !== undefined) { - bodyParams["outputSettings"] = serializeAws_restJson1_1OutputSettings( - input.OutputSettings, - context - ); - } - if (input.Preset !== undefined) { - bodyParams["preset"] = input.Preset; - } - if (input.VideoDescription !== undefined) { - bodyParams["videoDescription"] = serializeAws_restJson1_1VideoDescription( - input.VideoDescription, - context - ); - } - return bodyParams; + return { + ...(input.AudioDescriptions !== undefined && { + audioDescriptions: serializeAws_restJson1_1__listOfAudioDescription( + input.AudioDescriptions, + context + ) + }), + ...(input.CaptionDescriptions !== undefined && { + captionDescriptions: serializeAws_restJson1_1__listOfCaptionDescription( + input.CaptionDescriptions, + context + ) + }), + ...(input.ContainerSettings !== undefined && { + containerSettings: serializeAws_restJson1_1ContainerSettings( + input.ContainerSettings, + context + ) + }), + ...(input.Extension !== undefined && { extension: input.Extension }), + ...(input.NameModifier !== undefined && { + nameModifier: input.NameModifier + }), + ...(input.OutputSettings !== undefined && { + outputSettings: serializeAws_restJson1_1OutputSettings( + input.OutputSettings, + context + ) + }), + ...(input.Preset !== undefined && { preset: input.Preset }), + ...(input.VideoDescription !== undefined && { + videoDescription: serializeAws_restJson1_1VideoDescription( + input.VideoDescription, + context + ) + }) + }; }; const serializeAws_restJson1_1OutputChannelMapping = ( input: OutputChannelMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputChannels !== undefined) { - bodyParams[ - "inputChannels" - ] = serializeAws_restJson1_1__listOf__integerMinNegative60Max6( - input.InputChannels, - context - ); - } - return bodyParams; + return { + ...(input.InputChannels !== undefined && { + inputChannels: serializeAws_restJson1_1__listOf__integerMinNegative60Max6( + input.InputChannels, + context + ) + }) + }; }; const serializeAws_restJson1_1OutputGroup = ( input: OutputGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomName !== undefined) { - bodyParams["customName"] = input.CustomName; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.OutputGroupSettings !== undefined) { - bodyParams[ - "outputGroupSettings" - ] = serializeAws_restJson1_1OutputGroupSettings( - input.OutputGroupSettings, - context - ); - } - if (input.Outputs !== undefined) { - bodyParams["outputs"] = serializeAws_restJson1_1__listOfOutput( - input.Outputs, - context - ); - } - return bodyParams; + return { + ...(input.CustomName !== undefined && { customName: input.CustomName }), + ...(input.Name !== undefined && { name: input.Name }), + ...(input.OutputGroupSettings !== undefined && { + outputGroupSettings: serializeAws_restJson1_1OutputGroupSettings( + input.OutputGroupSettings, + context + ) + }), + ...(input.Outputs !== undefined && { + outputs: serializeAws_restJson1_1__listOfOutput(input.Outputs, context) + }) + }; }; const serializeAws_restJson1_1OutputGroupSettings = ( input: OutputGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CmafGroupSettings !== undefined) { - bodyParams["cmafGroupSettings"] = serializeAws_restJson1_1CmafGroupSettings( - input.CmafGroupSettings, - context - ); - } - if (input.DashIsoGroupSettings !== undefined) { - bodyParams[ - "dashIsoGroupSettings" - ] = serializeAws_restJson1_1DashIsoGroupSettings( - input.DashIsoGroupSettings, - context - ); - } - if (input.FileGroupSettings !== undefined) { - bodyParams["fileGroupSettings"] = serializeAws_restJson1_1FileGroupSettings( - input.FileGroupSettings, - context - ); - } - if (input.HlsGroupSettings !== undefined) { - bodyParams["hlsGroupSettings"] = serializeAws_restJson1_1HlsGroupSettings( - input.HlsGroupSettings, - context - ); - } - if (input.MsSmoothGroupSettings !== undefined) { - bodyParams[ - "msSmoothGroupSettings" - ] = serializeAws_restJson1_1MsSmoothGroupSettings( - input.MsSmoothGroupSettings, - context - ); - } - if (input.Type !== undefined) { - bodyParams["type"] = input.Type; - } - return bodyParams; + return { + ...(input.CmafGroupSettings !== undefined && { + cmafGroupSettings: serializeAws_restJson1_1CmafGroupSettings( + input.CmafGroupSettings, + context + ) + }), + ...(input.DashIsoGroupSettings !== undefined && { + dashIsoGroupSettings: serializeAws_restJson1_1DashIsoGroupSettings( + input.DashIsoGroupSettings, + context + ) + }), + ...(input.FileGroupSettings !== undefined && { + fileGroupSettings: serializeAws_restJson1_1FileGroupSettings( + input.FileGroupSettings, + context + ) + }), + ...(input.HlsGroupSettings !== undefined && { + hlsGroupSettings: serializeAws_restJson1_1HlsGroupSettings( + input.HlsGroupSettings, + context + ) + }), + ...(input.MsSmoothGroupSettings !== undefined && { + msSmoothGroupSettings: serializeAws_restJson1_1MsSmoothGroupSettings( + input.MsSmoothGroupSettings, + context + ) + }), + ...(input.Type !== undefined && { type: input.Type }) + }; }; const serializeAws_restJson1_1OutputSettings = ( input: OutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HlsSettings !== undefined) { - bodyParams["hlsSettings"] = serializeAws_restJson1_1HlsSettings( - input.HlsSettings, - context - ); - } - return bodyParams; + return { + ...(input.HlsSettings !== undefined && { + hlsSettings: serializeAws_restJson1_1HlsSettings( + input.HlsSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1PresetSettings = ( input: PresetSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioDescriptions !== undefined) { - bodyParams[ - "audioDescriptions" - ] = serializeAws_restJson1_1__listOfAudioDescription( - input.AudioDescriptions, - context - ); - } - if (input.CaptionDescriptions !== undefined) { - bodyParams[ - "captionDescriptions" - ] = serializeAws_restJson1_1__listOfCaptionDescriptionPreset( - input.CaptionDescriptions, - context - ); - } - if (input.ContainerSettings !== undefined) { - bodyParams["containerSettings"] = serializeAws_restJson1_1ContainerSettings( - input.ContainerSettings, - context - ); - } - if (input.VideoDescription !== undefined) { - bodyParams["videoDescription"] = serializeAws_restJson1_1VideoDescription( - input.VideoDescription, - context - ); - } - return bodyParams; + return { + ...(input.AudioDescriptions !== undefined && { + audioDescriptions: serializeAws_restJson1_1__listOfAudioDescription( + input.AudioDescriptions, + context + ) + }), + ...(input.CaptionDescriptions !== undefined && { + captionDescriptions: serializeAws_restJson1_1__listOfCaptionDescriptionPreset( + input.CaptionDescriptions, + context + ) + }), + ...(input.ContainerSettings !== undefined && { + containerSettings: serializeAws_restJson1_1ContainerSettings( + input.ContainerSettings, + context + ) + }), + ...(input.VideoDescription !== undefined && { + videoDescription: serializeAws_restJson1_1VideoDescription( + input.VideoDescription, + context + ) + }) + }; }; const serializeAws_restJson1_1ProresSettings = ( input: ProresSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodecProfile !== undefined) { - bodyParams["codecProfile"] = input.CodecProfile; - } - if (input.FramerateControl !== undefined) { - bodyParams["framerateControl"] = input.FramerateControl; - } - if (input.FramerateConversionAlgorithm !== undefined) { - bodyParams["framerateConversionAlgorithm"] = - input.FramerateConversionAlgorithm; - } - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.InterlaceMode !== undefined) { - bodyParams["interlaceMode"] = input.InterlaceMode; - } - if (input.ParControl !== undefined) { - bodyParams["parControl"] = input.ParControl; - } - if (input.ParDenominator !== undefined) { - bodyParams["parDenominator"] = input.ParDenominator; - } - if (input.ParNumerator !== undefined) { - bodyParams["parNumerator"] = input.ParNumerator; - } - if (input.SlowPal !== undefined) { - bodyParams["slowPal"] = input.SlowPal; - } - if (input.Telecine !== undefined) { - bodyParams["telecine"] = input.Telecine; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Rectangle = ( input: Rectangle, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Height !== undefined) { - bodyParams["height"] = input.Height; - } - if (input.Width !== undefined) { - bodyParams["width"] = input.Width; - } - if (input.X !== undefined) { - bodyParams["x"] = input.X; - } - if (input.Y !== undefined) { - bodyParams["y"] = input.Y; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1RemixSettings = ( input: RemixSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChannelMapping !== undefined) { - bodyParams["channelMapping"] = serializeAws_restJson1_1ChannelMapping( - input.ChannelMapping, - context - ); - } - if (input.ChannelsIn !== undefined) { - bodyParams["channelsIn"] = input.ChannelsIn; - } - if (input.ChannelsOut !== undefined) { - bodyParams["channelsOut"] = input.ChannelsOut; - } - return bodyParams; + return { + ...(input.ChannelMapping !== undefined && { + channelMapping: serializeAws_restJson1_1ChannelMapping( + input.ChannelMapping, + context + ) + }), + ...(input.ChannelsIn !== undefined && { channelsIn: input.ChannelsIn }), + ...(input.ChannelsOut !== undefined && { channelsOut: input.ChannelsOut }) + }; }; const serializeAws_restJson1_1ReservationPlanSettings = ( input: ReservationPlanSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Commitment !== undefined) { - bodyParams["commitment"] = input.Commitment; - } - if (input.RenewalType !== undefined) { - bodyParams["renewalType"] = input.RenewalType; - } - if (input.ReservedSlots !== undefined) { - bodyParams["reservedSlots"] = input.ReservedSlots; - } - return bodyParams; + return { + ...(input.Commitment !== undefined && { commitment: input.Commitment }), + ...(input.RenewalType !== undefined && { renewalType: input.RenewalType }), + ...(input.ReservedSlots !== undefined && { + reservedSlots: input.ReservedSlots + }) + }; }; const serializeAws_restJson1_1S3DestinationAccessControl = ( input: S3DestinationAccessControl, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CannedAcl !== undefined) { - bodyParams["cannedAcl"] = input.CannedAcl; - } - return bodyParams; + return { + ...(input.CannedAcl !== undefined && { cannedAcl: input.CannedAcl }) + }; }; const serializeAws_restJson1_1S3DestinationSettings = ( input: S3DestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccessControl !== undefined) { - bodyParams[ - "accessControl" - ] = serializeAws_restJson1_1S3DestinationAccessControl( - input.AccessControl, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1S3EncryptionSettings( - input.Encryption, - context - ); - } - return bodyParams; + return { + ...(input.AccessControl !== undefined && { + accessControl: serializeAws_restJson1_1S3DestinationAccessControl( + input.AccessControl, + context + ) + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1S3EncryptionSettings( + input.Encryption, + context + ) + }) + }; }; const serializeAws_restJson1_1S3EncryptionSettings = ( input: S3EncryptionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EncryptionType !== undefined) { - bodyParams["encryptionType"] = input.EncryptionType; - } - if (input.KmsKeyArn !== undefined) { - bodyParams["kmsKeyArn"] = input.KmsKeyArn; - } - return bodyParams; + return { + ...(input.EncryptionType !== undefined && { + encryptionType: input.EncryptionType + }), + ...(input.KmsKeyArn !== undefined && { kmsKeyArn: input.KmsKeyArn }) + }; }; const serializeAws_restJson1_1SccDestinationSettings = ( input: SccDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Framerate !== undefined) { - bodyParams["framerate"] = input.Framerate; - } - return bodyParams; + return { + ...(input.Framerate !== undefined && { framerate: input.Framerate }) + }; }; const serializeAws_restJson1_1SpekeKeyProvider = ( input: SpekeKeyProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["certificateArn"] = input.CertificateArn; - } - if (input.ResourceId !== undefined) { - bodyParams["resourceId"] = input.ResourceId; - } - if (input.SystemIds !== undefined) { - bodyParams[ - "systemIds" - ] = serializeAws_restJson1_1__listOf__stringPattern09aFAF809aFAF409aFAF409aFAF409aFAF12( - input.SystemIds, - context - ); - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + certificateArn: input.CertificateArn + }), + ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), + ...(input.SystemIds !== undefined && { + systemIds: serializeAws_restJson1_1__listOf__stringPattern09aFAF809aFAF409aFAF409aFAF409aFAF12( + input.SystemIds, + context + ) + }), + ...(input.Url !== undefined && { url: input.Url }) + }; }; const serializeAws_restJson1_1SpekeKeyProviderCmaf = ( input: SpekeKeyProviderCmaf, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["certificateArn"] = input.CertificateArn; - } - if (input.DashSignaledSystemIds !== undefined) { - bodyParams[ - "dashSignaledSystemIds" - ] = serializeAws_restJson1_1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( - input.DashSignaledSystemIds, - context - ); - } - if (input.HlsSignaledSystemIds !== undefined) { - bodyParams[ - "hlsSignaledSystemIds" - ] = serializeAws_restJson1_1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( - input.HlsSignaledSystemIds, - context - ); - } - if (input.ResourceId !== undefined) { - bodyParams["resourceId"] = input.ResourceId; - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + return { + ...(input.CertificateArn !== undefined && { + certificateArn: input.CertificateArn + }), + ...(input.DashSignaledSystemIds !== undefined && { + dashSignaledSystemIds: serializeAws_restJson1_1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( + input.DashSignaledSystemIds, + context + ) + }), + ...(input.HlsSignaledSystemIds !== undefined && { + hlsSignaledSystemIds: serializeAws_restJson1_1__listOf__stringMin36Max36Pattern09aFAF809aFAF409aFAF409aFAF409aFAF12( + input.HlsSignaledSystemIds, + context + ) + }), + ...(input.ResourceId !== undefined && { resourceId: input.ResourceId }), + ...(input.Url !== undefined && { url: input.Url }) + }; }; const serializeAws_restJson1_1StaticKeyProvider = ( input: StaticKeyProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyFormat !== undefined) { - bodyParams["keyFormat"] = input.KeyFormat; - } - if (input.KeyFormatVersions !== undefined) { - bodyParams["keyFormatVersions"] = input.KeyFormatVersions; - } - if (input.StaticKeyValue !== undefined) { - bodyParams["staticKeyValue"] = input.StaticKeyValue; - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1TeletextDestinationSettings = ( input: TeletextDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PageNumber !== undefined) { - bodyParams["pageNumber"] = input.PageNumber; - } - if (input.PageTypes !== undefined) { - bodyParams["pageTypes"] = serializeAws_restJson1_1__listOfTeletextPageType( - input.PageTypes, - context - ); - } - return bodyParams; + return { + ...(input.PageNumber !== undefined && { pageNumber: input.PageNumber }), + ...(input.PageTypes !== undefined && { + pageTypes: serializeAws_restJson1_1__listOfTeletextPageType( + input.PageTypes, + context + ) + }) + }; }; const serializeAws_restJson1_1TeletextSourceSettings = ( input: TeletextSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PageNumber !== undefined) { - bodyParams["pageNumber"] = input.PageNumber; - } - return bodyParams; + return { + ...(input.PageNumber !== undefined && { pageNumber: input.PageNumber }) + }; }; const serializeAws_restJson1_1TimecodeBurnin = ( input: TimecodeBurnin, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FontSize !== undefined) { - bodyParams["fontSize"] = input.FontSize; - } - if (input.Position !== undefined) { - bodyParams["position"] = input.Position; - } - if (input.Prefix !== undefined) { - bodyParams["prefix"] = input.Prefix; - } - return bodyParams; + return { + ...(input.FontSize !== undefined && { fontSize: input.FontSize }), + ...(input.Position !== undefined && { position: input.Position }), + ...(input.Prefix !== undefined && { prefix: input.Prefix }) + }; }; const serializeAws_restJson1_1TimecodeConfig = ( input: TimecodeConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Anchor !== undefined) { - bodyParams["anchor"] = input.Anchor; - } - if (input.Source !== undefined) { - bodyParams["source"] = input.Source; - } - if (input.Start !== undefined) { - bodyParams["start"] = input.Start; - } - if (input.TimestampOffset !== undefined) { - bodyParams["timestampOffset"] = input.TimestampOffset; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1TimedMetadataInsertion = ( input: TimedMetadataInsertion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id3Insertions !== undefined) { - bodyParams["id3Insertions"] = serializeAws_restJson1_1__listOfId3Insertion( - input.Id3Insertions, - context - ); - } - return bodyParams; + return { + ...(input.Id3Insertions !== undefined && { + id3Insertions: serializeAws_restJson1_1__listOfId3Insertion( + input.Id3Insertions, + context + ) + }) + }; }; const serializeAws_restJson1_1TrackSourceSettings = ( input: TrackSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrackNumber !== undefined) { - bodyParams["trackNumber"] = input.TrackNumber; - } - return bodyParams; + return { + ...(input.TrackNumber !== undefined && { trackNumber: input.TrackNumber }) + }; }; const serializeAws_restJson1_1TtmlDestinationSettings = ( input: TtmlDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StylePassthrough !== undefined) { - bodyParams["stylePassthrough"] = input.StylePassthrough; - } - return bodyParams; + return { + ...(input.StylePassthrough !== undefined && { + stylePassthrough: input.StylePassthrough + }) + }; }; const serializeAws_restJson1_1VideoCodecSettings = ( input: VideoCodecSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Codec !== undefined) { - bodyParams["codec"] = input.Codec; - } - if (input.FrameCaptureSettings !== undefined) { - bodyParams[ - "frameCaptureSettings" - ] = serializeAws_restJson1_1FrameCaptureSettings( - input.FrameCaptureSettings, - context - ); - } - if (input.H264Settings !== undefined) { - bodyParams["h264Settings"] = serializeAws_restJson1_1H264Settings( - input.H264Settings, - context - ); - } - if (input.H265Settings !== undefined) { - bodyParams["h265Settings"] = serializeAws_restJson1_1H265Settings( - input.H265Settings, - context - ); - } - if (input.Mpeg2Settings !== undefined) { - bodyParams["mpeg2Settings"] = serializeAws_restJson1_1Mpeg2Settings( - input.Mpeg2Settings, - context - ); - } - if (input.ProresSettings !== undefined) { - bodyParams["proresSettings"] = serializeAws_restJson1_1ProresSettings( - input.ProresSettings, - context - ); - } - return bodyParams; + return { + ...(input.Codec !== undefined && { codec: input.Codec }), + ...(input.FrameCaptureSettings !== undefined && { + frameCaptureSettings: serializeAws_restJson1_1FrameCaptureSettings( + input.FrameCaptureSettings, + context + ) + }), + ...(input.H264Settings !== undefined && { + h264Settings: serializeAws_restJson1_1H264Settings( + input.H264Settings, + context + ) + }), + ...(input.H265Settings !== undefined && { + h265Settings: serializeAws_restJson1_1H265Settings( + input.H265Settings, + context + ) + }), + ...(input.Mpeg2Settings !== undefined && { + mpeg2Settings: serializeAws_restJson1_1Mpeg2Settings( + input.Mpeg2Settings, + context + ) + }), + ...(input.ProresSettings !== undefined && { + proresSettings: serializeAws_restJson1_1ProresSettings( + input.ProresSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1VideoDescription = ( input: VideoDescription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AfdSignaling !== undefined) { - bodyParams["afdSignaling"] = input.AfdSignaling; - } - if (input.AntiAlias !== undefined) { - bodyParams["antiAlias"] = input.AntiAlias; - } - if (input.CodecSettings !== undefined) { - bodyParams["codecSettings"] = serializeAws_restJson1_1VideoCodecSettings( - input.CodecSettings, - context - ); - } - if (input.ColorMetadata !== undefined) { - bodyParams["colorMetadata"] = input.ColorMetadata; - } - if (input.Crop !== undefined) { - bodyParams["crop"] = serializeAws_restJson1_1Rectangle(input.Crop, context); - } - if (input.DropFrameTimecode !== undefined) { - bodyParams["dropFrameTimecode"] = input.DropFrameTimecode; - } - if (input.FixedAfd !== undefined) { - bodyParams["fixedAfd"] = input.FixedAfd; - } - if (input.Height !== undefined) { - bodyParams["height"] = input.Height; - } - if (input.Position !== undefined) { - bodyParams["position"] = serializeAws_restJson1_1Rectangle( - input.Position, - context - ); - } - if (input.RespondToAfd !== undefined) { - bodyParams["respondToAfd"] = input.RespondToAfd; - } - if (input.ScalingBehavior !== undefined) { - bodyParams["scalingBehavior"] = input.ScalingBehavior; - } - if (input.Sharpness !== undefined) { - bodyParams["sharpness"] = input.Sharpness; - } - if (input.TimecodeInsertion !== undefined) { - bodyParams["timecodeInsertion"] = input.TimecodeInsertion; - } - if (input.VideoPreprocessors !== undefined) { - bodyParams[ - "videoPreprocessors" - ] = serializeAws_restJson1_1VideoPreprocessor( - input.VideoPreprocessors, - context - ); - } - if (input.Width !== undefined) { - bodyParams["width"] = input.Width; - } - return bodyParams; + return { + ...(input.AfdSignaling !== undefined && { + afdSignaling: input.AfdSignaling + }), + ...(input.AntiAlias !== undefined && { antiAlias: input.AntiAlias }), + ...(input.CodecSettings !== undefined && { + codecSettings: serializeAws_restJson1_1VideoCodecSettings( + input.CodecSettings, + context + ) + }), + ...(input.ColorMetadata !== undefined && { + colorMetadata: input.ColorMetadata + }), + ...(input.Crop !== undefined && { + crop: serializeAws_restJson1_1Rectangle(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_restJson1_1Rectangle(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_restJson1_1VideoPreprocessor( + input.VideoPreprocessors, + context + ) + }), + ...(input.Width !== undefined && { width: input.Width }) + }; }; const serializeAws_restJson1_1VideoPreprocessor = ( input: VideoPreprocessor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColorCorrector !== undefined) { - bodyParams["colorCorrector"] = serializeAws_restJson1_1ColorCorrector( - input.ColorCorrector, - context - ); - } - if (input.Deinterlacer !== undefined) { - bodyParams["deinterlacer"] = serializeAws_restJson1_1Deinterlacer( - input.Deinterlacer, - context - ); - } - if (input.DolbyVision !== undefined) { - bodyParams["dolbyVision"] = serializeAws_restJson1_1DolbyVision( - input.DolbyVision, - context - ); - } - if (input.ImageInserter !== undefined) { - bodyParams["imageInserter"] = serializeAws_restJson1_1ImageInserter( - input.ImageInserter, - context - ); - } - if (input.NoiseReducer !== undefined) { - bodyParams["noiseReducer"] = serializeAws_restJson1_1NoiseReducer( - input.NoiseReducer, - context - ); - } - if (input.TimecodeBurnin !== undefined) { - bodyParams["timecodeBurnin"] = serializeAws_restJson1_1TimecodeBurnin( - input.TimecodeBurnin, - context - ); - } - return bodyParams; + return { + ...(input.ColorCorrector !== undefined && { + colorCorrector: serializeAws_restJson1_1ColorCorrector( + input.ColorCorrector, + context + ) + }), + ...(input.Deinterlacer !== undefined && { + deinterlacer: serializeAws_restJson1_1Deinterlacer( + input.Deinterlacer, + context + ) + }), + ...(input.DolbyVision !== undefined && { + dolbyVision: serializeAws_restJson1_1DolbyVision( + input.DolbyVision, + context + ) + }), + ...(input.ImageInserter !== undefined && { + imageInserter: serializeAws_restJson1_1ImageInserter( + input.ImageInserter, + context + ) + }), + ...(input.NoiseReducer !== undefined && { + noiseReducer: serializeAws_restJson1_1NoiseReducer( + input.NoiseReducer, + context + ) + }), + ...(input.TimecodeBurnin !== undefined && { + timecodeBurnin: serializeAws_restJson1_1TimecodeBurnin( + input.TimecodeBurnin, + context + ) + }) + }; }; const serializeAws_restJson1_1VideoSelector = ( input: VideoSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlphaBehavior !== undefined) { - bodyParams["alphaBehavior"] = input.AlphaBehavior; - } - if (input.ColorSpace !== undefined) { - bodyParams["colorSpace"] = input.ColorSpace; - } - if (input.ColorSpaceUsage !== undefined) { - bodyParams["colorSpaceUsage"] = input.ColorSpaceUsage; - } - if (input.Hdr10Metadata !== undefined) { - bodyParams["hdr10Metadata"] = serializeAws_restJson1_1Hdr10Metadata( - input.Hdr10Metadata, - context - ); - } - if (input.Pid !== undefined) { - bodyParams["pid"] = input.Pid; - } - if (input.ProgramNumber !== undefined) { - bodyParams["programNumber"] = input.ProgramNumber; - } - if (input.Rotate !== undefined) { - bodyParams["rotate"] = input.Rotate; - } - return bodyParams; + return { + ...(input.AlphaBehavior !== undefined && { + alphaBehavior: input.AlphaBehavior + }), + ...(input.ColorSpace !== undefined && { colorSpace: input.ColorSpace }), + ...(input.ColorSpaceUsage !== undefined && { + colorSpaceUsage: input.ColorSpaceUsage + }), + ...(input.Hdr10Metadata !== undefined && { + hdr10Metadata: serializeAws_restJson1_1Hdr10Metadata( + input.Hdr10Metadata, + context + ) + }), + ...(input.Pid !== undefined && { pid: input.Pid }), + ...(input.ProgramNumber !== undefined && { + programNumber: input.ProgramNumber + }), + ...(input.Rotate !== undefined && { rotate: input.Rotate }) + }; }; const serializeAws_restJson1_1WavSettings = ( input: WavSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BitDepth !== undefined) { - bodyParams["bitDepth"] = input.BitDepth; - } - if (input.Channels !== undefined) { - bodyParams["channels"] = input.Channels; - } - if (input.Format !== undefined) { - bodyParams["format"] = input.Format; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1__listOfAudioDescription = ( diff --git a/clients/client-medialive/protocols/Aws_restJson1_1.ts b/clients/client-medialive/protocols/Aws_restJson1_1.ts index 64976e00b66a..913472c8c5a7 100644 --- a/clients/client-medialive/protocols/Aws_restJson1_1.ts +++ b/clients/client-medialive/protocols/Aws_restJson1_1.ts @@ -8779,3527 +8779,2927 @@ const serializeAws_restJson1_1AacSettings = ( input: AacSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.InputType !== undefined) { - bodyParams["inputType"] = input.InputType; - } - if (input.Profile !== undefined) { - bodyParams["profile"] = input.Profile; - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.RawFormat !== undefined) { - bodyParams["rawFormat"] = input.RawFormat; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - if (input.Spec !== undefined) { - bodyParams["spec"] = input.Spec; - } - if (input.VbrQuality !== undefined) { - bodyParams["vbrQuality"] = input.VbrQuality; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Ac3Settings = ( input: Ac3Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BitstreamMode !== undefined) { - bodyParams["bitstreamMode"] = input.BitstreamMode; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.Dialnorm !== undefined) { - bodyParams["dialnorm"] = input.Dialnorm; - } - if (input.DrcProfile !== undefined) { - bodyParams["drcProfile"] = input.DrcProfile; - } - if (input.LfeFilter !== undefined) { - bodyParams["lfeFilter"] = input.LfeFilter; - } - if (input.MetadataControl !== undefined) { - bodyParams["metadataControl"] = input.MetadataControl; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1ArchiveContainerSettings = ( input: ArchiveContainerSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.M2tsSettings !== undefined) { - bodyParams["m2tsSettings"] = serializeAws_restJson1_1M2tsSettings( - input.M2tsSettings, - context - ); - } - return bodyParams; + return { + ...(input.M2tsSettings !== undefined && { + m2tsSettings: serializeAws_restJson1_1M2tsSettings( + input.M2tsSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1ArchiveGroupSettings = ( input: ArchiveGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - if (input.RolloverInterval !== undefined) { - bodyParams["rolloverInterval"] = input.RolloverInterval; - } - return bodyParams; + return { + ...(input.Destination !== undefined && { + destination: serializeAws_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }), + ...(input.RolloverInterval !== undefined && { + rolloverInterval: input.RolloverInterval + }) + }; }; const serializeAws_restJson1_1ArchiveOutputSettings = ( input: ArchiveOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerSettings !== undefined) { - bodyParams[ - "containerSettings" - ] = serializeAws_restJson1_1ArchiveContainerSettings( - input.ContainerSettings, - context - ); - } - if (input.Extension !== undefined) { - bodyParams["extension"] = input.Extension; - } - if (input.NameModifier !== undefined) { - bodyParams["nameModifier"] = input.NameModifier; - } - return bodyParams; + return { + ...(input.ContainerSettings !== undefined && { + containerSettings: serializeAws_restJson1_1ArchiveContainerSettings( + input.ContainerSettings, + context + ) + }), + ...(input.Extension !== undefined && { extension: input.Extension }), + ...(input.NameModifier !== undefined && { + nameModifier: input.NameModifier + }) + }; }; const serializeAws_restJson1_1AribDestinationSettings = ( input: AribDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1AribSourceSettings = ( input: AribSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1AudioChannelMapping = ( input: AudioChannelMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputChannelLevels !== undefined) { - bodyParams[ - "inputChannelLevels" - ] = serializeAws_restJson1_1__listOfInputChannelLevel( - input.InputChannelLevels, - context - ); - } - if (input.OutputChannel !== undefined) { - bodyParams["outputChannel"] = input.OutputChannel; - } - return bodyParams; + return { + ...(input.InputChannelLevels !== undefined && { + inputChannelLevels: serializeAws_restJson1_1__listOfInputChannelLevel( + input.InputChannelLevels, + context + ) + }), + ...(input.OutputChannel !== undefined && { + outputChannel: input.OutputChannel + }) + }; }; const serializeAws_restJson1_1AudioCodecSettings = ( input: AudioCodecSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AacSettings !== undefined) { - bodyParams["aacSettings"] = serializeAws_restJson1_1AacSettings( - input.AacSettings, - context - ); - } - if (input.Ac3Settings !== undefined) { - bodyParams["ac3Settings"] = serializeAws_restJson1_1Ac3Settings( - input.Ac3Settings, - context - ); - } - if (input.Eac3Settings !== undefined) { - bodyParams["eac3Settings"] = serializeAws_restJson1_1Eac3Settings( - input.Eac3Settings, - context - ); - } - if (input.Mp2Settings !== undefined) { - bodyParams["mp2Settings"] = serializeAws_restJson1_1Mp2Settings( - input.Mp2Settings, - context - ); - } - if (input.PassThroughSettings !== undefined) { - bodyParams[ - "passThroughSettings" - ] = serializeAws_restJson1_1PassThroughSettings( - input.PassThroughSettings, - context - ); - } - return bodyParams; + return { + ...(input.AacSettings !== undefined && { + aacSettings: serializeAws_restJson1_1AacSettings( + input.AacSettings, + context + ) + }), + ...(input.Ac3Settings !== undefined && { + ac3Settings: serializeAws_restJson1_1Ac3Settings( + input.Ac3Settings, + context + ) + }), + ...(input.Eac3Settings !== undefined && { + eac3Settings: serializeAws_restJson1_1Eac3Settings( + input.Eac3Settings, + context + ) + }), + ...(input.Mp2Settings !== undefined && { + mp2Settings: serializeAws_restJson1_1Mp2Settings( + input.Mp2Settings, + context + ) + }), + ...(input.PassThroughSettings !== undefined && { + passThroughSettings: serializeAws_restJson1_1PassThroughSettings( + input.PassThroughSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1AudioDescription = ( input: AudioDescription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioNormalizationSettings !== undefined) { - bodyParams[ - "audioNormalizationSettings" - ] = serializeAws_restJson1_1AudioNormalizationSettings( - input.AudioNormalizationSettings, - context - ); - } - if (input.AudioSelectorName !== undefined) { - bodyParams["audioSelectorName"] = input.AudioSelectorName; - } - if (input.AudioType !== undefined) { - bodyParams["audioType"] = input.AudioType; - } - if (input.AudioTypeControl !== undefined) { - bodyParams["audioTypeControl"] = input.AudioTypeControl; - } - if (input.CodecSettings !== undefined) { - bodyParams["codecSettings"] = serializeAws_restJson1_1AudioCodecSettings( - input.CodecSettings, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageCodeControl !== undefined) { - bodyParams["languageCodeControl"] = input.LanguageCodeControl; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.RemixSettings !== undefined) { - bodyParams["remixSettings"] = serializeAws_restJson1_1RemixSettings( - input.RemixSettings, - context - ); - } - if (input.StreamName !== undefined) { - bodyParams["streamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.AudioNormalizationSettings !== undefined && { + audioNormalizationSettings: serializeAws_restJson1_1AudioNormalizationSettings( + 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_restJson1_1AudioCodecSettings( + 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_restJson1_1RemixSettings( + input.RemixSettings, + context + ) + }), + ...(input.StreamName !== undefined && { streamName: input.StreamName }) + }; }; const serializeAws_restJson1_1AudioLanguageSelection = ( input: AudioLanguageSelection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageSelectionPolicy !== undefined) { - bodyParams["languageSelectionPolicy"] = input.LanguageSelectionPolicy; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.LanguageSelectionPolicy !== undefined && { + languageSelectionPolicy: input.LanguageSelectionPolicy + }) + }; }; const serializeAws_restJson1_1AudioNormalizationSettings = ( input: AudioNormalizationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Algorithm !== undefined) { - bodyParams["algorithm"] = input.Algorithm; - } - if (input.AlgorithmControl !== undefined) { - bodyParams["algorithmControl"] = input.AlgorithmControl; - } - if (input.TargetLkfs !== undefined) { - bodyParams["targetLkfs"] = input.TargetLkfs; - } - return bodyParams; + return { + ...(input.Algorithm !== undefined && { algorithm: input.Algorithm }), + ...(input.AlgorithmControl !== undefined && { + algorithmControl: input.AlgorithmControl + }), + ...(input.TargetLkfs !== undefined && { targetLkfs: input.TargetLkfs }) + }; }; const serializeAws_restJson1_1AudioOnlyHlsSettings = ( input: AudioOnlyHlsSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioGroupId !== undefined) { - bodyParams["audioGroupId"] = input.AudioGroupId; - } - if (input.AudioOnlyImage !== undefined) { - bodyParams["audioOnlyImage"] = serializeAws_restJson1_1InputLocation( - input.AudioOnlyImage, - context - ); - } - if (input.AudioTrackType !== undefined) { - bodyParams["audioTrackType"] = input.AudioTrackType; - } - if (input.SegmentType !== undefined) { - bodyParams["segmentType"] = input.SegmentType; - } - return bodyParams; + return { + ...(input.AudioGroupId !== undefined && { + audioGroupId: input.AudioGroupId + }), + ...(input.AudioOnlyImage !== undefined && { + audioOnlyImage: serializeAws_restJson1_1InputLocation( + input.AudioOnlyImage, + context + ) + }), + ...(input.AudioTrackType !== undefined && { + audioTrackType: input.AudioTrackType + }), + ...(input.SegmentType !== undefined && { segmentType: input.SegmentType }) + }; }; const serializeAws_restJson1_1AudioPidSelection = ( input: AudioPidSelection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pid !== undefined) { - bodyParams["pid"] = input.Pid; - } - return bodyParams; + return { + ...(input.Pid !== undefined && { pid: input.Pid }) + }; }; const serializeAws_restJson1_1AudioSelector = ( input: AudioSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.SelectorSettings !== undefined) { - bodyParams[ - "selectorSettings" - ] = serializeAws_restJson1_1AudioSelectorSettings( - input.SelectorSettings, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { name: input.Name }), + ...(input.SelectorSettings !== undefined && { + selectorSettings: serializeAws_restJson1_1AudioSelectorSettings( + input.SelectorSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1AudioSelectorSettings = ( input: AudioSelectorSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioLanguageSelection !== undefined) { - bodyParams[ - "audioLanguageSelection" - ] = serializeAws_restJson1_1AudioLanguageSelection( - input.AudioLanguageSelection, - context - ); - } - if (input.AudioPidSelection !== undefined) { - bodyParams["audioPidSelection"] = serializeAws_restJson1_1AudioPidSelection( - input.AudioPidSelection, - context - ); - } - return bodyParams; + return { + ...(input.AudioLanguageSelection !== undefined && { + audioLanguageSelection: serializeAws_restJson1_1AudioLanguageSelection( + input.AudioLanguageSelection, + context + ) + }), + ...(input.AudioPidSelection !== undefined && { + audioPidSelection: serializeAws_restJson1_1AudioPidSelection( + input.AudioPidSelection, + context + ) + }) + }; }; const serializeAws_restJson1_1AvailBlanking = ( input: AvailBlanking, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailBlankingImage !== undefined) { - bodyParams["availBlankingImage"] = serializeAws_restJson1_1InputLocation( - input.AvailBlankingImage, - context - ); - } - if (input.State !== undefined) { - bodyParams["state"] = input.State; - } - return bodyParams; + return { + ...(input.AvailBlankingImage !== undefined && { + availBlankingImage: serializeAws_restJson1_1InputLocation( + input.AvailBlankingImage, + context + ) + }), + ...(input.State !== undefined && { state: input.State }) + }; }; const serializeAws_restJson1_1AvailConfiguration = ( input: AvailConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailSettings !== undefined) { - bodyParams["availSettings"] = serializeAws_restJson1_1AvailSettings( - input.AvailSettings, - context - ); - } - return bodyParams; + return { + ...(input.AvailSettings !== undefined && { + availSettings: serializeAws_restJson1_1AvailSettings( + input.AvailSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1AvailSettings = ( input: AvailSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Scte35SpliceInsert !== undefined) { - bodyParams[ - "scte35SpliceInsert" - ] = serializeAws_restJson1_1Scte35SpliceInsert( - input.Scte35SpliceInsert, - context - ); - } - if (input.Scte35TimeSignalApos !== undefined) { - bodyParams[ - "scte35TimeSignalApos" - ] = serializeAws_restJson1_1Scte35TimeSignalApos( - input.Scte35TimeSignalApos, - context - ); - } - return bodyParams; + return { + ...(input.Scte35SpliceInsert !== undefined && { + scte35SpliceInsert: serializeAws_restJson1_1Scte35SpliceInsert( + input.Scte35SpliceInsert, + context + ) + }), + ...(input.Scte35TimeSignalApos !== undefined && { + scte35TimeSignalApos: serializeAws_restJson1_1Scte35TimeSignalApos( + input.Scte35TimeSignalApos, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchScheduleActionCreateRequest = ( input: BatchScheduleActionCreateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScheduleActions !== undefined) { - bodyParams[ - "scheduleActions" - ] = serializeAws_restJson1_1__listOfScheduleAction( - input.ScheduleActions, - context - ); - } - return bodyParams; + return { + ...(input.ScheduleActions !== undefined && { + scheduleActions: serializeAws_restJson1_1__listOfScheduleAction( + input.ScheduleActions, + context + ) + }) + }; }; const serializeAws_restJson1_1BatchScheduleActionDeleteRequest = ( input: BatchScheduleActionDeleteRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActionNames !== undefined) { - bodyParams["actionNames"] = serializeAws_restJson1_1__listOf__string( - input.ActionNames, - context - ); - } - return bodyParams; + return { + ...(input.ActionNames !== undefined && { + actionNames: serializeAws_restJson1_1__listOf__string( + input.ActionNames, + context + ) + }) + }; }; const serializeAws_restJson1_1BlackoutSlate = ( input: BlackoutSlate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlackoutSlateImage !== undefined) { - bodyParams["blackoutSlateImage"] = serializeAws_restJson1_1InputLocation( - input.BlackoutSlateImage, - context - ); - } - if (input.NetworkEndBlackout !== undefined) { - bodyParams["networkEndBlackout"] = input.NetworkEndBlackout; - } - if (input.NetworkEndBlackoutImage !== undefined) { - bodyParams[ - "networkEndBlackoutImage" - ] = serializeAws_restJson1_1InputLocation( - input.NetworkEndBlackoutImage, - context - ); - } - if (input.NetworkId !== undefined) { - bodyParams["networkId"] = input.NetworkId; - } - if (input.State !== undefined) { - bodyParams["state"] = input.State; - } - return bodyParams; + return { + ...(input.BlackoutSlateImage !== undefined && { + blackoutSlateImage: serializeAws_restJson1_1InputLocation( + input.BlackoutSlateImage, + context + ) + }), + ...(input.NetworkEndBlackout !== undefined && { + networkEndBlackout: input.NetworkEndBlackout + }), + ...(input.NetworkEndBlackoutImage !== undefined && { + networkEndBlackoutImage: serializeAws_restJson1_1InputLocation( + input.NetworkEndBlackoutImage, + context + ) + }), + ...(input.NetworkId !== undefined && { networkId: input.NetworkId }), + ...(input.State !== undefined && { state: input.State }) + }; }; const serializeAws_restJson1_1BurnInDestinationSettings = ( input: BurnInDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alignment !== undefined) { - bodyParams["alignment"] = input.Alignment; - } - if (input.BackgroundColor !== undefined) { - bodyParams["backgroundColor"] = input.BackgroundColor; - } - if (input.BackgroundOpacity !== undefined) { - bodyParams["backgroundOpacity"] = input.BackgroundOpacity; - } - if (input.Font !== undefined) { - bodyParams["font"] = serializeAws_restJson1_1InputLocation( - input.Font, - context - ); - } - if (input.FontColor !== undefined) { - bodyParams["fontColor"] = input.FontColor; - } - if (input.FontOpacity !== undefined) { - bodyParams["fontOpacity"] = input.FontOpacity; - } - if (input.FontResolution !== undefined) { - bodyParams["fontResolution"] = input.FontResolution; - } - if (input.FontSize !== undefined) { - bodyParams["fontSize"] = input.FontSize; - } - if (input.OutlineColor !== undefined) { - bodyParams["outlineColor"] = input.OutlineColor; - } - if (input.OutlineSize !== undefined) { - bodyParams["outlineSize"] = input.OutlineSize; - } - if (input.ShadowColor !== undefined) { - bodyParams["shadowColor"] = input.ShadowColor; - } - if (input.ShadowOpacity !== undefined) { - bodyParams["shadowOpacity"] = input.ShadowOpacity; - } - if (input.ShadowXOffset !== undefined) { - bodyParams["shadowXOffset"] = input.ShadowXOffset; - } - if (input.ShadowYOffset !== undefined) { - bodyParams["shadowYOffset"] = input.ShadowYOffset; - } - if (input.TeletextGridControl !== undefined) { - bodyParams["teletextGridControl"] = input.TeletextGridControl; - } - if (input.XPosition !== undefined) { - bodyParams["xPosition"] = input.XPosition; - } - if (input.YPosition !== undefined) { - bodyParams["yPosition"] = input.YPosition; - } - return bodyParams; + return { + ...(input.Alignment !== undefined && { alignment: input.Alignment }), + ...(input.BackgroundColor !== undefined && { + backgroundColor: input.BackgroundColor + }), + ...(input.BackgroundOpacity !== undefined && { + backgroundOpacity: input.BackgroundOpacity + }), + ...(input.Font !== undefined && { + font: serializeAws_restJson1_1InputLocation(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 }) + }; }; const serializeAws_restJson1_1CaptionDescription = ( input: CaptionDescription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionSelectorName !== undefined) { - bodyParams["captionSelectorName"] = input.CaptionSelectorName; - } - if (input.DestinationSettings !== undefined) { - bodyParams[ - "destinationSettings" - ] = serializeAws_restJson1_1CaptionDestinationSettings( - input.DestinationSettings, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageDescription !== undefined) { - bodyParams["languageDescription"] = input.LanguageDescription; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - return bodyParams; + return { + ...(input.CaptionSelectorName !== undefined && { + captionSelectorName: input.CaptionSelectorName + }), + ...(input.DestinationSettings !== undefined && { + destinationSettings: serializeAws_restJson1_1CaptionDestinationSettings( + input.DestinationSettings, + context + ) + }), + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.LanguageDescription !== undefined && { + languageDescription: input.LanguageDescription + }), + ...(input.Name !== undefined && { name: input.Name }) + }; }; const serializeAws_restJson1_1CaptionDestinationSettings = ( input: CaptionDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AribDestinationSettings !== undefined) { - bodyParams[ - "aribDestinationSettings" - ] = serializeAws_restJson1_1AribDestinationSettings( - input.AribDestinationSettings, - context - ); - } - if (input.BurnInDestinationSettings !== undefined) { - bodyParams[ - "burnInDestinationSettings" - ] = serializeAws_restJson1_1BurnInDestinationSettings( - input.BurnInDestinationSettings, - context - ); - } - if (input.DvbSubDestinationSettings !== undefined) { - bodyParams[ - "dvbSubDestinationSettings" - ] = serializeAws_restJson1_1DvbSubDestinationSettings( - input.DvbSubDestinationSettings, - context - ); - } - if (input.EmbeddedDestinationSettings !== undefined) { - bodyParams[ - "embeddedDestinationSettings" - ] = serializeAws_restJson1_1EmbeddedDestinationSettings( - input.EmbeddedDestinationSettings, - context - ); - } - if (input.EmbeddedPlusScte20DestinationSettings !== undefined) { - bodyParams[ - "embeddedPlusScte20DestinationSettings" - ] = serializeAws_restJson1_1EmbeddedPlusScte20DestinationSettings( - input.EmbeddedPlusScte20DestinationSettings, - context - ); - } - if (input.RtmpCaptionInfoDestinationSettings !== undefined) { - bodyParams[ - "rtmpCaptionInfoDestinationSettings" - ] = serializeAws_restJson1_1RtmpCaptionInfoDestinationSettings( - input.RtmpCaptionInfoDestinationSettings, - context - ); - } - if (input.Scte20PlusEmbeddedDestinationSettings !== undefined) { - bodyParams[ - "scte20PlusEmbeddedDestinationSettings" - ] = serializeAws_restJson1_1Scte20PlusEmbeddedDestinationSettings( - input.Scte20PlusEmbeddedDestinationSettings, - context - ); - } - if (input.Scte27DestinationSettings !== undefined) { - bodyParams[ - "scte27DestinationSettings" - ] = serializeAws_restJson1_1Scte27DestinationSettings( - input.Scte27DestinationSettings, - context - ); - } - if (input.SmpteTtDestinationSettings !== undefined) { - bodyParams[ - "smpteTtDestinationSettings" - ] = serializeAws_restJson1_1SmpteTtDestinationSettings( - input.SmpteTtDestinationSettings, - context - ); - } - if (input.TeletextDestinationSettings !== undefined) { - bodyParams[ - "teletextDestinationSettings" - ] = serializeAws_restJson1_1TeletextDestinationSettings( - input.TeletextDestinationSettings, - context - ); - } - if (input.TtmlDestinationSettings !== undefined) { - bodyParams[ - "ttmlDestinationSettings" - ] = serializeAws_restJson1_1TtmlDestinationSettings( - input.TtmlDestinationSettings, - context - ); - } - if (input.WebvttDestinationSettings !== undefined) { - bodyParams[ - "webvttDestinationSettings" - ] = serializeAws_restJson1_1WebvttDestinationSettings( - input.WebvttDestinationSettings, - context - ); - } - return bodyParams; + return { + ...(input.AribDestinationSettings !== undefined && { + aribDestinationSettings: serializeAws_restJson1_1AribDestinationSettings( + input.AribDestinationSettings, + context + ) + }), + ...(input.BurnInDestinationSettings !== undefined && { + burnInDestinationSettings: serializeAws_restJson1_1BurnInDestinationSettings( + input.BurnInDestinationSettings, + context + ) + }), + ...(input.DvbSubDestinationSettings !== undefined && { + dvbSubDestinationSettings: serializeAws_restJson1_1DvbSubDestinationSettings( + input.DvbSubDestinationSettings, + context + ) + }), + ...(input.EmbeddedDestinationSettings !== undefined && { + embeddedDestinationSettings: serializeAws_restJson1_1EmbeddedDestinationSettings( + input.EmbeddedDestinationSettings, + context + ) + }), + ...(input.EmbeddedPlusScte20DestinationSettings !== undefined && { + embeddedPlusScte20DestinationSettings: serializeAws_restJson1_1EmbeddedPlusScte20DestinationSettings( + input.EmbeddedPlusScte20DestinationSettings, + context + ) + }), + ...(input.RtmpCaptionInfoDestinationSettings !== undefined && { + rtmpCaptionInfoDestinationSettings: serializeAws_restJson1_1RtmpCaptionInfoDestinationSettings( + input.RtmpCaptionInfoDestinationSettings, + context + ) + }), + ...(input.Scte20PlusEmbeddedDestinationSettings !== undefined && { + scte20PlusEmbeddedDestinationSettings: serializeAws_restJson1_1Scte20PlusEmbeddedDestinationSettings( + input.Scte20PlusEmbeddedDestinationSettings, + context + ) + }), + ...(input.Scte27DestinationSettings !== undefined && { + scte27DestinationSettings: serializeAws_restJson1_1Scte27DestinationSettings( + input.Scte27DestinationSettings, + context + ) + }), + ...(input.SmpteTtDestinationSettings !== undefined && { + smpteTtDestinationSettings: serializeAws_restJson1_1SmpteTtDestinationSettings( + input.SmpteTtDestinationSettings, + context + ) + }), + ...(input.TeletextDestinationSettings !== undefined && { + teletextDestinationSettings: serializeAws_restJson1_1TeletextDestinationSettings( + input.TeletextDestinationSettings, + context + ) + }), + ...(input.TtmlDestinationSettings !== undefined && { + ttmlDestinationSettings: serializeAws_restJson1_1TtmlDestinationSettings( + input.TtmlDestinationSettings, + context + ) + }), + ...(input.WebvttDestinationSettings !== undefined && { + webvttDestinationSettings: serializeAws_restJson1_1WebvttDestinationSettings( + input.WebvttDestinationSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1CaptionLanguageMapping = ( input: CaptionLanguageMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptionChannel !== undefined) { - bodyParams["captionChannel"] = input.CaptionChannel; - } - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.LanguageDescription !== undefined) { - bodyParams["languageDescription"] = input.LanguageDescription; - } - return bodyParams; + return { + ...(input.CaptionChannel !== undefined && { + captionChannel: input.CaptionChannel + }), + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.LanguageDescription !== undefined && { + languageDescription: input.LanguageDescription + }) + }; }; const serializeAws_restJson1_1CaptionSelector = ( input: CaptionSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["languageCode"] = input.LanguageCode; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.SelectorSettings !== undefined) { - bodyParams[ - "selectorSettings" - ] = serializeAws_restJson1_1CaptionSelectorSettings( - input.SelectorSettings, - context - ); - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + languageCode: input.LanguageCode + }), + ...(input.Name !== undefined && { name: input.Name }), + ...(input.SelectorSettings !== undefined && { + selectorSettings: serializeAws_restJson1_1CaptionSelectorSettings( + input.SelectorSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1CaptionSelectorSettings = ( input: CaptionSelectorSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AribSourceSettings !== undefined) { - bodyParams[ - "aribSourceSettings" - ] = serializeAws_restJson1_1AribSourceSettings( - input.AribSourceSettings, - context - ); - } - if (input.DvbSubSourceSettings !== undefined) { - bodyParams[ - "dvbSubSourceSettings" - ] = serializeAws_restJson1_1DvbSubSourceSettings( - input.DvbSubSourceSettings, - context - ); - } - if (input.EmbeddedSourceSettings !== undefined) { - bodyParams[ - "embeddedSourceSettings" - ] = serializeAws_restJson1_1EmbeddedSourceSettings( - input.EmbeddedSourceSettings, - context - ); - } - if (input.Scte20SourceSettings !== undefined) { - bodyParams[ - "scte20SourceSettings" - ] = serializeAws_restJson1_1Scte20SourceSettings( - input.Scte20SourceSettings, - context - ); - } - if (input.Scte27SourceSettings !== undefined) { - bodyParams[ - "scte27SourceSettings" - ] = serializeAws_restJson1_1Scte27SourceSettings( - input.Scte27SourceSettings, - context - ); - } - if (input.TeletextSourceSettings !== undefined) { - bodyParams[ - "teletextSourceSettings" - ] = serializeAws_restJson1_1TeletextSourceSettings( - input.TeletextSourceSettings, - context - ); - } - return bodyParams; + return { + ...(input.AribSourceSettings !== undefined && { + aribSourceSettings: serializeAws_restJson1_1AribSourceSettings( + input.AribSourceSettings, + context + ) + }), + ...(input.DvbSubSourceSettings !== undefined && { + dvbSubSourceSettings: serializeAws_restJson1_1DvbSubSourceSettings( + input.DvbSubSourceSettings, + context + ) + }), + ...(input.EmbeddedSourceSettings !== undefined && { + embeddedSourceSettings: serializeAws_restJson1_1EmbeddedSourceSettings( + input.EmbeddedSourceSettings, + context + ) + }), + ...(input.Scte20SourceSettings !== undefined && { + scte20SourceSettings: serializeAws_restJson1_1Scte20SourceSettings( + input.Scte20SourceSettings, + context + ) + }), + ...(input.Scte27SourceSettings !== undefined && { + scte27SourceSettings: serializeAws_restJson1_1Scte27SourceSettings( + input.Scte27SourceSettings, + context + ) + }), + ...(input.TeletextSourceSettings !== undefined && { + teletextSourceSettings: serializeAws_restJson1_1TeletextSourceSettings( + input.TeletextSourceSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1ColorSpacePassthroughSettings = ( input: ColorSpacePassthroughSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1DvbNitSettings = ( input: DvbNitSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NetworkId !== undefined) { - bodyParams["networkId"] = input.NetworkId; - } - if (input.NetworkName !== undefined) { - bodyParams["networkName"] = input.NetworkName; - } - if (input.RepInterval !== undefined) { - bodyParams["repInterval"] = input.RepInterval; - } - return bodyParams; + return { + ...(input.NetworkId !== undefined && { networkId: input.NetworkId }), + ...(input.NetworkName !== undefined && { networkName: input.NetworkName }), + ...(input.RepInterval !== undefined && { repInterval: input.RepInterval }) + }; }; const serializeAws_restJson1_1DvbSdtSettings = ( input: DvbSdtSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputSdt !== undefined) { - bodyParams["outputSdt"] = input.OutputSdt; - } - if (input.RepInterval !== undefined) { - bodyParams["repInterval"] = input.RepInterval; - } - if (input.ServiceName !== undefined) { - bodyParams["serviceName"] = input.ServiceName; - } - if (input.ServiceProviderName !== undefined) { - bodyParams["serviceProviderName"] = input.ServiceProviderName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1DvbSubDestinationSettings = ( input: DvbSubDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alignment !== undefined) { - bodyParams["alignment"] = input.Alignment; - } - if (input.BackgroundColor !== undefined) { - bodyParams["backgroundColor"] = input.BackgroundColor; - } - if (input.BackgroundOpacity !== undefined) { - bodyParams["backgroundOpacity"] = input.BackgroundOpacity; - } - if (input.Font !== undefined) { - bodyParams["font"] = serializeAws_restJson1_1InputLocation( - input.Font, - context - ); - } - if (input.FontColor !== undefined) { - bodyParams["fontColor"] = input.FontColor; - } - if (input.FontOpacity !== undefined) { - bodyParams["fontOpacity"] = input.FontOpacity; - } - if (input.FontResolution !== undefined) { - bodyParams["fontResolution"] = input.FontResolution; - } - if (input.FontSize !== undefined) { - bodyParams["fontSize"] = input.FontSize; - } - if (input.OutlineColor !== undefined) { - bodyParams["outlineColor"] = input.OutlineColor; - } - if (input.OutlineSize !== undefined) { - bodyParams["outlineSize"] = input.OutlineSize; - } - if (input.ShadowColor !== undefined) { - bodyParams["shadowColor"] = input.ShadowColor; - } - if (input.ShadowOpacity !== undefined) { - bodyParams["shadowOpacity"] = input.ShadowOpacity; - } - if (input.ShadowXOffset !== undefined) { - bodyParams["shadowXOffset"] = input.ShadowXOffset; - } - if (input.ShadowYOffset !== undefined) { - bodyParams["shadowYOffset"] = input.ShadowYOffset; - } - if (input.TeletextGridControl !== undefined) { - bodyParams["teletextGridControl"] = input.TeletextGridControl; - } - if (input.XPosition !== undefined) { - bodyParams["xPosition"] = input.XPosition; - } - if (input.YPosition !== undefined) { - bodyParams["yPosition"] = input.YPosition; - } - return bodyParams; + return { + ...(input.Alignment !== undefined && { alignment: input.Alignment }), + ...(input.BackgroundColor !== undefined && { + backgroundColor: input.BackgroundColor + }), + ...(input.BackgroundOpacity !== undefined && { + backgroundOpacity: input.BackgroundOpacity + }), + ...(input.Font !== undefined && { + font: serializeAws_restJson1_1InputLocation(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 }) + }; }; const serializeAws_restJson1_1DvbSubSourceSettings = ( input: DvbSubSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pid !== undefined) { - bodyParams["pid"] = input.Pid; - } - return bodyParams; + return { + ...(input.Pid !== undefined && { pid: input.Pid }) + }; }; const serializeAws_restJson1_1DvbTdtSettings = ( input: DvbTdtSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RepInterval !== undefined) { - bodyParams["repInterval"] = input.RepInterval; - } - return bodyParams; + return { + ...(input.RepInterval !== undefined && { repInterval: input.RepInterval }) + }; }; const serializeAws_restJson1_1Eac3Settings = ( input: Eac3Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttenuationControl !== undefined) { - bodyParams["attenuationControl"] = input.AttenuationControl; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BitstreamMode !== undefined) { - bodyParams["bitstreamMode"] = input.BitstreamMode; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.DcFilter !== undefined) { - bodyParams["dcFilter"] = input.DcFilter; - } - if (input.Dialnorm !== undefined) { - bodyParams["dialnorm"] = input.Dialnorm; - } - if (input.DrcLine !== undefined) { - bodyParams["drcLine"] = input.DrcLine; - } - if (input.DrcRf !== undefined) { - bodyParams["drcRf"] = input.DrcRf; - } - if (input.LfeControl !== undefined) { - bodyParams["lfeControl"] = input.LfeControl; - } - if (input.LfeFilter !== undefined) { - bodyParams["lfeFilter"] = input.LfeFilter; - } - if (input.LoRoCenterMixLevel !== undefined) { - bodyParams["loRoCenterMixLevel"] = input.LoRoCenterMixLevel; - } - if (input.LoRoSurroundMixLevel !== undefined) { - bodyParams["loRoSurroundMixLevel"] = input.LoRoSurroundMixLevel; - } - if (input.LtRtCenterMixLevel !== undefined) { - bodyParams["ltRtCenterMixLevel"] = input.LtRtCenterMixLevel; - } - if (input.LtRtSurroundMixLevel !== undefined) { - bodyParams["ltRtSurroundMixLevel"] = input.LtRtSurroundMixLevel; - } - if (input.MetadataControl !== undefined) { - bodyParams["metadataControl"] = input.MetadataControl; - } - if (input.PassthroughControl !== undefined) { - bodyParams["passthroughControl"] = input.PassthroughControl; - } - if (input.PhaseControl !== undefined) { - bodyParams["phaseControl"] = input.PhaseControl; - } - if (input.StereoDownmix !== undefined) { - bodyParams["stereoDownmix"] = input.StereoDownmix; - } - if (input.SurroundExMode !== undefined) { - bodyParams["surroundExMode"] = input.SurroundExMode; - } - if (input.SurroundMode !== undefined) { - bodyParams["surroundMode"] = input.SurroundMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1EmbeddedDestinationSettings = ( input: EmbeddedDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1EmbeddedPlusScte20DestinationSettings = ( input: EmbeddedPlusScte20DestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1EmbeddedSourceSettings = ( input: EmbeddedSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Convert608To708 !== undefined) { - bodyParams["convert608To708"] = input.Convert608To708; - } - if (input.Scte20Detection !== undefined) { - bodyParams["scte20Detection"] = input.Scte20Detection; - } - if (input.Source608ChannelNumber !== undefined) { - bodyParams["source608ChannelNumber"] = input.Source608ChannelNumber; - } - if (input.Source608TrackNumber !== undefined) { - bodyParams["source608TrackNumber"] = input.Source608TrackNumber; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1EncoderSettings = ( input: EncoderSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioDescriptions !== undefined) { - bodyParams[ - "audioDescriptions" - ] = serializeAws_restJson1_1__listOfAudioDescription( - input.AudioDescriptions, - context - ); - } - if (input.AvailBlanking !== undefined) { - bodyParams["availBlanking"] = serializeAws_restJson1_1AvailBlanking( - input.AvailBlanking, - context - ); - } - if (input.AvailConfiguration !== undefined) { - bodyParams[ - "availConfiguration" - ] = serializeAws_restJson1_1AvailConfiguration( - input.AvailConfiguration, - context - ); - } - if (input.BlackoutSlate !== undefined) { - bodyParams["blackoutSlate"] = serializeAws_restJson1_1BlackoutSlate( - input.BlackoutSlate, - context - ); - } - if (input.CaptionDescriptions !== undefined) { - bodyParams[ - "captionDescriptions" - ] = serializeAws_restJson1_1__listOfCaptionDescription( - input.CaptionDescriptions, - context - ); - } - if (input.GlobalConfiguration !== undefined) { - bodyParams[ - "globalConfiguration" - ] = serializeAws_restJson1_1GlobalConfiguration( - input.GlobalConfiguration, - context - ); - } - if (input.NielsenConfiguration !== undefined) { - bodyParams[ - "nielsenConfiguration" - ] = serializeAws_restJson1_1NielsenConfiguration( - input.NielsenConfiguration, - context - ); - } - if (input.OutputGroups !== undefined) { - bodyParams["outputGroups"] = serializeAws_restJson1_1__listOfOutputGroup( - input.OutputGroups, - context - ); - } - if (input.TimecodeConfig !== undefined) { - bodyParams["timecodeConfig"] = serializeAws_restJson1_1TimecodeConfig( - input.TimecodeConfig, - context - ); - } - if (input.VideoDescriptions !== undefined) { - bodyParams[ - "videoDescriptions" - ] = serializeAws_restJson1_1__listOfVideoDescription( - input.VideoDescriptions, - context - ); - } - return bodyParams; + return { + ...(input.AudioDescriptions !== undefined && { + audioDescriptions: serializeAws_restJson1_1__listOfAudioDescription( + input.AudioDescriptions, + context + ) + }), + ...(input.AvailBlanking !== undefined && { + availBlanking: serializeAws_restJson1_1AvailBlanking( + input.AvailBlanking, + context + ) + }), + ...(input.AvailConfiguration !== undefined && { + availConfiguration: serializeAws_restJson1_1AvailConfiguration( + input.AvailConfiguration, + context + ) + }), + ...(input.BlackoutSlate !== undefined && { + blackoutSlate: serializeAws_restJson1_1BlackoutSlate( + input.BlackoutSlate, + context + ) + }), + ...(input.CaptionDescriptions !== undefined && { + captionDescriptions: serializeAws_restJson1_1__listOfCaptionDescription( + input.CaptionDescriptions, + context + ) + }), + ...(input.GlobalConfiguration !== undefined && { + globalConfiguration: serializeAws_restJson1_1GlobalConfiguration( + input.GlobalConfiguration, + context + ) + }), + ...(input.NielsenConfiguration !== undefined && { + nielsenConfiguration: serializeAws_restJson1_1NielsenConfiguration( + input.NielsenConfiguration, + context + ) + }), + ...(input.OutputGroups !== undefined && { + outputGroups: serializeAws_restJson1_1__listOfOutputGroup( + input.OutputGroups, + context + ) + }), + ...(input.TimecodeConfig !== undefined && { + timecodeConfig: serializeAws_restJson1_1TimecodeConfig( + input.TimecodeConfig, + context + ) + }), + ...(input.VideoDescriptions !== undefined && { + videoDescriptions: serializeAws_restJson1_1__listOfVideoDescription( + input.VideoDescriptions, + context + ) + }) + }; }; const serializeAws_restJson1_1FecOutputSettings = ( input: FecOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnDepth !== undefined) { - bodyParams["columnDepth"] = input.ColumnDepth; - } - if (input.IncludeFec !== undefined) { - bodyParams["includeFec"] = input.IncludeFec; - } - if (input.RowLength !== undefined) { - bodyParams["rowLength"] = input.RowLength; - } - return bodyParams; + return { + ...(input.ColumnDepth !== undefined && { columnDepth: input.ColumnDepth }), + ...(input.IncludeFec !== undefined && { includeFec: input.IncludeFec }), + ...(input.RowLength !== undefined && { rowLength: input.RowLength }) + }; }; const serializeAws_restJson1_1FixedModeScheduleActionStartSettings = ( input: FixedModeScheduleActionStartSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Time !== undefined) { - bodyParams["time"] = input.Time; - } - return bodyParams; + return { + ...(input.Time !== undefined && { time: input.Time }) + }; }; const serializeAws_restJson1_1Fmp4HlsSettings = ( input: Fmp4HlsSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioRenditionSets !== undefined) { - bodyParams["audioRenditionSets"] = input.AudioRenditionSets; - } - return bodyParams; + return { + ...(input.AudioRenditionSets !== undefined && { + audioRenditionSets: input.AudioRenditionSets + }) + }; }; const serializeAws_restJson1_1FollowModeScheduleActionStartSettings = ( input: FollowModeScheduleActionStartSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FollowPoint !== undefined) { - bodyParams["followPoint"] = input.FollowPoint; - } - if (input.ReferenceActionName !== undefined) { - bodyParams["referenceActionName"] = input.ReferenceActionName; - } - return bodyParams; + return { + ...(input.FollowPoint !== undefined && { followPoint: input.FollowPoint }), + ...(input.ReferenceActionName !== undefined && { + referenceActionName: input.ReferenceActionName + }) + }; }; const serializeAws_restJson1_1FrameCaptureGroupSettings = ( input: FrameCaptureGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - return bodyParams; + return { + ...(input.Destination !== undefined && { + destination: serializeAws_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }) + }; }; const serializeAws_restJson1_1FrameCaptureOutputSettings = ( input: FrameCaptureOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NameModifier !== undefined) { - bodyParams["nameModifier"] = input.NameModifier; - } - return bodyParams; + return { + ...(input.NameModifier !== undefined && { + nameModifier: input.NameModifier + }) + }; }; const serializeAws_restJson1_1FrameCaptureSettings = ( input: FrameCaptureSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptureInterval !== undefined) { - bodyParams["captureInterval"] = input.CaptureInterval; - } - if (input.CaptureIntervalUnits !== undefined) { - bodyParams["captureIntervalUnits"] = input.CaptureIntervalUnits; - } - return bodyParams; + return { + ...(input.CaptureInterval !== undefined && { + captureInterval: input.CaptureInterval + }), + ...(input.CaptureIntervalUnits !== undefined && { + captureIntervalUnits: input.CaptureIntervalUnits + }) + }; }; const serializeAws_restJson1_1GlobalConfiguration = ( input: GlobalConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InitialAudioGain !== undefined) { - bodyParams["initialAudioGain"] = input.InitialAudioGain; - } - if (input.InputEndAction !== undefined) { - bodyParams["inputEndAction"] = input.InputEndAction; - } - if (input.InputLossBehavior !== undefined) { - bodyParams["inputLossBehavior"] = serializeAws_restJson1_1InputLossBehavior( - input.InputLossBehavior, - context - ); - } - if (input.OutputLockingMode !== undefined) { - bodyParams["outputLockingMode"] = input.OutputLockingMode; - } - if (input.OutputTimingSource !== undefined) { - bodyParams["outputTimingSource"] = input.OutputTimingSource; - } - if (input.SupportLowFramerateInputs !== undefined) { - bodyParams["supportLowFramerateInputs"] = input.SupportLowFramerateInputs; - } - return bodyParams; + return { + ...(input.InitialAudioGain !== undefined && { + initialAudioGain: input.InitialAudioGain + }), + ...(input.InputEndAction !== undefined && { + inputEndAction: input.InputEndAction + }), + ...(input.InputLossBehavior !== undefined && { + inputLossBehavior: serializeAws_restJson1_1InputLossBehavior( + input.InputLossBehavior, + context + ) + }), + ...(input.OutputLockingMode !== undefined && { + outputLockingMode: input.OutputLockingMode + }), + ...(input.OutputTimingSource !== undefined && { + outputTimingSource: input.OutputTimingSource + }), + ...(input.SupportLowFramerateInputs !== undefined && { + supportLowFramerateInputs: input.SupportLowFramerateInputs + }) + }; }; const serializeAws_restJson1_1H264ColorSpaceSettings = ( input: H264ColorSpaceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColorSpacePassthroughSettings !== undefined) { - bodyParams[ - "colorSpacePassthroughSettings" - ] = serializeAws_restJson1_1ColorSpacePassthroughSettings( - input.ColorSpacePassthroughSettings, - context - ); - } - if (input.Rec601Settings !== undefined) { - bodyParams["rec601Settings"] = serializeAws_restJson1_1Rec601Settings( - input.Rec601Settings, - context - ); - } - if (input.Rec709Settings !== undefined) { - bodyParams["rec709Settings"] = serializeAws_restJson1_1Rec709Settings( - input.Rec709Settings, - context - ); - } - return bodyParams; + return { + ...(input.ColorSpacePassthroughSettings !== undefined && { + colorSpacePassthroughSettings: serializeAws_restJson1_1ColorSpacePassthroughSettings( + input.ColorSpacePassthroughSettings, + context + ) + }), + ...(input.Rec601Settings !== undefined && { + rec601Settings: serializeAws_restJson1_1Rec601Settings( + input.Rec601Settings, + context + ) + }), + ...(input.Rec709Settings !== undefined && { + rec709Settings: serializeAws_restJson1_1Rec709Settings( + input.Rec709Settings, + context + ) + }) + }; }; const serializeAws_restJson1_1H264Settings = ( input: H264Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdaptiveQuantization !== undefined) { - bodyParams["adaptiveQuantization"] = input.AdaptiveQuantization; - } - if (input.AfdSignaling !== undefined) { - bodyParams["afdSignaling"] = input.AfdSignaling; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BufFillPct !== undefined) { - bodyParams["bufFillPct"] = input.BufFillPct; - } - if (input.BufSize !== undefined) { - bodyParams["bufSize"] = input.BufSize; - } - if (input.ColorMetadata !== undefined) { - bodyParams["colorMetadata"] = input.ColorMetadata; - } - if (input.ColorSpaceSettings !== undefined) { - bodyParams[ - "colorSpaceSettings" - ] = serializeAws_restJson1_1H264ColorSpaceSettings( - input.ColorSpaceSettings, - context - ); - } - if (input.EntropyEncoding !== undefined) { - bodyParams["entropyEncoding"] = input.EntropyEncoding; - } - if (input.FixedAfd !== undefined) { - bodyParams["fixedAfd"] = input.FixedAfd; - } - if (input.FlickerAq !== undefined) { - bodyParams["flickerAq"] = input.FlickerAq; - } - if (input.FramerateControl !== undefined) { - bodyParams["framerateControl"] = input.FramerateControl; - } - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.GopBReference !== undefined) { - bodyParams["gopBReference"] = input.GopBReference; - } - if (input.GopClosedCadence !== undefined) { - bodyParams["gopClosedCadence"] = input.GopClosedCadence; - } - if (input.GopNumBFrames !== undefined) { - bodyParams["gopNumBFrames"] = input.GopNumBFrames; - } - if (input.GopSize !== undefined) { - bodyParams["gopSize"] = input.GopSize; - } - if (input.GopSizeUnits !== undefined) { - bodyParams["gopSizeUnits"] = input.GopSizeUnits; - } - if (input.Level !== undefined) { - bodyParams["level"] = input.Level; - } - if (input.LookAheadRateControl !== undefined) { - bodyParams["lookAheadRateControl"] = input.LookAheadRateControl; - } - if (input.MaxBitrate !== undefined) { - bodyParams["maxBitrate"] = input.MaxBitrate; - } - if (input.MinIInterval !== undefined) { - bodyParams["minIInterval"] = input.MinIInterval; - } - if (input.NumRefFrames !== undefined) { - bodyParams["numRefFrames"] = input.NumRefFrames; - } - if (input.ParControl !== undefined) { - bodyParams["parControl"] = input.ParControl; - } - if (input.ParDenominator !== undefined) { - bodyParams["parDenominator"] = input.ParDenominator; - } - if (input.ParNumerator !== undefined) { - bodyParams["parNumerator"] = input.ParNumerator; - } - if (input.Profile !== undefined) { - bodyParams["profile"] = input.Profile; - } - if (input.QvbrQualityLevel !== undefined) { - bodyParams["qvbrQualityLevel"] = input.QvbrQualityLevel; - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.ScanType !== undefined) { - bodyParams["scanType"] = input.ScanType; - } - if (input.SceneChangeDetect !== undefined) { - bodyParams["sceneChangeDetect"] = input.SceneChangeDetect; - } - if (input.Slices !== undefined) { - bodyParams["slices"] = input.Slices; - } - if (input.Softness !== undefined) { - bodyParams["softness"] = input.Softness; - } - if (input.SpatialAq !== undefined) { - bodyParams["spatialAq"] = input.SpatialAq; - } - if (input.SubgopLength !== undefined) { - bodyParams["subgopLength"] = input.SubgopLength; - } - if (input.Syntax !== undefined) { - bodyParams["syntax"] = input.Syntax; - } - if (input.TemporalAq !== undefined) { - bodyParams["temporalAq"] = input.TemporalAq; - } - if (input.TimecodeInsertion !== undefined) { - bodyParams["timecodeInsertion"] = input.TimecodeInsertion; - } - return bodyParams; + 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_restJson1_1H264ColorSpaceSettings( + input.ColorSpaceSettings, + context + ) + }), + ...(input.EntropyEncoding !== undefined && { + entropyEncoding: input.EntropyEncoding + }), + ...(input.FixedAfd !== undefined && { fixedAfd: input.FixedAfd }), + ...(input.FlickerAq !== undefined && { flickerAq: input.FlickerAq }), + ...(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.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 + }) + }; }; const serializeAws_restJson1_1H265ColorSpaceSettings = ( input: H265ColorSpaceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColorSpacePassthroughSettings !== undefined) { - bodyParams[ - "colorSpacePassthroughSettings" - ] = serializeAws_restJson1_1ColorSpacePassthroughSettings( - input.ColorSpacePassthroughSettings, - context - ); - } - if (input.Hdr10Settings !== undefined) { - bodyParams["hdr10Settings"] = serializeAws_restJson1_1Hdr10Settings( - input.Hdr10Settings, - context - ); - } - if (input.Rec601Settings !== undefined) { - bodyParams["rec601Settings"] = serializeAws_restJson1_1Rec601Settings( - input.Rec601Settings, - context - ); - } - if (input.Rec709Settings !== undefined) { - bodyParams["rec709Settings"] = serializeAws_restJson1_1Rec709Settings( - input.Rec709Settings, - context - ); - } - return bodyParams; + return { + ...(input.ColorSpacePassthroughSettings !== undefined && { + colorSpacePassthroughSettings: serializeAws_restJson1_1ColorSpacePassthroughSettings( + input.ColorSpacePassthroughSettings, + context + ) + }), + ...(input.Hdr10Settings !== undefined && { + hdr10Settings: serializeAws_restJson1_1Hdr10Settings( + input.Hdr10Settings, + context + ) + }), + ...(input.Rec601Settings !== undefined && { + rec601Settings: serializeAws_restJson1_1Rec601Settings( + input.Rec601Settings, + context + ) + }), + ...(input.Rec709Settings !== undefined && { + rec709Settings: serializeAws_restJson1_1Rec709Settings( + input.Rec709Settings, + context + ) + }) + }; }; const serializeAws_restJson1_1H265Settings = ( input: H265Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdaptiveQuantization !== undefined) { - bodyParams["adaptiveQuantization"] = input.AdaptiveQuantization; - } - if (input.AfdSignaling !== undefined) { - bodyParams["afdSignaling"] = input.AfdSignaling; - } - if (input.AlternativeTransferFunction !== undefined) { - bodyParams["alternativeTransferFunction"] = - input.AlternativeTransferFunction; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BufSize !== undefined) { - bodyParams["bufSize"] = input.BufSize; - } - if (input.ColorMetadata !== undefined) { - bodyParams["colorMetadata"] = input.ColorMetadata; - } - if (input.ColorSpaceSettings !== undefined) { - bodyParams[ - "colorSpaceSettings" - ] = serializeAws_restJson1_1H265ColorSpaceSettings( - input.ColorSpaceSettings, - context - ); - } - if (input.FixedAfd !== undefined) { - bodyParams["fixedAfd"] = input.FixedAfd; - } - if (input.FlickerAq !== undefined) { - bodyParams["flickerAq"] = input.FlickerAq; - } - if (input.FramerateDenominator !== undefined) { - bodyParams["framerateDenominator"] = input.FramerateDenominator; - } - if (input.FramerateNumerator !== undefined) { - bodyParams["framerateNumerator"] = input.FramerateNumerator; - } - if (input.GopClosedCadence !== undefined) { - bodyParams["gopClosedCadence"] = input.GopClosedCadence; - } - if (input.GopSize !== undefined) { - bodyParams["gopSize"] = input.GopSize; - } - if (input.GopSizeUnits !== undefined) { - bodyParams["gopSizeUnits"] = input.GopSizeUnits; - } - if (input.Level !== undefined) { - bodyParams["level"] = input.Level; - } - if (input.LookAheadRateControl !== undefined) { - bodyParams["lookAheadRateControl"] = input.LookAheadRateControl; - } - if (input.MaxBitrate !== undefined) { - bodyParams["maxBitrate"] = input.MaxBitrate; - } - if (input.MinIInterval !== undefined) { - bodyParams["minIInterval"] = input.MinIInterval; - } - if (input.ParDenominator !== undefined) { - bodyParams["parDenominator"] = input.ParDenominator; - } - if (input.ParNumerator !== undefined) { - bodyParams["parNumerator"] = input.ParNumerator; - } - if (input.Profile !== undefined) { - bodyParams["profile"] = input.Profile; - } - if (input.QvbrQualityLevel !== undefined) { - bodyParams["qvbrQualityLevel"] = input.QvbrQualityLevel; - } - if (input.RateControlMode !== undefined) { - bodyParams["rateControlMode"] = input.RateControlMode; - } - if (input.ScanType !== undefined) { - bodyParams["scanType"] = input.ScanType; - } - if (input.SceneChangeDetect !== undefined) { - bodyParams["sceneChangeDetect"] = input.SceneChangeDetect; - } - if (input.Slices !== undefined) { - bodyParams["slices"] = input.Slices; - } - if (input.Tier !== undefined) { - bodyParams["tier"] = input.Tier; - } - if (input.TimecodeInsertion !== undefined) { - bodyParams["timecodeInsertion"] = input.TimecodeInsertion; - } - return bodyParams; + 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_restJson1_1H265ColorSpaceSettings( + input.ColorSpaceSettings, + 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 + }) + }; }; const serializeAws_restJson1_1Hdr10Settings = ( input: Hdr10Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxCll !== undefined) { - bodyParams["maxCll"] = input.MaxCll; - } - if (input.MaxFall !== undefined) { - bodyParams["maxFall"] = input.MaxFall; - } - return bodyParams; + return { + ...(input.MaxCll !== undefined && { maxCll: input.MaxCll }), + ...(input.MaxFall !== undefined && { maxFall: input.MaxFall }) + }; }; const serializeAws_restJson1_1HlsAkamaiSettings = ( input: HlsAkamaiSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionRetryInterval !== undefined) { - bodyParams["connectionRetryInterval"] = input.ConnectionRetryInterval; - } - if (input.FilecacheDuration !== undefined) { - bodyParams["filecacheDuration"] = input.FilecacheDuration; - } - if (input.HttpTransferMode !== undefined) { - bodyParams["httpTransferMode"] = input.HttpTransferMode; - } - if (input.NumRetries !== undefined) { - bodyParams["numRetries"] = input.NumRetries; - } - if (input.RestartDelay !== undefined) { - bodyParams["restartDelay"] = input.RestartDelay; - } - if (input.Salt !== undefined) { - bodyParams["salt"] = input.Salt; - } - if (input.Token !== undefined) { - bodyParams["token"] = input.Token; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1HlsBasicPutSettings = ( input: HlsBasicPutSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionRetryInterval !== undefined) { - bodyParams["connectionRetryInterval"] = input.ConnectionRetryInterval; - } - if (input.FilecacheDuration !== undefined) { - bodyParams["filecacheDuration"] = input.FilecacheDuration; - } - if (input.NumRetries !== undefined) { - bodyParams["numRetries"] = input.NumRetries; - } - if (input.RestartDelay !== undefined) { - bodyParams["restartDelay"] = input.RestartDelay; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1HlsCdnSettings = ( input: HlsCdnSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HlsAkamaiSettings !== undefined) { - bodyParams["hlsAkamaiSettings"] = serializeAws_restJson1_1HlsAkamaiSettings( - input.HlsAkamaiSettings, - context - ); - } - if (input.HlsBasicPutSettings !== undefined) { - bodyParams[ - "hlsBasicPutSettings" - ] = serializeAws_restJson1_1HlsBasicPutSettings( - input.HlsBasicPutSettings, - context - ); - } - if (input.HlsMediaStoreSettings !== undefined) { - bodyParams[ - "hlsMediaStoreSettings" - ] = serializeAws_restJson1_1HlsMediaStoreSettings( - input.HlsMediaStoreSettings, - context - ); - } - if (input.HlsWebdavSettings !== undefined) { - bodyParams["hlsWebdavSettings"] = serializeAws_restJson1_1HlsWebdavSettings( - input.HlsWebdavSettings, - context - ); - } - return bodyParams; + return { + ...(input.HlsAkamaiSettings !== undefined && { + hlsAkamaiSettings: serializeAws_restJson1_1HlsAkamaiSettings( + input.HlsAkamaiSettings, + context + ) + }), + ...(input.HlsBasicPutSettings !== undefined && { + hlsBasicPutSettings: serializeAws_restJson1_1HlsBasicPutSettings( + input.HlsBasicPutSettings, + context + ) + }), + ...(input.HlsMediaStoreSettings !== undefined && { + hlsMediaStoreSettings: serializeAws_restJson1_1HlsMediaStoreSettings( + input.HlsMediaStoreSettings, + context + ) + }), + ...(input.HlsWebdavSettings !== undefined && { + hlsWebdavSettings: serializeAws_restJson1_1HlsWebdavSettings( + input.HlsWebdavSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1HlsGroupSettings = ( input: HlsGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdMarkers !== undefined) { - bodyParams["adMarkers"] = serializeAws_restJson1_1__listOfHlsAdMarkers( - input.AdMarkers, - context - ); - } - if (input.BaseUrlContent !== undefined) { - bodyParams["baseUrlContent"] = input.BaseUrlContent; - } - if (input.BaseUrlContent1 !== undefined) { - bodyParams["baseUrlContent1"] = input.BaseUrlContent1; - } - if (input.BaseUrlManifest !== undefined) { - bodyParams["baseUrlManifest"] = input.BaseUrlManifest; - } - if (input.BaseUrlManifest1 !== undefined) { - bodyParams["baseUrlManifest1"] = input.BaseUrlManifest1; - } - if (input.CaptionLanguageMappings !== undefined) { - bodyParams[ - "captionLanguageMappings" - ] = serializeAws_restJson1_1__listOfCaptionLanguageMapping( - input.CaptionLanguageMappings, - context - ); - } - if (input.CaptionLanguageSetting !== undefined) { - bodyParams["captionLanguageSetting"] = input.CaptionLanguageSetting; - } - if (input.ClientCache !== undefined) { - bodyParams["clientCache"] = input.ClientCache; - } - if (input.CodecSpecification !== undefined) { - bodyParams["codecSpecification"] = input.CodecSpecification; - } - if (input.ConstantIv !== undefined) { - bodyParams["constantIv"] = input.ConstantIv; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - if (input.DirectoryStructure !== undefined) { - bodyParams["directoryStructure"] = input.DirectoryStructure; - } - if (input.EncryptionType !== undefined) { - bodyParams["encryptionType"] = input.EncryptionType; - } - if (input.HlsCdnSettings !== undefined) { - bodyParams["hlsCdnSettings"] = serializeAws_restJson1_1HlsCdnSettings( - input.HlsCdnSettings, - context - ); - } - if (input.HlsId3SegmentTagging !== undefined) { - bodyParams["hlsId3SegmentTagging"] = input.HlsId3SegmentTagging; - } - if (input.IFrameOnlyPlaylists !== undefined) { - bodyParams["iFrameOnlyPlaylists"] = input.IFrameOnlyPlaylists; - } - if (input.IndexNSegments !== undefined) { - bodyParams["indexNSegments"] = input.IndexNSegments; - } - if (input.InputLossAction !== undefined) { - bodyParams["inputLossAction"] = input.InputLossAction; - } - if (input.IvInManifest !== undefined) { - bodyParams["ivInManifest"] = input.IvInManifest; - } - if (input.IvSource !== undefined) { - bodyParams["ivSource"] = input.IvSource; - } - if (input.KeepSegments !== undefined) { - bodyParams["keepSegments"] = input.KeepSegments; - } - if (input.KeyFormat !== undefined) { - bodyParams["keyFormat"] = input.KeyFormat; - } - if (input.KeyFormatVersions !== undefined) { - bodyParams["keyFormatVersions"] = input.KeyFormatVersions; - } - if (input.KeyProviderSettings !== undefined) { - bodyParams[ - "keyProviderSettings" - ] = serializeAws_restJson1_1KeyProviderSettings( - input.KeyProviderSettings, - context - ); - } - if (input.ManifestCompression !== undefined) { - bodyParams["manifestCompression"] = input.ManifestCompression; - } - if (input.ManifestDurationFormat !== undefined) { - bodyParams["manifestDurationFormat"] = input.ManifestDurationFormat; - } - if (input.MinSegmentLength !== undefined) { - bodyParams["minSegmentLength"] = input.MinSegmentLength; - } - if (input.Mode !== undefined) { - bodyParams["mode"] = input.Mode; - } - if (input.OutputSelection !== undefined) { - bodyParams["outputSelection"] = input.OutputSelection; - } - if (input.ProgramDateTime !== undefined) { - bodyParams["programDateTime"] = input.ProgramDateTime; - } - if (input.ProgramDateTimePeriod !== undefined) { - bodyParams["programDateTimePeriod"] = input.ProgramDateTimePeriod; - } - if (input.RedundantManifest !== undefined) { - bodyParams["redundantManifest"] = input.RedundantManifest; - } - if (input.SegmentLength !== undefined) { - bodyParams["segmentLength"] = input.SegmentLength; - } - if (input.SegmentationMode !== undefined) { - bodyParams["segmentationMode"] = input.SegmentationMode; - } - if (input.SegmentsPerSubdirectory !== undefined) { - bodyParams["segmentsPerSubdirectory"] = input.SegmentsPerSubdirectory; - } - if (input.StreamInfResolution !== undefined) { - bodyParams["streamInfResolution"] = input.StreamInfResolution; - } - if (input.TimedMetadataId3Frame !== undefined) { - bodyParams["timedMetadataId3Frame"] = input.TimedMetadataId3Frame; - } - if (input.TimedMetadataId3Period !== undefined) { - bodyParams["timedMetadataId3Period"] = input.TimedMetadataId3Period; - } - if (input.TimestampDeltaMilliseconds !== undefined) { - bodyParams["timestampDeltaMilliseconds"] = input.TimestampDeltaMilliseconds; - } - if (input.TsFileMode !== undefined) { - bodyParams["tsFileMode"] = input.TsFileMode; - } - return bodyParams; + return { + ...(input.AdMarkers !== undefined && { + adMarkers: serializeAws_restJson1_1__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_1__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_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }), + ...(input.DirectoryStructure !== undefined && { + directoryStructure: input.DirectoryStructure + }), + ...(input.EncryptionType !== undefined && { + encryptionType: input.EncryptionType + }), + ...(input.HlsCdnSettings !== undefined && { + hlsCdnSettings: serializeAws_restJson1_1HlsCdnSettings( + input.HlsCdnSettings, + context + ) + }), + ...(input.HlsId3SegmentTagging !== undefined && { + hlsId3SegmentTagging: input.HlsId3SegmentTagging + }), + ...(input.IFrameOnlyPlaylists !== undefined && { + iFrameOnlyPlaylists: input.IFrameOnlyPlaylists + }), + ...(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_restJson1_1KeyProviderSettings( + 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 }) + }; }; const serializeAws_restJson1_1HlsId3SegmentTaggingScheduleActionSettings = ( input: HlsId3SegmentTaggingScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Tag !== undefined) { - bodyParams["tag"] = input.Tag; - } - return bodyParams; + return { + ...(input.Tag !== undefined && { tag: input.Tag }) + }; }; const serializeAws_restJson1_1HlsInputSettings = ( input: HlsInputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bandwidth !== undefined) { - bodyParams["bandwidth"] = input.Bandwidth; - } - if (input.BufferSegments !== undefined) { - bodyParams["bufferSegments"] = input.BufferSegments; - } - if (input.Retries !== undefined) { - bodyParams["retries"] = input.Retries; - } - if (input.RetryInterval !== undefined) { - bodyParams["retryInterval"] = input.RetryInterval; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1HlsMediaStoreSettings = ( input: HlsMediaStoreSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionRetryInterval !== undefined) { - bodyParams["connectionRetryInterval"] = input.ConnectionRetryInterval; - } - if (input.FilecacheDuration !== undefined) { - bodyParams["filecacheDuration"] = input.FilecacheDuration; - } - if (input.MediaStoreStorageClass !== undefined) { - bodyParams["mediaStoreStorageClass"] = input.MediaStoreStorageClass; - } - if (input.NumRetries !== undefined) { - bodyParams["numRetries"] = input.NumRetries; - } - if (input.RestartDelay !== undefined) { - bodyParams["restartDelay"] = input.RestartDelay; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1HlsOutputSettings = ( input: HlsOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.H265PackagingType !== undefined) { - bodyParams["h265PackagingType"] = input.H265PackagingType; - } - if (input.HlsSettings !== undefined) { - bodyParams["hlsSettings"] = serializeAws_restJson1_1HlsSettings( - input.HlsSettings, - context - ); - } - if (input.NameModifier !== undefined) { - bodyParams["nameModifier"] = input.NameModifier; - } - if (input.SegmentModifier !== undefined) { - bodyParams["segmentModifier"] = input.SegmentModifier; - } - return bodyParams; + return { + ...(input.H265PackagingType !== undefined && { + h265PackagingType: input.H265PackagingType + }), + ...(input.HlsSettings !== undefined && { + hlsSettings: serializeAws_restJson1_1HlsSettings( + input.HlsSettings, + context + ) + }), + ...(input.NameModifier !== undefined && { + nameModifier: input.NameModifier + }), + ...(input.SegmentModifier !== undefined && { + segmentModifier: input.SegmentModifier + }) + }; }; const serializeAws_restJson1_1HlsSettings = ( input: HlsSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioOnlyHlsSettings !== undefined) { - bodyParams[ - "audioOnlyHlsSettings" - ] = serializeAws_restJson1_1AudioOnlyHlsSettings( - input.AudioOnlyHlsSettings, - context - ); - } - if (input.Fmp4HlsSettings !== undefined) { - bodyParams["fmp4HlsSettings"] = serializeAws_restJson1_1Fmp4HlsSettings( - input.Fmp4HlsSettings, - context - ); - } - if (input.StandardHlsSettings !== undefined) { - bodyParams[ - "standardHlsSettings" - ] = serializeAws_restJson1_1StandardHlsSettings( - input.StandardHlsSettings, - context - ); - } - return bodyParams; + return { + ...(input.AudioOnlyHlsSettings !== undefined && { + audioOnlyHlsSettings: serializeAws_restJson1_1AudioOnlyHlsSettings( + input.AudioOnlyHlsSettings, + context + ) + }), + ...(input.Fmp4HlsSettings !== undefined && { + fmp4HlsSettings: serializeAws_restJson1_1Fmp4HlsSettings( + input.Fmp4HlsSettings, + context + ) + }), + ...(input.StandardHlsSettings !== undefined && { + standardHlsSettings: serializeAws_restJson1_1StandardHlsSettings( + input.StandardHlsSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1HlsTimedMetadataScheduleActionSettings = ( input: HlsTimedMetadataScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id3 !== undefined) { - bodyParams["id3"] = input.Id3; - } - return bodyParams; + return { + ...(input.Id3 !== undefined && { id3: input.Id3 }) + }; }; const serializeAws_restJson1_1HlsWebdavSettings = ( input: HlsWebdavSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionRetryInterval !== undefined) { - bodyParams["connectionRetryInterval"] = input.ConnectionRetryInterval; - } - if (input.FilecacheDuration !== undefined) { - bodyParams["filecacheDuration"] = input.FilecacheDuration; - } - if (input.HttpTransferMode !== undefined) { - bodyParams["httpTransferMode"] = input.HttpTransferMode; - } - if (input.NumRetries !== undefined) { - bodyParams["numRetries"] = input.NumRetries; - } - if (input.RestartDelay !== undefined) { - bodyParams["restartDelay"] = input.RestartDelay; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1ImmediateModeScheduleActionStartSettings = ( input: ImmediateModeScheduleActionStartSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1InputAttachment = ( input: InputAttachment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputAttachmentName !== undefined) { - bodyParams["inputAttachmentName"] = input.InputAttachmentName; - } - if (input.InputId !== undefined) { - bodyParams["inputId"] = input.InputId; - } - if (input.InputSettings !== undefined) { - bodyParams["inputSettings"] = serializeAws_restJson1_1InputSettings( - input.InputSettings, - context - ); - } - return bodyParams; + return { + ...(input.InputAttachmentName !== undefined && { + inputAttachmentName: input.InputAttachmentName + }), + ...(input.InputId !== undefined && { inputId: input.InputId }), + ...(input.InputSettings !== undefined && { + inputSettings: serializeAws_restJson1_1InputSettings( + input.InputSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1InputChannelLevel = ( input: InputChannelLevel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Gain !== undefined) { - bodyParams["gain"] = input.Gain; - } - if (input.InputChannel !== undefined) { - bodyParams["inputChannel"] = input.InputChannel; - } - return bodyParams; + return { + ...(input.Gain !== undefined && { gain: input.Gain }), + ...(input.InputChannel !== undefined && { + inputChannel: input.InputChannel + }) + }; }; const serializeAws_restJson1_1InputClippingSettings = ( input: InputClippingSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputTimecodeSource !== undefined) { - bodyParams["inputTimecodeSource"] = input.InputTimecodeSource; - } - if (input.StartTimecode !== undefined) { - bodyParams["startTimecode"] = serializeAws_restJson1_1StartTimecode( - input.StartTimecode, - context - ); - } - if (input.StopTimecode !== undefined) { - bodyParams["stopTimecode"] = serializeAws_restJson1_1StopTimecode( - input.StopTimecode, - context - ); - } - return bodyParams; + return { + ...(input.InputTimecodeSource !== undefined && { + inputTimecodeSource: input.InputTimecodeSource + }), + ...(input.StartTimecode !== undefined && { + startTimecode: serializeAws_restJson1_1StartTimecode( + input.StartTimecode, + context + ) + }), + ...(input.StopTimecode !== undefined && { + stopTimecode: serializeAws_restJson1_1StopTimecode( + input.StopTimecode, + context + ) + }) + }; }; const serializeAws_restJson1_1InputDestinationRequest = ( input: InputDestinationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StreamName !== undefined) { - bodyParams["streamName"] = input.StreamName; - } - return bodyParams; + return { + ...(input.StreamName !== undefined && { streamName: input.StreamName }) + }; }; const serializeAws_restJson1_1InputLocation = ( input: InputLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PasswordParam !== undefined) { - bodyParams["passwordParam"] = input.PasswordParam; - } - if (input.Uri !== undefined) { - bodyParams["uri"] = input.Uri; - } - if (input.Username !== undefined) { - bodyParams["username"] = input.Username; - } - return bodyParams; + return { + ...(input.PasswordParam !== undefined && { + passwordParam: input.PasswordParam + }), + ...(input.Uri !== undefined && { uri: input.Uri }), + ...(input.Username !== undefined && { username: input.Username }) + }; }; const serializeAws_restJson1_1InputLossBehavior = ( input: InputLossBehavior, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BlackFrameMsec !== undefined) { - bodyParams["blackFrameMsec"] = input.BlackFrameMsec; - } - if (input.InputLossImageColor !== undefined) { - bodyParams["inputLossImageColor"] = input.InputLossImageColor; - } - if (input.InputLossImageSlate !== undefined) { - bodyParams["inputLossImageSlate"] = serializeAws_restJson1_1InputLocation( - input.InputLossImageSlate, - context - ); - } - if (input.InputLossImageType !== undefined) { - bodyParams["inputLossImageType"] = input.InputLossImageType; - } - if (input.RepeatFrameMsec !== undefined) { - bodyParams["repeatFrameMsec"] = input.RepeatFrameMsec; - } - return bodyParams; + return { + ...(input.BlackFrameMsec !== undefined && { + blackFrameMsec: input.BlackFrameMsec + }), + ...(input.InputLossImageColor !== undefined && { + inputLossImageColor: input.InputLossImageColor + }), + ...(input.InputLossImageSlate !== undefined && { + inputLossImageSlate: serializeAws_restJson1_1InputLocation( + input.InputLossImageSlate, + context + ) + }), + ...(input.InputLossImageType !== undefined && { + inputLossImageType: input.InputLossImageType + }), + ...(input.RepeatFrameMsec !== undefined && { + repeatFrameMsec: input.RepeatFrameMsec + }) + }; }; const serializeAws_restJson1_1InputSettings = ( input: InputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioSelectors !== undefined) { - bodyParams[ - "audioSelectors" - ] = serializeAws_restJson1_1__listOfAudioSelector( - input.AudioSelectors, - context - ); - } - if (input.CaptionSelectors !== undefined) { - bodyParams[ - "captionSelectors" - ] = serializeAws_restJson1_1__listOfCaptionSelector( - input.CaptionSelectors, - context - ); - } - if (input.DeblockFilter !== undefined) { - bodyParams["deblockFilter"] = input.DeblockFilter; - } - if (input.DenoiseFilter !== undefined) { - bodyParams["denoiseFilter"] = input.DenoiseFilter; - } - if (input.FilterStrength !== undefined) { - bodyParams["filterStrength"] = input.FilterStrength; - } - if (input.InputFilter !== undefined) { - bodyParams["inputFilter"] = input.InputFilter; - } - if (input.NetworkInputSettings !== undefined) { - bodyParams[ - "networkInputSettings" - ] = serializeAws_restJson1_1NetworkInputSettings( - input.NetworkInputSettings, - context - ); - } - if (input.SourceEndBehavior !== undefined) { - bodyParams["sourceEndBehavior"] = input.SourceEndBehavior; - } - if (input.VideoSelector !== undefined) { - bodyParams["videoSelector"] = serializeAws_restJson1_1VideoSelector( - input.VideoSelector, - context - ); - } - return bodyParams; + return { + ...(input.AudioSelectors !== undefined && { + audioSelectors: serializeAws_restJson1_1__listOfAudioSelector( + input.AudioSelectors, + context + ) + }), + ...(input.CaptionSelectors !== undefined && { + captionSelectors: serializeAws_restJson1_1__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_restJson1_1NetworkInputSettings( + input.NetworkInputSettings, + context + ) + }), + ...(input.SourceEndBehavior !== undefined && { + sourceEndBehavior: input.SourceEndBehavior + }), + ...(input.VideoSelector !== undefined && { + videoSelector: serializeAws_restJson1_1VideoSelector( + input.VideoSelector, + context + ) + }) + }; }; const serializeAws_restJson1_1InputSourceRequest = ( input: InputSourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PasswordParam !== undefined) { - bodyParams["passwordParam"] = input.PasswordParam; - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - if (input.Username !== undefined) { - bodyParams["username"] = input.Username; - } - return bodyParams; + return { + ...(input.PasswordParam !== undefined && { + passwordParam: input.PasswordParam + }), + ...(input.Url !== undefined && { url: input.Url }), + ...(input.Username !== undefined && { username: input.Username }) + }; }; const serializeAws_restJson1_1InputSpecification = ( input: InputSpecification, context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Codec !== undefined) { - bodyParams["codec"] = input.Codec; - } - if (input.MaximumBitrate !== undefined) { - bodyParams["maximumBitrate"] = input.MaximumBitrate; - } - if (input.Resolution !== undefined) { - bodyParams["resolution"] = input.Resolution; - } - return bodyParams; -}; - -const serializeAws_restJson1_1InputSwitchScheduleActionSettings = ( - input: InputSwitchScheduleActionSettings, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.InputAttachmentNameReference !== undefined) { - bodyParams["inputAttachmentNameReference"] = - input.InputAttachmentNameReference; - } - if (input.InputClippingSettings !== undefined) { - bodyParams[ - "inputClippingSettings" - ] = serializeAws_restJson1_1InputClippingSettings( - input.InputClippingSettings, - context - ); - } - if (input.UrlPath !== undefined) { - bodyParams["urlPath"] = serializeAws_restJson1_1__listOf__string( - input.UrlPath, - context - ); - } - return bodyParams; -}; - -const serializeAws_restJson1_1InputVpcRequest = ( - input: InputVpcRequest, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["securityGroupIds"] = serializeAws_restJson1_1__listOf__string( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["subnetIds"] = serializeAws_restJson1_1__listOf__string( - input.SubnetIds, - context - ); - } - return bodyParams; -}; - -const serializeAws_restJson1_1InputWhitelistRuleCidr = ( - input: InputWhitelistRuleCidr, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Cidr !== undefined) { - bodyParams["cidr"] = input.Cidr; - } - return bodyParams; -}; - -const serializeAws_restJson1_1KeyProviderSettings = ( - input: KeyProviderSettings, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.StaticKeySettings !== undefined) { - bodyParams["staticKeySettings"] = serializeAws_restJson1_1StaticKeySettings( - input.StaticKeySettings, - context - ); - } - return bodyParams; -}; - -const serializeAws_restJson1_1M2tsSettings = ( - input: M2tsSettings, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.AbsentInputAudioBehavior !== undefined) { - bodyParams["absentInputAudioBehavior"] = input.AbsentInputAudioBehavior; - } - if (input.Arib !== undefined) { - bodyParams["arib"] = input.Arib; - } - if (input.AribCaptionsPid !== undefined) { - bodyParams["aribCaptionsPid"] = input.AribCaptionsPid; - } - if (input.AribCaptionsPidControl !== undefined) { - bodyParams["aribCaptionsPidControl"] = input.AribCaptionsPidControl; - } - if (input.AudioBufferModel !== undefined) { - bodyParams["audioBufferModel"] = input.AudioBufferModel; - } - if (input.AudioFramesPerPes !== undefined) { - bodyParams["audioFramesPerPes"] = input.AudioFramesPerPes; - } - if (input.AudioPids !== undefined) { - bodyParams["audioPids"] = input.AudioPids; - } - if (input.AudioStreamType !== undefined) { - bodyParams["audioStreamType"] = input.AudioStreamType; - } - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.BufferModel !== undefined) { - bodyParams["bufferModel"] = input.BufferModel; - } - if (input.CcDescriptor !== undefined) { - bodyParams["ccDescriptor"] = input.CcDescriptor; - } - if (input.DvbNitSettings !== undefined) { - bodyParams["dvbNitSettings"] = serializeAws_restJson1_1DvbNitSettings( - input.DvbNitSettings, - context - ); - } - if (input.DvbSdtSettings !== undefined) { - bodyParams["dvbSdtSettings"] = serializeAws_restJson1_1DvbSdtSettings( - input.DvbSdtSettings, - context - ); - } - if (input.DvbSubPids !== undefined) { - bodyParams["dvbSubPids"] = input.DvbSubPids; - } - if (input.DvbTdtSettings !== undefined) { - bodyParams["dvbTdtSettings"] = serializeAws_restJson1_1DvbTdtSettings( - input.DvbTdtSettings, - context - ); - } - if (input.DvbTeletextPid !== undefined) { - bodyParams["dvbTeletextPid"] = input.DvbTeletextPid; - } - if (input.Ebif !== undefined) { - bodyParams["ebif"] = input.Ebif; - } - if (input.EbpAudioInterval !== undefined) { - bodyParams["ebpAudioInterval"] = input.EbpAudioInterval; - } - if (input.EbpLookaheadMs !== undefined) { - bodyParams["ebpLookaheadMs"] = input.EbpLookaheadMs; - } - if (input.EbpPlacement !== undefined) { - bodyParams["ebpPlacement"] = input.EbpPlacement; - } - if (input.EcmPid !== undefined) { - bodyParams["ecmPid"] = input.EcmPid; - } - if (input.EsRateInPes !== undefined) { - bodyParams["esRateInPes"] = input.EsRateInPes; - } - if (input.EtvPlatformPid !== undefined) { - bodyParams["etvPlatformPid"] = input.EtvPlatformPid; - } - if (input.EtvSignalPid !== undefined) { - bodyParams["etvSignalPid"] = input.EtvSignalPid; - } - if (input.FragmentTime !== undefined) { - bodyParams["fragmentTime"] = input.FragmentTime; - } - if (input.Klv !== undefined) { - bodyParams["klv"] = input.Klv; - } - if (input.KlvDataPids !== undefined) { - bodyParams["klvDataPids"] = input.KlvDataPids; - } - if (input.NielsenId3Behavior !== undefined) { - bodyParams["nielsenId3Behavior"] = input.NielsenId3Behavior; - } - if (input.NullPacketBitrate !== undefined) { - bodyParams["nullPacketBitrate"] = input.NullPacketBitrate; - } - if (input.PatInterval !== undefined) { - bodyParams["patInterval"] = input.PatInterval; - } - if (input.PcrControl !== undefined) { - bodyParams["pcrControl"] = input.PcrControl; - } - if (input.PcrPeriod !== undefined) { - bodyParams["pcrPeriod"] = input.PcrPeriod; - } - if (input.PcrPid !== undefined) { - bodyParams["pcrPid"] = input.PcrPid; - } - if (input.PmtInterval !== undefined) { - bodyParams["pmtInterval"] = input.PmtInterval; - } - if (input.PmtPid !== undefined) { - bodyParams["pmtPid"] = input.PmtPid; - } - if (input.ProgramNum !== undefined) { - bodyParams["programNum"] = input.ProgramNum; - } - if (input.RateMode !== undefined) { - bodyParams["rateMode"] = input.RateMode; - } - if (input.Scte27Pids !== undefined) { - bodyParams["scte27Pids"] = input.Scte27Pids; - } - if (input.Scte35Control !== undefined) { - bodyParams["scte35Control"] = input.Scte35Control; - } - if (input.Scte35Pid !== undefined) { - bodyParams["scte35Pid"] = input.Scte35Pid; - } - if (input.SegmentationMarkers !== undefined) { - bodyParams["segmentationMarkers"] = input.SegmentationMarkers; - } - if (input.SegmentationStyle !== undefined) { - bodyParams["segmentationStyle"] = input.SegmentationStyle; - } - if (input.SegmentationTime !== undefined) { - bodyParams["segmentationTime"] = input.SegmentationTime; - } - if (input.TimedMetadataBehavior !== undefined) { - bodyParams["timedMetadataBehavior"] = input.TimedMetadataBehavior; - } - if (input.TimedMetadataPid !== undefined) { - bodyParams["timedMetadataPid"] = input.TimedMetadataPid; - } - if (input.TransportStreamId !== undefined) { - bodyParams["transportStreamId"] = input.TransportStreamId; - } - if (input.VideoPid !== undefined) { - bodyParams["videoPid"] = input.VideoPid; - } - return bodyParams; +): any => { + return { + ...(input.Codec !== undefined && { codec: input.Codec }), + ...(input.MaximumBitrate !== undefined && { + maximumBitrate: input.MaximumBitrate + }), + ...(input.Resolution !== undefined && { resolution: input.Resolution }) + }; +}; + +const serializeAws_restJson1_1InputSwitchScheduleActionSettings = ( + input: InputSwitchScheduleActionSettings, + context: __SerdeContext +): any => { + return { + ...(input.InputAttachmentNameReference !== undefined && { + inputAttachmentNameReference: input.InputAttachmentNameReference + }), + ...(input.InputClippingSettings !== undefined && { + inputClippingSettings: serializeAws_restJson1_1InputClippingSettings( + input.InputClippingSettings, + context + ) + }), + ...(input.UrlPath !== undefined && { + urlPath: serializeAws_restJson1_1__listOf__string(input.UrlPath, context) + }) + }; +}; + +const serializeAws_restJson1_1InputVpcRequest = ( + input: InputVpcRequest, + context: __SerdeContext +): any => { + return { + ...(input.SecurityGroupIds !== undefined && { + securityGroupIds: serializeAws_restJson1_1__listOf__string( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + subnetIds: serializeAws_restJson1_1__listOf__string( + input.SubnetIds, + context + ) + }) + }; +}; + +const serializeAws_restJson1_1InputWhitelistRuleCidr = ( + input: InputWhitelistRuleCidr, + context: __SerdeContext +): any => { + return { + ...(input.Cidr !== undefined && { cidr: input.Cidr }) + }; +}; + +const serializeAws_restJson1_1KeyProviderSettings = ( + input: KeyProviderSettings, + context: __SerdeContext +): any => { + return { + ...(input.StaticKeySettings !== undefined && { + staticKeySettings: serializeAws_restJson1_1StaticKeySettings( + input.StaticKeySettings, + context + ) + }) + }; +}; + +const serializeAws_restJson1_1M2tsSettings = ( + 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_restJson1_1DvbNitSettings( + input.DvbNitSettings, + context + ) + }), + ...(input.DvbSdtSettings !== undefined && { + dvbSdtSettings: serializeAws_restJson1_1DvbSdtSettings( + input.DvbSdtSettings, + context + ) + }), + ...(input.DvbSubPids !== undefined && { dvbSubPids: input.DvbSubPids }), + ...(input.DvbTdtSettings !== undefined && { + dvbTdtSettings: serializeAws_restJson1_1DvbTdtSettings( + 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 }) + }; }; const serializeAws_restJson1_1M3u8Settings = ( input: M3u8Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioFramesPerPes !== undefined) { - bodyParams["audioFramesPerPes"] = input.AudioFramesPerPes; - } - if (input.AudioPids !== undefined) { - bodyParams["audioPids"] = input.AudioPids; - } - if (input.EcmPid !== undefined) { - bodyParams["ecmPid"] = input.EcmPid; - } - if (input.NielsenId3Behavior !== undefined) { - bodyParams["nielsenId3Behavior"] = input.NielsenId3Behavior; - } - if (input.PatInterval !== undefined) { - bodyParams["patInterval"] = input.PatInterval; - } - if (input.PcrControl !== undefined) { - bodyParams["pcrControl"] = input.PcrControl; - } - if (input.PcrPeriod !== undefined) { - bodyParams["pcrPeriod"] = input.PcrPeriod; - } - if (input.PcrPid !== undefined) { - bodyParams["pcrPid"] = input.PcrPid; - } - if (input.PmtInterval !== undefined) { - bodyParams["pmtInterval"] = input.PmtInterval; - } - if (input.PmtPid !== undefined) { - bodyParams["pmtPid"] = input.PmtPid; - } - if (input.ProgramNum !== undefined) { - bodyParams["programNum"] = input.ProgramNum; - } - if (input.Scte35Behavior !== undefined) { - bodyParams["scte35Behavior"] = input.Scte35Behavior; - } - if (input.Scte35Pid !== undefined) { - bodyParams["scte35Pid"] = input.Scte35Pid; - } - if (input.TimedMetadataBehavior !== undefined) { - bodyParams["timedMetadataBehavior"] = input.TimedMetadataBehavior; - } - if (input.TimedMetadataPid !== undefined) { - bodyParams["timedMetadataPid"] = input.TimedMetadataPid; - } - if (input.TransportStreamId !== undefined) { - bodyParams["transportStreamId"] = input.TransportStreamId; - } - if (input.VideoPid !== undefined) { - bodyParams["videoPid"] = input.VideoPid; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1MediaConnectFlowRequest = ( input: MediaConnectFlowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FlowArn !== undefined) { - bodyParams["flowArn"] = input.FlowArn; - } - return bodyParams; + return { + ...(input.FlowArn !== undefined && { flowArn: input.FlowArn }) + }; }; const serializeAws_restJson1_1MediaPackageGroupSettings = ( input: MediaPackageGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - return bodyParams; + return { + ...(input.Destination !== undefined && { + destination: serializeAws_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }) + }; }; const serializeAws_restJson1_1MediaPackageOutputDestinationSettings = ( input: MediaPackageOutputDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChannelId !== undefined) { - bodyParams["channelId"] = input.ChannelId; - } - return bodyParams; + return { + ...(input.ChannelId !== undefined && { channelId: input.ChannelId }) + }; }; const serializeAws_restJson1_1MediaPackageOutputSettings = ( input: MediaPackageOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1Mp2Settings = ( input: Mp2Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bitrate !== undefined) { - bodyParams["bitrate"] = input.Bitrate; - } - if (input.CodingMode !== undefined) { - bodyParams["codingMode"] = input.CodingMode; - } - if (input.SampleRate !== undefined) { - bodyParams["sampleRate"] = input.SampleRate; - } - return bodyParams; + return { + ...(input.Bitrate !== undefined && { bitrate: input.Bitrate }), + ...(input.CodingMode !== undefined && { codingMode: input.CodingMode }), + ...(input.SampleRate !== undefined && { sampleRate: input.SampleRate }) + }; }; const serializeAws_restJson1_1MsSmoothGroupSettings = ( input: MsSmoothGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcquisitionPointId !== undefined) { - bodyParams["acquisitionPointId"] = input.AcquisitionPointId; - } - if (input.AudioOnlyTimecodeControl !== undefined) { - bodyParams["audioOnlyTimecodeControl"] = input.AudioOnlyTimecodeControl; - } - if (input.CertificateMode !== undefined) { - bodyParams["certificateMode"] = input.CertificateMode; - } - if (input.ConnectionRetryInterval !== undefined) { - bodyParams["connectionRetryInterval"] = input.ConnectionRetryInterval; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - if (input.EventId !== undefined) { - bodyParams["eventId"] = input.EventId; - } - if (input.EventIdMode !== undefined) { - bodyParams["eventIdMode"] = input.EventIdMode; - } - if (input.EventStopBehavior !== undefined) { - bodyParams["eventStopBehavior"] = input.EventStopBehavior; - } - if (input.FilecacheDuration !== undefined) { - bodyParams["filecacheDuration"] = input.FilecacheDuration; - } - if (input.FragmentLength !== undefined) { - bodyParams["fragmentLength"] = input.FragmentLength; - } - if (input.InputLossAction !== undefined) { - bodyParams["inputLossAction"] = input.InputLossAction; - } - if (input.NumRetries !== undefined) { - bodyParams["numRetries"] = input.NumRetries; - } - if (input.RestartDelay !== undefined) { - bodyParams["restartDelay"] = input.RestartDelay; - } - if (input.SegmentationMode !== undefined) { - bodyParams["segmentationMode"] = input.SegmentationMode; - } - if (input.SendDelayMs !== undefined) { - bodyParams["sendDelayMs"] = input.SendDelayMs; - } - if (input.SparseTrackType !== undefined) { - bodyParams["sparseTrackType"] = input.SparseTrackType; - } - if (input.StreamManifestBehavior !== undefined) { - bodyParams["streamManifestBehavior"] = input.StreamManifestBehavior; - } - if (input.TimestampOffset !== undefined) { - bodyParams["timestampOffset"] = input.TimestampOffset; - } - if (input.TimestampOffsetMode !== undefined) { - bodyParams["timestampOffsetMode"] = input.TimestampOffsetMode; - } - return bodyParams; + 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_restJson1_1OutputLocationRef( + 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 + }) + }; }; const serializeAws_restJson1_1MsSmoothOutputSettings = ( input: MsSmoothOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.H265PackagingType !== undefined) { - bodyParams["h265PackagingType"] = input.H265PackagingType; - } - if (input.NameModifier !== undefined) { - bodyParams["nameModifier"] = input.NameModifier; - } - return bodyParams; + return { + ...(input.H265PackagingType !== undefined && { + h265PackagingType: input.H265PackagingType + }), + ...(input.NameModifier !== undefined && { + nameModifier: input.NameModifier + }) + }; }; const serializeAws_restJson1_1MultiplexGroupSettings = ( input: MultiplexGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1MultiplexOutputSettings = ( input: MultiplexOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - return bodyParams; + return { + ...(input.Destination !== undefined && { + destination: serializeAws_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }) + }; }; const serializeAws_restJson1_1MultiplexProgramChannelDestinationSettings = ( input: MultiplexProgramChannelDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MultiplexId !== undefined) { - bodyParams["multiplexId"] = input.MultiplexId; - } - if (input.ProgramName !== undefined) { - bodyParams["programName"] = input.ProgramName; - } - return bodyParams; + return { + ...(input.MultiplexId !== undefined && { multiplexId: input.MultiplexId }), + ...(input.ProgramName !== undefined && { programName: input.ProgramName }) + }; }; const serializeAws_restJson1_1MultiplexProgramServiceDescriptor = ( input: MultiplexProgramServiceDescriptor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProviderName !== undefined) { - bodyParams["providerName"] = input.ProviderName; - } - if (input.ServiceName !== undefined) { - bodyParams["serviceName"] = input.ServiceName; - } - return bodyParams; + return { + ...(input.ProviderName !== undefined && { + providerName: input.ProviderName + }), + ...(input.ServiceName !== undefined && { serviceName: input.ServiceName }) + }; }; const serializeAws_restJson1_1MultiplexProgramSettings = ( input: MultiplexProgramSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProgramNumber !== undefined) { - bodyParams["programNumber"] = input.ProgramNumber; - } - if (input.ServiceDescriptor !== undefined) { - bodyParams[ - "serviceDescriptor" - ] = serializeAws_restJson1_1MultiplexProgramServiceDescriptor( - input.ServiceDescriptor, - context - ); - } - if (input.VideoSettings !== undefined) { - bodyParams[ - "videoSettings" - ] = serializeAws_restJson1_1MultiplexVideoSettings( - input.VideoSettings, - context - ); - } - return bodyParams; + return { + ...(input.ProgramNumber !== undefined && { + programNumber: input.ProgramNumber + }), + ...(input.ServiceDescriptor !== undefined && { + serviceDescriptor: serializeAws_restJson1_1MultiplexProgramServiceDescriptor( + input.ServiceDescriptor, + context + ) + }), + ...(input.VideoSettings !== undefined && { + videoSettings: serializeAws_restJson1_1MultiplexVideoSettings( + input.VideoSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1MultiplexSettings = ( input: MultiplexSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaximumVideoBufferDelayMilliseconds !== undefined) { - bodyParams["maximumVideoBufferDelayMilliseconds"] = - input.MaximumVideoBufferDelayMilliseconds; - } - if (input.TransportStreamBitrate !== undefined) { - bodyParams["transportStreamBitrate"] = input.TransportStreamBitrate; - } - if (input.TransportStreamId !== undefined) { - bodyParams["transportStreamId"] = input.TransportStreamId; - } - if (input.TransportStreamReservedBitrate !== undefined) { - bodyParams["transportStreamReservedBitrate"] = - input.TransportStreamReservedBitrate; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1MultiplexStatmuxVideoSettings = ( input: MultiplexStatmuxVideoSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaximumBitrate !== undefined) { - bodyParams["maximumBitrate"] = input.MaximumBitrate; - } - if (input.MinimumBitrate !== undefined) { - bodyParams["minimumBitrate"] = input.MinimumBitrate; - } - return bodyParams; + return { + ...(input.MaximumBitrate !== undefined && { + maximumBitrate: input.MaximumBitrate + }), + ...(input.MinimumBitrate !== undefined && { + minimumBitrate: input.MinimumBitrate + }) + }; }; const serializeAws_restJson1_1MultiplexVideoSettings = ( input: MultiplexVideoSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConstantBitrate !== undefined) { - bodyParams["constantBitrate"] = input.ConstantBitrate; - } - if (input.StatmuxSettings !== undefined) { - bodyParams[ - "statmuxSettings" - ] = serializeAws_restJson1_1MultiplexStatmuxVideoSettings( - input.StatmuxSettings, - context - ); - } - return bodyParams; + return { + ...(input.ConstantBitrate !== undefined && { + constantBitrate: input.ConstantBitrate + }), + ...(input.StatmuxSettings !== undefined && { + statmuxSettings: serializeAws_restJson1_1MultiplexStatmuxVideoSettings( + input.StatmuxSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1NetworkInputSettings = ( input: NetworkInputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HlsInputSettings !== undefined) { - bodyParams["hlsInputSettings"] = serializeAws_restJson1_1HlsInputSettings( - input.HlsInputSettings, - context - ); - } - if (input.ServerValidation !== undefined) { - bodyParams["serverValidation"] = input.ServerValidation; - } - return bodyParams; + return { + ...(input.HlsInputSettings !== undefined && { + hlsInputSettings: serializeAws_restJson1_1HlsInputSettings( + input.HlsInputSettings, + context + ) + }), + ...(input.ServerValidation !== undefined && { + serverValidation: input.ServerValidation + }) + }; }; const serializeAws_restJson1_1NielsenConfiguration = ( input: NielsenConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DistributorId !== undefined) { - bodyParams["distributorId"] = input.DistributorId; - } - if (input.NielsenPcmToId3Tagging !== undefined) { - bodyParams["nielsenPcmToId3Tagging"] = input.NielsenPcmToId3Tagging; - } - return bodyParams; -}; - -const serializeAws_restJson1_1Output = ( - input: Output, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.AudioDescriptionNames !== undefined) { - bodyParams[ - "audioDescriptionNames" - ] = serializeAws_restJson1_1__listOf__string( - input.AudioDescriptionNames, - context - ); - } - if (input.CaptionDescriptionNames !== undefined) { - bodyParams[ - "captionDescriptionNames" - ] = serializeAws_restJson1_1__listOf__string( - input.CaptionDescriptionNames, - context - ); - } - if (input.OutputName !== undefined) { - bodyParams["outputName"] = input.OutputName; - } - if (input.OutputSettings !== undefined) { - bodyParams["outputSettings"] = serializeAws_restJson1_1OutputSettings( - input.OutputSettings, - context - ); - } - if (input.VideoDescriptionName !== undefined) { - bodyParams["videoDescriptionName"] = input.VideoDescriptionName; - } - return bodyParams; + return { + ...(input.DistributorId !== undefined && { + distributorId: input.DistributorId + }), + ...(input.NielsenPcmToId3Tagging !== undefined && { + nielsenPcmToId3Tagging: input.NielsenPcmToId3Tagging + }) + }; +}; + +const serializeAws_restJson1_1Output = ( + input: Output, + context: __SerdeContext +): any => { + return { + ...(input.AudioDescriptionNames !== undefined && { + audioDescriptionNames: serializeAws_restJson1_1__listOf__string( + input.AudioDescriptionNames, + context + ) + }), + ...(input.CaptionDescriptionNames !== undefined && { + captionDescriptionNames: serializeAws_restJson1_1__listOf__string( + input.CaptionDescriptionNames, + context + ) + }), + ...(input.OutputName !== undefined && { outputName: input.OutputName }), + ...(input.OutputSettings !== undefined && { + outputSettings: serializeAws_restJson1_1OutputSettings( + input.OutputSettings, + context + ) + }), + ...(input.VideoDescriptionName !== undefined && { + videoDescriptionName: input.VideoDescriptionName + }) + }; }; const serializeAws_restJson1_1OutputDestination = ( input: OutputDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["id"] = input.Id; - } - if (input.MediaPackageSettings !== undefined) { - bodyParams[ - "mediaPackageSettings" - ] = serializeAws_restJson1_1__listOfMediaPackageOutputDestinationSettings( - input.MediaPackageSettings, - context - ); - } - if (input.MultiplexSettings !== undefined) { - bodyParams[ - "multiplexSettings" - ] = serializeAws_restJson1_1MultiplexProgramChannelDestinationSettings( - input.MultiplexSettings, - context - ); - } - if (input.Settings !== undefined) { - bodyParams[ - "settings" - ] = serializeAws_restJson1_1__listOfOutputDestinationSettings( - input.Settings, - context - ); - } - return bodyParams; + return { + ...(input.Id !== undefined && { id: input.Id }), + ...(input.MediaPackageSettings !== undefined && { + mediaPackageSettings: serializeAws_restJson1_1__listOfMediaPackageOutputDestinationSettings( + input.MediaPackageSettings, + context + ) + }), + ...(input.MultiplexSettings !== undefined && { + multiplexSettings: serializeAws_restJson1_1MultiplexProgramChannelDestinationSettings( + input.MultiplexSettings, + context + ) + }), + ...(input.Settings !== undefined && { + settings: serializeAws_restJson1_1__listOfOutputDestinationSettings( + input.Settings, + context + ) + }) + }; }; const serializeAws_restJson1_1OutputDestinationSettings = ( input: OutputDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PasswordParam !== undefined) { - bodyParams["passwordParam"] = input.PasswordParam; - } - if (input.StreamName !== undefined) { - bodyParams["streamName"] = input.StreamName; - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - if (input.Username !== undefined) { - bodyParams["username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1OutputGroup = ( input: OutputGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.OutputGroupSettings !== undefined) { - bodyParams[ - "outputGroupSettings" - ] = serializeAws_restJson1_1OutputGroupSettings( - input.OutputGroupSettings, - context - ); - } - if (input.Outputs !== undefined) { - bodyParams["outputs"] = serializeAws_restJson1_1__listOfOutput( - input.Outputs, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { name: input.Name }), + ...(input.OutputGroupSettings !== undefined && { + outputGroupSettings: serializeAws_restJson1_1OutputGroupSettings( + input.OutputGroupSettings, + context + ) + }), + ...(input.Outputs !== undefined && { + outputs: serializeAws_restJson1_1__listOfOutput(input.Outputs, context) + }) + }; }; const serializeAws_restJson1_1OutputGroupSettings = ( input: OutputGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ArchiveGroupSettings !== undefined) { - bodyParams[ - "archiveGroupSettings" - ] = serializeAws_restJson1_1ArchiveGroupSettings( - input.ArchiveGroupSettings, - context - ); - } - if (input.FrameCaptureGroupSettings !== undefined) { - bodyParams[ - "frameCaptureGroupSettings" - ] = serializeAws_restJson1_1FrameCaptureGroupSettings( - input.FrameCaptureGroupSettings, - context - ); - } - if (input.HlsGroupSettings !== undefined) { - bodyParams["hlsGroupSettings"] = serializeAws_restJson1_1HlsGroupSettings( - input.HlsGroupSettings, - context - ); - } - if (input.MediaPackageGroupSettings !== undefined) { - bodyParams[ - "mediaPackageGroupSettings" - ] = serializeAws_restJson1_1MediaPackageGroupSettings( - input.MediaPackageGroupSettings, - context - ); - } - if (input.MsSmoothGroupSettings !== undefined) { - bodyParams[ - "msSmoothGroupSettings" - ] = serializeAws_restJson1_1MsSmoothGroupSettings( - input.MsSmoothGroupSettings, - context - ); - } - if (input.MultiplexGroupSettings !== undefined) { - bodyParams[ - "multiplexGroupSettings" - ] = serializeAws_restJson1_1MultiplexGroupSettings( - input.MultiplexGroupSettings, - context - ); - } - if (input.RtmpGroupSettings !== undefined) { - bodyParams["rtmpGroupSettings"] = serializeAws_restJson1_1RtmpGroupSettings( - input.RtmpGroupSettings, - context - ); - } - if (input.UdpGroupSettings !== undefined) { - bodyParams["udpGroupSettings"] = serializeAws_restJson1_1UdpGroupSettings( - input.UdpGroupSettings, - context - ); - } - return bodyParams; + return { + ...(input.ArchiveGroupSettings !== undefined && { + archiveGroupSettings: serializeAws_restJson1_1ArchiveGroupSettings( + input.ArchiveGroupSettings, + context + ) + }), + ...(input.FrameCaptureGroupSettings !== undefined && { + frameCaptureGroupSettings: serializeAws_restJson1_1FrameCaptureGroupSettings( + input.FrameCaptureGroupSettings, + context + ) + }), + ...(input.HlsGroupSettings !== undefined && { + hlsGroupSettings: serializeAws_restJson1_1HlsGroupSettings( + input.HlsGroupSettings, + context + ) + }), + ...(input.MediaPackageGroupSettings !== undefined && { + mediaPackageGroupSettings: serializeAws_restJson1_1MediaPackageGroupSettings( + input.MediaPackageGroupSettings, + context + ) + }), + ...(input.MsSmoothGroupSettings !== undefined && { + msSmoothGroupSettings: serializeAws_restJson1_1MsSmoothGroupSettings( + input.MsSmoothGroupSettings, + context + ) + }), + ...(input.MultiplexGroupSettings !== undefined && { + multiplexGroupSettings: serializeAws_restJson1_1MultiplexGroupSettings( + input.MultiplexGroupSettings, + context + ) + }), + ...(input.RtmpGroupSettings !== undefined && { + rtmpGroupSettings: serializeAws_restJson1_1RtmpGroupSettings( + input.RtmpGroupSettings, + context + ) + }), + ...(input.UdpGroupSettings !== undefined && { + udpGroupSettings: serializeAws_restJson1_1UdpGroupSettings( + input.UdpGroupSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1OutputLocationRef = ( input: OutputLocationRef, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationRefId !== undefined) { - bodyParams["destinationRefId"] = input.DestinationRefId; - } - return bodyParams; + return { + ...(input.DestinationRefId !== undefined && { + destinationRefId: input.DestinationRefId + }) + }; }; const serializeAws_restJson1_1OutputSettings = ( input: OutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ArchiveOutputSettings !== undefined) { - bodyParams[ - "archiveOutputSettings" - ] = serializeAws_restJson1_1ArchiveOutputSettings( - input.ArchiveOutputSettings, - context - ); - } - if (input.FrameCaptureOutputSettings !== undefined) { - bodyParams[ - "frameCaptureOutputSettings" - ] = serializeAws_restJson1_1FrameCaptureOutputSettings( - input.FrameCaptureOutputSettings, - context - ); - } - if (input.HlsOutputSettings !== undefined) { - bodyParams["hlsOutputSettings"] = serializeAws_restJson1_1HlsOutputSettings( - input.HlsOutputSettings, - context - ); - } - if (input.MediaPackageOutputSettings !== undefined) { - bodyParams[ - "mediaPackageOutputSettings" - ] = serializeAws_restJson1_1MediaPackageOutputSettings( - input.MediaPackageOutputSettings, - context - ); - } - if (input.MsSmoothOutputSettings !== undefined) { - bodyParams[ - "msSmoothOutputSettings" - ] = serializeAws_restJson1_1MsSmoothOutputSettings( - input.MsSmoothOutputSettings, - context - ); - } - if (input.MultiplexOutputSettings !== undefined) { - bodyParams[ - "multiplexOutputSettings" - ] = serializeAws_restJson1_1MultiplexOutputSettings( - input.MultiplexOutputSettings, - context - ); - } - if (input.RtmpOutputSettings !== undefined) { - bodyParams[ - "rtmpOutputSettings" - ] = serializeAws_restJson1_1RtmpOutputSettings( - input.RtmpOutputSettings, - context - ); - } - if (input.UdpOutputSettings !== undefined) { - bodyParams["udpOutputSettings"] = serializeAws_restJson1_1UdpOutputSettings( - input.UdpOutputSettings, - context - ); - } - return bodyParams; + return { + ...(input.ArchiveOutputSettings !== undefined && { + archiveOutputSettings: serializeAws_restJson1_1ArchiveOutputSettings( + input.ArchiveOutputSettings, + context + ) + }), + ...(input.FrameCaptureOutputSettings !== undefined && { + frameCaptureOutputSettings: serializeAws_restJson1_1FrameCaptureOutputSettings( + input.FrameCaptureOutputSettings, + context + ) + }), + ...(input.HlsOutputSettings !== undefined && { + hlsOutputSettings: serializeAws_restJson1_1HlsOutputSettings( + input.HlsOutputSettings, + context + ) + }), + ...(input.MediaPackageOutputSettings !== undefined && { + mediaPackageOutputSettings: serializeAws_restJson1_1MediaPackageOutputSettings( + input.MediaPackageOutputSettings, + context + ) + }), + ...(input.MsSmoothOutputSettings !== undefined && { + msSmoothOutputSettings: serializeAws_restJson1_1MsSmoothOutputSettings( + input.MsSmoothOutputSettings, + context + ) + }), + ...(input.MultiplexOutputSettings !== undefined && { + multiplexOutputSettings: serializeAws_restJson1_1MultiplexOutputSettings( + input.MultiplexOutputSettings, + context + ) + }), + ...(input.RtmpOutputSettings !== undefined && { + rtmpOutputSettings: serializeAws_restJson1_1RtmpOutputSettings( + input.RtmpOutputSettings, + context + ) + }), + ...(input.UdpOutputSettings !== undefined && { + udpOutputSettings: serializeAws_restJson1_1UdpOutputSettings( + input.UdpOutputSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1PassThroughSettings = ( input: PassThroughSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1PauseStateScheduleActionSettings = ( input: PauseStateScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pipelines !== undefined) { - bodyParams[ - "pipelines" - ] = serializeAws_restJson1_1__listOfPipelinePauseStateSettings( - input.Pipelines, - context - ); - } - return bodyParams; + return { + ...(input.Pipelines !== undefined && { + pipelines: serializeAws_restJson1_1__listOfPipelinePauseStateSettings( + input.Pipelines, + context + ) + }) + }; }; const serializeAws_restJson1_1PipelinePauseStateSettings = ( input: PipelinePauseStateSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PipelineId !== undefined) { - bodyParams["pipelineId"] = input.PipelineId; - } - return bodyParams; + return { + ...(input.PipelineId !== undefined && { pipelineId: input.PipelineId }) + }; }; const serializeAws_restJson1_1Rec601Settings = ( input: Rec601Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1Rec709Settings = ( input: Rec709Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1RemixSettings = ( input: RemixSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChannelMappings !== undefined) { - bodyParams[ - "channelMappings" - ] = serializeAws_restJson1_1__listOfAudioChannelMapping( - input.ChannelMappings, - context - ); - } - if (input.ChannelsIn !== undefined) { - bodyParams["channelsIn"] = input.ChannelsIn; - } - if (input.ChannelsOut !== undefined) { - bodyParams["channelsOut"] = input.ChannelsOut; - } - return bodyParams; + return { + ...(input.ChannelMappings !== undefined && { + channelMappings: serializeAws_restJson1_1__listOfAudioChannelMapping( + input.ChannelMappings, + context + ) + }), + ...(input.ChannelsIn !== undefined && { channelsIn: input.ChannelsIn }), + ...(input.ChannelsOut !== undefined && { channelsOut: input.ChannelsOut }) + }; }; const serializeAws_restJson1_1RtmpCaptionInfoDestinationSettings = ( input: RtmpCaptionInfoDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1RtmpGroupSettings = ( input: RtmpGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthenticationScheme !== undefined) { - bodyParams["authenticationScheme"] = input.AuthenticationScheme; - } - if (input.CacheFullBehavior !== undefined) { - bodyParams["cacheFullBehavior"] = input.CacheFullBehavior; - } - if (input.CacheLength !== undefined) { - bodyParams["cacheLength"] = input.CacheLength; - } - if (input.CaptionData !== undefined) { - bodyParams["captionData"] = input.CaptionData; - } - if (input.InputLossAction !== undefined) { - bodyParams["inputLossAction"] = input.InputLossAction; - } - if (input.RestartDelay !== undefined) { - bodyParams["restartDelay"] = input.RestartDelay; - } - return bodyParams; + return { + ...(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 + }) + }; }; const serializeAws_restJson1_1RtmpOutputSettings = ( input: RtmpOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateMode !== undefined) { - bodyParams["certificateMode"] = input.CertificateMode; - } - if (input.ConnectionRetryInterval !== undefined) { - bodyParams["connectionRetryInterval"] = input.ConnectionRetryInterval; - } - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - if (input.NumRetries !== undefined) { - bodyParams["numRetries"] = input.NumRetries; - } - return bodyParams; + return { + ...(input.CertificateMode !== undefined && { + certificateMode: input.CertificateMode + }), + ...(input.ConnectionRetryInterval !== undefined && { + connectionRetryInterval: input.ConnectionRetryInterval + }), + ...(input.Destination !== undefined && { + destination: serializeAws_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }), + ...(input.NumRetries !== undefined && { numRetries: input.NumRetries }) + }; }; const serializeAws_restJson1_1ScheduleAction = ( input: ScheduleAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActionName !== undefined) { - bodyParams["actionName"] = input.ActionName; - } - if (input.ScheduleActionSettings !== undefined) { - bodyParams[ - "scheduleActionSettings" - ] = serializeAws_restJson1_1ScheduleActionSettings( - input.ScheduleActionSettings, - context - ); - } - if (input.ScheduleActionStartSettings !== undefined) { - bodyParams[ - "scheduleActionStartSettings" - ] = serializeAws_restJson1_1ScheduleActionStartSettings( - input.ScheduleActionStartSettings, - context - ); - } - return bodyParams; + return { + ...(input.ActionName !== undefined && { actionName: input.ActionName }), + ...(input.ScheduleActionSettings !== undefined && { + scheduleActionSettings: serializeAws_restJson1_1ScheduleActionSettings( + input.ScheduleActionSettings, + context + ) + }), + ...(input.ScheduleActionStartSettings !== undefined && { + scheduleActionStartSettings: serializeAws_restJson1_1ScheduleActionStartSettings( + input.ScheduleActionStartSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1ScheduleActionSettings = ( input: ScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HlsId3SegmentTaggingSettings !== undefined) { - bodyParams[ - "hlsId3SegmentTaggingSettings" - ] = serializeAws_restJson1_1HlsId3SegmentTaggingScheduleActionSettings( - input.HlsId3SegmentTaggingSettings, - context - ); - } - if (input.HlsTimedMetadataSettings !== undefined) { - bodyParams[ - "hlsTimedMetadataSettings" - ] = serializeAws_restJson1_1HlsTimedMetadataScheduleActionSettings( - input.HlsTimedMetadataSettings, - context - ); - } - if (input.InputSwitchSettings !== undefined) { - bodyParams[ - "inputSwitchSettings" - ] = serializeAws_restJson1_1InputSwitchScheduleActionSettings( - input.InputSwitchSettings, - context - ); - } - if (input.PauseStateSettings !== undefined) { - bodyParams[ - "pauseStateSettings" - ] = serializeAws_restJson1_1PauseStateScheduleActionSettings( - input.PauseStateSettings, - context - ); - } - if (input.Scte35ReturnToNetworkSettings !== undefined) { - bodyParams[ - "scte35ReturnToNetworkSettings" - ] = serializeAws_restJson1_1Scte35ReturnToNetworkScheduleActionSettings( - input.Scte35ReturnToNetworkSettings, - context - ); - } - if (input.Scte35SpliceInsertSettings !== undefined) { - bodyParams[ - "scte35SpliceInsertSettings" - ] = serializeAws_restJson1_1Scte35SpliceInsertScheduleActionSettings( - input.Scte35SpliceInsertSettings, - context - ); - } - if (input.Scte35TimeSignalSettings !== undefined) { - bodyParams[ - "scte35TimeSignalSettings" - ] = serializeAws_restJson1_1Scte35TimeSignalScheduleActionSettings( - input.Scte35TimeSignalSettings, - context - ); - } - if (input.StaticImageActivateSettings !== undefined) { - bodyParams[ - "staticImageActivateSettings" - ] = serializeAws_restJson1_1StaticImageActivateScheduleActionSettings( - input.StaticImageActivateSettings, - context - ); - } - if (input.StaticImageDeactivateSettings !== undefined) { - bodyParams[ - "staticImageDeactivateSettings" - ] = serializeAws_restJson1_1StaticImageDeactivateScheduleActionSettings( - input.StaticImageDeactivateSettings, - context - ); - } - return bodyParams; -}; - -const serializeAws_restJson1_1ScheduleActionStartSettings = ( - input: ScheduleActionStartSettings, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.FixedModeScheduleActionStartSettings !== undefined) { - bodyParams[ - "fixedModeScheduleActionStartSettings" - ] = serializeAws_restJson1_1FixedModeScheduleActionStartSettings( - input.FixedModeScheduleActionStartSettings, - context - ); - } - if (input.FollowModeScheduleActionStartSettings !== undefined) { - bodyParams[ - "followModeScheduleActionStartSettings" - ] = serializeAws_restJson1_1FollowModeScheduleActionStartSettings( - input.FollowModeScheduleActionStartSettings, - context - ); - } - if (input.ImmediateModeScheduleActionStartSettings !== undefined) { - bodyParams[ - "immediateModeScheduleActionStartSettings" - ] = serializeAws_restJson1_1ImmediateModeScheduleActionStartSettings( - input.ImmediateModeScheduleActionStartSettings, - context - ); - } - return bodyParams; + return { + ...(input.HlsId3SegmentTaggingSettings !== undefined && { + hlsId3SegmentTaggingSettings: serializeAws_restJson1_1HlsId3SegmentTaggingScheduleActionSettings( + input.HlsId3SegmentTaggingSettings, + context + ) + }), + ...(input.HlsTimedMetadataSettings !== undefined && { + hlsTimedMetadataSettings: serializeAws_restJson1_1HlsTimedMetadataScheduleActionSettings( + input.HlsTimedMetadataSettings, + context + ) + }), + ...(input.InputSwitchSettings !== undefined && { + inputSwitchSettings: serializeAws_restJson1_1InputSwitchScheduleActionSettings( + input.InputSwitchSettings, + context + ) + }), + ...(input.PauseStateSettings !== undefined && { + pauseStateSettings: serializeAws_restJson1_1PauseStateScheduleActionSettings( + input.PauseStateSettings, + context + ) + }), + ...(input.Scte35ReturnToNetworkSettings !== undefined && { + scte35ReturnToNetworkSettings: serializeAws_restJson1_1Scte35ReturnToNetworkScheduleActionSettings( + input.Scte35ReturnToNetworkSettings, + context + ) + }), + ...(input.Scte35SpliceInsertSettings !== undefined && { + scte35SpliceInsertSettings: serializeAws_restJson1_1Scte35SpliceInsertScheduleActionSettings( + input.Scte35SpliceInsertSettings, + context + ) + }), + ...(input.Scte35TimeSignalSettings !== undefined && { + scte35TimeSignalSettings: serializeAws_restJson1_1Scte35TimeSignalScheduleActionSettings( + input.Scte35TimeSignalSettings, + context + ) + }), + ...(input.StaticImageActivateSettings !== undefined && { + staticImageActivateSettings: serializeAws_restJson1_1StaticImageActivateScheduleActionSettings( + input.StaticImageActivateSettings, + context + ) + }), + ...(input.StaticImageDeactivateSettings !== undefined && { + staticImageDeactivateSettings: serializeAws_restJson1_1StaticImageDeactivateScheduleActionSettings( + input.StaticImageDeactivateSettings, + context + ) + }) + }; +}; + +const serializeAws_restJson1_1ScheduleActionStartSettings = ( + input: ScheduleActionStartSettings, + context: __SerdeContext +): any => { + return { + ...(input.FixedModeScheduleActionStartSettings !== undefined && { + fixedModeScheduleActionStartSettings: serializeAws_restJson1_1FixedModeScheduleActionStartSettings( + input.FixedModeScheduleActionStartSettings, + context + ) + }), + ...(input.FollowModeScheduleActionStartSettings !== undefined && { + followModeScheduleActionStartSettings: serializeAws_restJson1_1FollowModeScheduleActionStartSettings( + input.FollowModeScheduleActionStartSettings, + context + ) + }), + ...(input.ImmediateModeScheduleActionStartSettings !== undefined && { + immediateModeScheduleActionStartSettings: serializeAws_restJson1_1ImmediateModeScheduleActionStartSettings( + input.ImmediateModeScheduleActionStartSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1Scte20PlusEmbeddedDestinationSettings = ( input: Scte20PlusEmbeddedDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1Scte20SourceSettings = ( input: Scte20SourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Convert608To708 !== undefined) { - bodyParams["convert608To708"] = input.Convert608To708; - } - if (input.Source608ChannelNumber !== undefined) { - bodyParams["source608ChannelNumber"] = input.Source608ChannelNumber; - } - return bodyParams; + return { + ...(input.Convert608To708 !== undefined && { + convert608To708: input.Convert608To708 + }), + ...(input.Source608ChannelNumber !== undefined && { + source608ChannelNumber: input.Source608ChannelNumber + }) + }; }; const serializeAws_restJson1_1Scte27DestinationSettings = ( input: Scte27DestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1Scte27SourceSettings = ( input: Scte27SourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pid !== undefined) { - bodyParams["pid"] = input.Pid; - } - return bodyParams; + return { + ...(input.Pid !== undefined && { pid: input.Pid }) + }; }; const serializeAws_restJson1_1Scte35DeliveryRestrictions = ( input: Scte35DeliveryRestrictions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ArchiveAllowedFlag !== undefined) { - bodyParams["archiveAllowedFlag"] = input.ArchiveAllowedFlag; - } - if (input.DeviceRestrictions !== undefined) { - bodyParams["deviceRestrictions"] = input.DeviceRestrictions; - } - if (input.NoRegionalBlackoutFlag !== undefined) { - bodyParams["noRegionalBlackoutFlag"] = input.NoRegionalBlackoutFlag; - } - if (input.WebDeliveryAllowedFlag !== undefined) { - bodyParams["webDeliveryAllowedFlag"] = input.WebDeliveryAllowedFlag; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1Scte35Descriptor = ( input: Scte35Descriptor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Scte35DescriptorSettings !== undefined) { - bodyParams[ - "scte35DescriptorSettings" - ] = serializeAws_restJson1_1Scte35DescriptorSettings( - input.Scte35DescriptorSettings, - context - ); - } - return bodyParams; + return { + ...(input.Scte35DescriptorSettings !== undefined && { + scte35DescriptorSettings: serializeAws_restJson1_1Scte35DescriptorSettings( + input.Scte35DescriptorSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1Scte35DescriptorSettings = ( input: Scte35DescriptorSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SegmentationDescriptorScte35DescriptorSettings !== undefined) { - bodyParams[ - "segmentationDescriptorScte35DescriptorSettings" - ] = serializeAws_restJson1_1Scte35SegmentationDescriptor( - input.SegmentationDescriptorScte35DescriptorSettings, - context - ); - } - return bodyParams; + return { + ...(input.SegmentationDescriptorScte35DescriptorSettings !== undefined && { + segmentationDescriptorScte35DescriptorSettings: serializeAws_restJson1_1Scte35SegmentationDescriptor( + input.SegmentationDescriptorScte35DescriptorSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1Scte35ReturnToNetworkScheduleActionSettings = ( input: Scte35ReturnToNetworkScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpliceEventId !== undefined) { - bodyParams["spliceEventId"] = input.SpliceEventId; - } - return bodyParams; + return { + ...(input.SpliceEventId !== undefined && { + spliceEventId: input.SpliceEventId + }) + }; }; const serializeAws_restJson1_1Scte35SegmentationDescriptor = ( input: Scte35SegmentationDescriptor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryRestrictions !== undefined) { - bodyParams[ - "deliveryRestrictions" - ] = serializeAws_restJson1_1Scte35DeliveryRestrictions( - input.DeliveryRestrictions, - context - ); - } - if (input.SegmentNum !== undefined) { - bodyParams["segmentNum"] = input.SegmentNum; - } - if (input.SegmentationCancelIndicator !== undefined) { - bodyParams["segmentationCancelIndicator"] = - input.SegmentationCancelIndicator; - } - if (input.SegmentationDuration !== undefined) { - bodyParams["segmentationDuration"] = input.SegmentationDuration; - } - if (input.SegmentationEventId !== undefined) { - bodyParams["segmentationEventId"] = input.SegmentationEventId; - } - if (input.SegmentationTypeId !== undefined) { - bodyParams["segmentationTypeId"] = input.SegmentationTypeId; - } - if (input.SegmentationUpid !== undefined) { - bodyParams["segmentationUpid"] = input.SegmentationUpid; - } - if (input.SegmentationUpidType !== undefined) { - bodyParams["segmentationUpidType"] = input.SegmentationUpidType; - } - if (input.SegmentsExpected !== undefined) { - bodyParams["segmentsExpected"] = input.SegmentsExpected; - } - if (input.SubSegmentNum !== undefined) { - bodyParams["subSegmentNum"] = input.SubSegmentNum; - } - if (input.SubSegmentsExpected !== undefined) { - bodyParams["subSegmentsExpected"] = input.SubSegmentsExpected; - } - return bodyParams; + return { + ...(input.DeliveryRestrictions !== undefined && { + deliveryRestrictions: serializeAws_restJson1_1Scte35DeliveryRestrictions( + 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 + }) + }; }; const serializeAws_restJson1_1Scte35SpliceInsert = ( input: Scte35SpliceInsert, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdAvailOffset !== undefined) { - bodyParams["adAvailOffset"] = input.AdAvailOffset; - } - if (input.NoRegionalBlackoutFlag !== undefined) { - bodyParams["noRegionalBlackoutFlag"] = input.NoRegionalBlackoutFlag; - } - if (input.WebDeliveryAllowedFlag !== undefined) { - bodyParams["webDeliveryAllowedFlag"] = input.WebDeliveryAllowedFlag; - } - return bodyParams; + return { + ...(input.AdAvailOffset !== undefined && { + adAvailOffset: input.AdAvailOffset + }), + ...(input.NoRegionalBlackoutFlag !== undefined && { + noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag + }), + ...(input.WebDeliveryAllowedFlag !== undefined && { + webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag + }) + }; }; const serializeAws_restJson1_1Scte35SpliceInsertScheduleActionSettings = ( input: Scte35SpliceInsertScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["duration"] = input.Duration; - } - if (input.SpliceEventId !== undefined) { - bodyParams["spliceEventId"] = input.SpliceEventId; - } - return bodyParams; + return { + ...(input.Duration !== undefined && { duration: input.Duration }), + ...(input.SpliceEventId !== undefined && { + spliceEventId: input.SpliceEventId + }) + }; }; const serializeAws_restJson1_1Scte35TimeSignalApos = ( input: Scte35TimeSignalApos, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdAvailOffset !== undefined) { - bodyParams["adAvailOffset"] = input.AdAvailOffset; - } - if (input.NoRegionalBlackoutFlag !== undefined) { - bodyParams["noRegionalBlackoutFlag"] = input.NoRegionalBlackoutFlag; - } - if (input.WebDeliveryAllowedFlag !== undefined) { - bodyParams["webDeliveryAllowedFlag"] = input.WebDeliveryAllowedFlag; - } - return bodyParams; + return { + ...(input.AdAvailOffset !== undefined && { + adAvailOffset: input.AdAvailOffset + }), + ...(input.NoRegionalBlackoutFlag !== undefined && { + noRegionalBlackoutFlag: input.NoRegionalBlackoutFlag + }), + ...(input.WebDeliveryAllowedFlag !== undefined && { + webDeliveryAllowedFlag: input.WebDeliveryAllowedFlag + }) + }; }; const serializeAws_restJson1_1Scte35TimeSignalScheduleActionSettings = ( input: Scte35TimeSignalScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Scte35Descriptors !== undefined) { - bodyParams[ - "scte35Descriptors" - ] = serializeAws_restJson1_1__listOfScte35Descriptor( - input.Scte35Descriptors, - context - ); - } - return bodyParams; + return { + ...(input.Scte35Descriptors !== undefined && { + scte35Descriptors: serializeAws_restJson1_1__listOfScte35Descriptor( + input.Scte35Descriptors, + context + ) + }) + }; }; const serializeAws_restJson1_1SmpteTtDestinationSettings = ( input: SmpteTtDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1StandardHlsSettings = ( input: StandardHlsSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioRenditionSets !== undefined) { - bodyParams["audioRenditionSets"] = input.AudioRenditionSets; - } - if (input.M3u8Settings !== undefined) { - bodyParams["m3u8Settings"] = serializeAws_restJson1_1M3u8Settings( - input.M3u8Settings, - context - ); - } - return bodyParams; + return { + ...(input.AudioRenditionSets !== undefined && { + audioRenditionSets: input.AudioRenditionSets + }), + ...(input.M3u8Settings !== undefined && { + m3u8Settings: serializeAws_restJson1_1M3u8Settings( + input.M3u8Settings, + context + ) + }) + }; }; const serializeAws_restJson1_1StartTimecode = ( input: StartTimecode, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Timecode !== undefined) { - bodyParams["timecode"] = input.Timecode; - } - return bodyParams; + return { + ...(input.Timecode !== undefined && { timecode: input.Timecode }) + }; }; const serializeAws_restJson1_1StaticImageActivateScheduleActionSettings = ( input: StaticImageActivateScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["duration"] = input.Duration; - } - if (input.FadeIn !== undefined) { - bodyParams["fadeIn"] = input.FadeIn; - } - if (input.FadeOut !== undefined) { - bodyParams["fadeOut"] = input.FadeOut; - } - if (input.Height !== undefined) { - bodyParams["height"] = input.Height; - } - if (input.Image !== undefined) { - bodyParams["image"] = serializeAws_restJson1_1InputLocation( - input.Image, - context - ); - } - if (input.ImageX !== undefined) { - bodyParams["imageX"] = input.ImageX; - } - if (input.ImageY !== undefined) { - bodyParams["imageY"] = input.ImageY; - } - if (input.Layer !== undefined) { - bodyParams["layer"] = input.Layer; - } - if (input.Opacity !== undefined) { - bodyParams["opacity"] = input.Opacity; - } - if (input.Width !== undefined) { - bodyParams["width"] = input.Width; - } - return bodyParams; + 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_restJson1_1InputLocation(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 }) + }; }; const serializeAws_restJson1_1StaticImageDeactivateScheduleActionSettings = ( input: StaticImageDeactivateScheduleActionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FadeOut !== undefined) { - bodyParams["fadeOut"] = input.FadeOut; - } - if (input.Layer !== undefined) { - bodyParams["layer"] = input.Layer; - } - return bodyParams; + return { + ...(input.FadeOut !== undefined && { fadeOut: input.FadeOut }), + ...(input.Layer !== undefined && { layer: input.Layer }) + }; }; const serializeAws_restJson1_1StaticKeySettings = ( input: StaticKeySettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyProviderServer !== undefined) { - bodyParams["keyProviderServer"] = serializeAws_restJson1_1InputLocation( - input.KeyProviderServer, - context - ); - } - if (input.StaticKeyValue !== undefined) { - bodyParams["staticKeyValue"] = input.StaticKeyValue; - } - return bodyParams; + return { + ...(input.KeyProviderServer !== undefined && { + keyProviderServer: serializeAws_restJson1_1InputLocation( + input.KeyProviderServer, + context + ) + }), + ...(input.StaticKeyValue !== undefined && { + staticKeyValue: input.StaticKeyValue + }) + }; }; const serializeAws_restJson1_1StopTimecode = ( input: StopTimecode, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LastFrameClippingBehavior !== undefined) { - bodyParams["lastFrameClippingBehavior"] = input.LastFrameClippingBehavior; - } - if (input.Timecode !== undefined) { - bodyParams["timecode"] = input.Timecode; - } - return bodyParams; + return { + ...(input.LastFrameClippingBehavior !== undefined && { + lastFrameClippingBehavior: input.LastFrameClippingBehavior + }), + ...(input.Timecode !== undefined && { timecode: input.Timecode }) + }; }; const serializeAws_restJson1_1Tags = ( @@ -12316,240 +11716,210 @@ const serializeAws_restJson1_1TeletextDestinationSettings = ( input: TeletextDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1TeletextSourceSettings = ( input: TeletextSourceSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PageNumber !== undefined) { - bodyParams["pageNumber"] = input.PageNumber; - } - return bodyParams; + return { + ...(input.PageNumber !== undefined && { pageNumber: input.PageNumber }) + }; }; const serializeAws_restJson1_1TimecodeConfig = ( input: TimecodeConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Source !== undefined) { - bodyParams["source"] = input.Source; - } - if (input.SyncThreshold !== undefined) { - bodyParams["syncThreshold"] = input.SyncThreshold; - } - return bodyParams; + return { + ...(input.Source !== undefined && { source: input.Source }), + ...(input.SyncThreshold !== undefined && { + syncThreshold: input.SyncThreshold + }) + }; }; const serializeAws_restJson1_1TtmlDestinationSettings = ( input: TtmlDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StyleControl !== undefined) { - bodyParams["styleControl"] = input.StyleControl; - } - return bodyParams; + return { + ...(input.StyleControl !== undefined && { + styleControl: input.StyleControl + }) + }; }; const serializeAws_restJson1_1UdpContainerSettings = ( input: UdpContainerSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.M2tsSettings !== undefined) { - bodyParams["m2tsSettings"] = serializeAws_restJson1_1M2tsSettings( - input.M2tsSettings, - context - ); - } - return bodyParams; + return { + ...(input.M2tsSettings !== undefined && { + m2tsSettings: serializeAws_restJson1_1M2tsSettings( + input.M2tsSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1UdpGroupSettings = ( input: UdpGroupSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputLossAction !== undefined) { - bodyParams["inputLossAction"] = input.InputLossAction; - } - if (input.TimedMetadataId3Frame !== undefined) { - bodyParams["timedMetadataId3Frame"] = input.TimedMetadataId3Frame; - } - if (input.TimedMetadataId3Period !== undefined) { - bodyParams["timedMetadataId3Period"] = input.TimedMetadataId3Period; - } - return bodyParams; + return { + ...(input.InputLossAction !== undefined && { + inputLossAction: input.InputLossAction + }), + ...(input.TimedMetadataId3Frame !== undefined && { + timedMetadataId3Frame: input.TimedMetadataId3Frame + }), + ...(input.TimedMetadataId3Period !== undefined && { + timedMetadataId3Period: input.TimedMetadataId3Period + }) + }; }; const serializeAws_restJson1_1UdpOutputSettings = ( input: UdpOutputSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BufferMsec !== undefined) { - bodyParams["bufferMsec"] = input.BufferMsec; - } - if (input.ContainerSettings !== undefined) { - bodyParams[ - "containerSettings" - ] = serializeAws_restJson1_1UdpContainerSettings( - input.ContainerSettings, - context - ); - } - if (input.Destination !== undefined) { - bodyParams["destination"] = serializeAws_restJson1_1OutputLocationRef( - input.Destination, - context - ); - } - if (input.FecOutputSettings !== undefined) { - bodyParams["fecOutputSettings"] = serializeAws_restJson1_1FecOutputSettings( - input.FecOutputSettings, - context - ); - } - return bodyParams; + return { + ...(input.BufferMsec !== undefined && { bufferMsec: input.BufferMsec }), + ...(input.ContainerSettings !== undefined && { + containerSettings: serializeAws_restJson1_1UdpContainerSettings( + input.ContainerSettings, + context + ) + }), + ...(input.Destination !== undefined && { + destination: serializeAws_restJson1_1OutputLocationRef( + input.Destination, + context + ) + }), + ...(input.FecOutputSettings !== undefined && { + fecOutputSettings: serializeAws_restJson1_1FecOutputSettings( + input.FecOutputSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1VideoCodecSettings = ( input: VideoCodecSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FrameCaptureSettings !== undefined) { - bodyParams[ - "frameCaptureSettings" - ] = serializeAws_restJson1_1FrameCaptureSettings( - input.FrameCaptureSettings, - context - ); - } - if (input.H264Settings !== undefined) { - bodyParams["h264Settings"] = serializeAws_restJson1_1H264Settings( - input.H264Settings, - context - ); - } - if (input.H265Settings !== undefined) { - bodyParams["h265Settings"] = serializeAws_restJson1_1H265Settings( - input.H265Settings, - context - ); - } - return bodyParams; + return { + ...(input.FrameCaptureSettings !== undefined && { + frameCaptureSettings: serializeAws_restJson1_1FrameCaptureSettings( + input.FrameCaptureSettings, + context + ) + }), + ...(input.H264Settings !== undefined && { + h264Settings: serializeAws_restJson1_1H264Settings( + input.H264Settings, + context + ) + }), + ...(input.H265Settings !== undefined && { + h265Settings: serializeAws_restJson1_1H265Settings( + input.H265Settings, + context + ) + }) + }; }; const serializeAws_restJson1_1VideoDescription = ( input: VideoDescription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodecSettings !== undefined) { - bodyParams["codecSettings"] = serializeAws_restJson1_1VideoCodecSettings( - input.CodecSettings, - context - ); - } - if (input.Height !== undefined) { - bodyParams["height"] = input.Height; - } - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.RespondToAfd !== undefined) { - bodyParams["respondToAfd"] = input.RespondToAfd; - } - if (input.ScalingBehavior !== undefined) { - bodyParams["scalingBehavior"] = input.ScalingBehavior; - } - if (input.Sharpness !== undefined) { - bodyParams["sharpness"] = input.Sharpness; - } - if (input.Width !== undefined) { - bodyParams["width"] = input.Width; - } - return bodyParams; + return { + ...(input.CodecSettings !== undefined && { + codecSettings: serializeAws_restJson1_1VideoCodecSettings( + 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 }) + }; }; const serializeAws_restJson1_1VideoSelector = ( input: VideoSelector, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColorSpace !== undefined) { - bodyParams["colorSpace"] = input.ColorSpace; - } - if (input.ColorSpaceUsage !== undefined) { - bodyParams["colorSpaceUsage"] = input.ColorSpaceUsage; - } - if (input.SelectorSettings !== undefined) { - bodyParams[ - "selectorSettings" - ] = serializeAws_restJson1_1VideoSelectorSettings( - input.SelectorSettings, - context - ); - } - return bodyParams; + return { + ...(input.ColorSpace !== undefined && { colorSpace: input.ColorSpace }), + ...(input.ColorSpaceUsage !== undefined && { + colorSpaceUsage: input.ColorSpaceUsage + }), + ...(input.SelectorSettings !== undefined && { + selectorSettings: serializeAws_restJson1_1VideoSelectorSettings( + input.SelectorSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1VideoSelectorPid = ( input: VideoSelectorPid, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Pid !== undefined) { - bodyParams["pid"] = input.Pid; - } - return bodyParams; + return { + ...(input.Pid !== undefined && { pid: input.Pid }) + }; }; const serializeAws_restJson1_1VideoSelectorProgramId = ( input: VideoSelectorProgramId, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProgramId !== undefined) { - bodyParams["programId"] = input.ProgramId; - } - return bodyParams; + return { + ...(input.ProgramId !== undefined && { programId: input.ProgramId }) + }; }; const serializeAws_restJson1_1VideoSelectorSettings = ( input: VideoSelectorSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VideoSelectorPid !== undefined) { - bodyParams["videoSelectorPid"] = serializeAws_restJson1_1VideoSelectorPid( - input.VideoSelectorPid, - context - ); - } - if (input.VideoSelectorProgramId !== undefined) { - bodyParams[ - "videoSelectorProgramId" - ] = serializeAws_restJson1_1VideoSelectorProgramId( - input.VideoSelectorProgramId, - context - ); - } - return bodyParams; + return { + ...(input.VideoSelectorPid !== undefined && { + videoSelectorPid: serializeAws_restJson1_1VideoSelectorPid( + input.VideoSelectorPid, + context + ) + }), + ...(input.VideoSelectorProgramId !== undefined && { + videoSelectorProgramId: serializeAws_restJson1_1VideoSelectorProgramId( + input.VideoSelectorProgramId, + context + ) + }) + }; }; const serializeAws_restJson1_1WebvttDestinationSettings = ( input: WebvttDestinationSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_restJson1_1__listOfAudioChannelMapping = ( diff --git a/clients/client-mediapackage-vod/protocols/Aws_restJson1_1.ts b/clients/client-mediapackage-vod/protocols/Aws_restJson1_1.ts index 8bcd87356921..fd4b3972d702 100644 --- a/clients/client-mediapackage-vod/protocols/Aws_restJson1_1.ts +++ b/clients/client-mediapackage-vod/protocols/Aws_restJson1_1.ts @@ -2151,265 +2151,253 @@ const serializeAws_restJson1_1CmafEncryption = ( input: CmafEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1CmafPackage = ( input: CmafPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1CmafEncryption( - input.Encryption, - context - ); - } - if (input.HlsManifests !== undefined) { - bodyParams["hlsManifests"] = serializeAws_restJson1_1__listOfHlsManifest( - input.HlsManifests, - context - ); - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1CmafEncryption( + input.Encryption, + context + ) + }), + ...(input.HlsManifests !== undefined && { + hlsManifests: serializeAws_restJson1_1__listOfHlsManifest( + input.HlsManifests, + context + ) + }), + ...(input.SegmentDurationSeconds !== undefined && { + segmentDurationSeconds: input.SegmentDurationSeconds + }) + }; }; const serializeAws_restJson1_1DashEncryption = ( input: DashEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1DashManifest = ( input: DashManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestName !== undefined) { - bodyParams["manifestName"] = input.ManifestName; - } - if (input.MinBufferTimeSeconds !== undefined) { - bodyParams["minBufferTimeSeconds"] = input.MinBufferTimeSeconds; - } - if (input.Profile !== undefined) { - bodyParams["profile"] = input.Profile; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - return bodyParams; + return { + ...(input.ManifestName !== undefined && { + manifestName: input.ManifestName + }), + ...(input.MinBufferTimeSeconds !== undefined && { + minBufferTimeSeconds: input.MinBufferTimeSeconds + }), + ...(input.Profile !== undefined && { profile: input.Profile }), + ...(input.StreamSelection !== undefined && { + streamSelection: serializeAws_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }) + }; }; const serializeAws_restJson1_1DashPackage = ( input: DashPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DashManifests !== undefined) { - bodyParams["dashManifests"] = serializeAws_restJson1_1__listOfDashManifest( - input.DashManifests, - context - ); - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1DashEncryption( - input.Encryption, - context - ); - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - return bodyParams; + return { + ...(input.DashManifests !== undefined && { + dashManifests: serializeAws_restJson1_1__listOfDashManifest( + input.DashManifests, + context + ) + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1DashEncryption( + input.Encryption, + context + ) + }), + ...(input.SegmentDurationSeconds !== undefined && { + segmentDurationSeconds: input.SegmentDurationSeconds + }) + }; }; const serializeAws_restJson1_1HlsEncryption = ( input: HlsEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConstantInitializationVector !== undefined) { - bodyParams["constantInitializationVector"] = - input.ConstantInitializationVector; - } - if (input.EncryptionMethod !== undefined) { - bodyParams["encryptionMethod"] = input.EncryptionMethod; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.ConstantInitializationVector !== undefined && { + constantInitializationVector: input.ConstantInitializationVector + }), + ...(input.EncryptionMethod !== undefined && { + encryptionMethod: input.EncryptionMethod + }), + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1HlsManifest = ( input: HlsManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdMarkers !== undefined) { - bodyParams["adMarkers"] = input.AdMarkers; - } - if (input.IncludeIframeOnlyStream !== undefined) { - bodyParams["includeIframeOnlyStream"] = input.IncludeIframeOnlyStream; - } - if (input.ManifestName !== undefined) { - bodyParams["manifestName"] = input.ManifestName; - } - if (input.ProgramDateTimeIntervalSeconds !== undefined) { - bodyParams["programDateTimeIntervalSeconds"] = - input.ProgramDateTimeIntervalSeconds; - } - if (input.RepeatExtXKey !== undefined) { - bodyParams["repeatExtXKey"] = input.RepeatExtXKey; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - return bodyParams; + 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_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }) + }; }; const serializeAws_restJson1_1HlsPackage = ( input: HlsPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1HlsEncryption( - input.Encryption, - context - ); - } - if (input.HlsManifests !== undefined) { - bodyParams["hlsManifests"] = serializeAws_restJson1_1__listOfHlsManifest( - input.HlsManifests, - context - ); - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - if (input.UseAudioRenditionGroup !== undefined) { - bodyParams["useAudioRenditionGroup"] = input.UseAudioRenditionGroup; - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1HlsEncryption( + input.Encryption, + context + ) + }), + ...(input.HlsManifests !== undefined && { + hlsManifests: serializeAws_restJson1_1__listOfHlsManifest( + input.HlsManifests, + context + ) + }), + ...(input.SegmentDurationSeconds !== undefined && { + segmentDurationSeconds: input.SegmentDurationSeconds + }), + ...(input.UseAudioRenditionGroup !== undefined && { + useAudioRenditionGroup: input.UseAudioRenditionGroup + }) + }; }; const serializeAws_restJson1_1MssEncryption = ( input: MssEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1MssManifest = ( input: MssManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestName !== undefined) { - bodyParams["manifestName"] = input.ManifestName; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - return bodyParams; + return { + ...(input.ManifestName !== undefined && { + manifestName: input.ManifestName + }), + ...(input.StreamSelection !== undefined && { + streamSelection: serializeAws_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }) + }; }; const serializeAws_restJson1_1MssPackage = ( input: MssPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1MssEncryption( - input.Encryption, - context - ); - } - if (input.MssManifests !== undefined) { - bodyParams["mssManifests"] = serializeAws_restJson1_1__listOfMssManifest( - input.MssManifests, - context - ); - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1MssEncryption( + input.Encryption, + context + ) + }), + ...(input.MssManifests !== undefined && { + mssManifests: serializeAws_restJson1_1__listOfMssManifest( + input.MssManifests, + context + ) + }), + ...(input.SegmentDurationSeconds !== undefined && { + segmentDurationSeconds: input.SegmentDurationSeconds + }) + }; }; const serializeAws_restJson1_1SpekeKeyProvider = ( input: SpekeKeyProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoleArn !== undefined) { - bodyParams["roleArn"] = input.RoleArn; - } - if (input.SystemIds !== undefined) { - bodyParams["systemIds"] = serializeAws_restJson1_1__listOf__string( - input.SystemIds, - context - ); - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + return { + ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }), + ...(input.SystemIds !== undefined && { + systemIds: serializeAws_restJson1_1__listOf__string( + input.SystemIds, + context + ) + }), + ...(input.Url !== undefined && { url: input.Url }) + }; }; const serializeAws_restJson1_1StreamSelection = ( input: StreamSelection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxVideoBitsPerSecond !== undefined) { - bodyParams["maxVideoBitsPerSecond"] = input.MaxVideoBitsPerSecond; - } - if (input.MinVideoBitsPerSecond !== undefined) { - bodyParams["minVideoBitsPerSecond"] = input.MinVideoBitsPerSecond; - } - if (input.StreamOrder !== undefined) { - bodyParams["streamOrder"] = input.StreamOrder; - } - return bodyParams; + return { + ...(input.MaxVideoBitsPerSecond !== undefined && { + maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond + }), + ...(input.MinVideoBitsPerSecond !== undefined && { + minVideoBitsPerSecond: input.MinVideoBitsPerSecond + }), + ...(input.StreamOrder !== undefined && { streamOrder: input.StreamOrder }) + }; }; const serializeAws_restJson1_1__listOfDashManifest = ( diff --git a/clients/client-mediapackage/protocols/Aws_restJson1_1.ts b/clients/client-mediapackage/protocols/Aws_restJson1_1.ts index 806431d90df8..336281451b03 100644 --- a/clients/client-mediapackage/protocols/Aws_restJson1_1.ts +++ b/clients/client-mediapackage/protocols/Aws_restJson1_1.ts @@ -3274,361 +3274,322 @@ const serializeAws_restJson1_1Authorization = ( input: Authorization, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CdnIdentifierSecret !== undefined) { - bodyParams["cdnIdentifierSecret"] = input.CdnIdentifierSecret; - } - if (input.SecretsRoleArn !== undefined) { - bodyParams["secretsRoleArn"] = input.SecretsRoleArn; - } - return bodyParams; + return { + ...(input.CdnIdentifierSecret !== undefined && { + cdnIdentifierSecret: input.CdnIdentifierSecret + }), + ...(input.SecretsRoleArn !== undefined && { + secretsRoleArn: input.SecretsRoleArn + }) + }; }; const serializeAws_restJson1_1CmafEncryption = ( input: CmafEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyRotationIntervalSeconds !== undefined) { - bodyParams["keyRotationIntervalSeconds"] = input.KeyRotationIntervalSeconds; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.KeyRotationIntervalSeconds !== undefined && { + keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds + }), + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1CmafPackageCreateOrUpdateParameters = ( input: CmafPackageCreateOrUpdateParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1CmafEncryption( - input.Encryption, - context - ); - } - if (input.HlsManifests !== undefined) { - bodyParams[ - "hlsManifests" - ] = serializeAws_restJson1_1__listOfHlsManifestCreateOrUpdateParameters( - input.HlsManifests, - context - ); - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - if (input.SegmentPrefix !== undefined) { - bodyParams["segmentPrefix"] = input.SegmentPrefix; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1CmafEncryption( + input.Encryption, + context + ) + }), + ...(input.HlsManifests !== undefined && { + hlsManifests: serializeAws_restJson1_1__listOfHlsManifestCreateOrUpdateParameters( + input.HlsManifests, + context + ) + }), + ...(input.SegmentDurationSeconds !== undefined && { + segmentDurationSeconds: input.SegmentDurationSeconds + }), + ...(input.SegmentPrefix !== undefined && { + segmentPrefix: input.SegmentPrefix + }), + ...(input.StreamSelection !== undefined && { + streamSelection: serializeAws_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }) + }; }; const serializeAws_restJson1_1DashEncryption = ( input: DashEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KeyRotationIntervalSeconds !== undefined) { - bodyParams["keyRotationIntervalSeconds"] = input.KeyRotationIntervalSeconds; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.KeyRotationIntervalSeconds !== undefined && { + keyRotationIntervalSeconds: input.KeyRotationIntervalSeconds + }), + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1DashPackage = ( input: DashPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdTriggers !== undefined) { - bodyParams["adTriggers"] = serializeAws_restJson1_1AdTriggers( - input.AdTriggers, - context - ); - } - if (input.AdsOnDeliveryRestrictions !== undefined) { - bodyParams["adsOnDeliveryRestrictions"] = input.AdsOnDeliveryRestrictions; - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1DashEncryption( - input.Encryption, - context - ); - } - if (input.ManifestLayout !== undefined) { - bodyParams["manifestLayout"] = input.ManifestLayout; - } - if (input.ManifestWindowSeconds !== undefined) { - bodyParams["manifestWindowSeconds"] = input.ManifestWindowSeconds; - } - if (input.MinBufferTimeSeconds !== undefined) { - bodyParams["minBufferTimeSeconds"] = input.MinBufferTimeSeconds; - } - if (input.MinUpdatePeriodSeconds !== undefined) { - bodyParams["minUpdatePeriodSeconds"] = input.MinUpdatePeriodSeconds; - } - if (input.PeriodTriggers !== undefined) { - bodyParams[ - "periodTriggers" - ] = serializeAws_restJson1_1__listOf__PeriodTriggersElement( - input.PeriodTriggers, - context - ); - } - if (input.Profile !== undefined) { - bodyParams["profile"] = input.Profile; - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - if (input.SegmentTemplateFormat !== undefined) { - bodyParams["segmentTemplateFormat"] = input.SegmentTemplateFormat; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - if (input.SuggestedPresentationDelaySeconds !== undefined) { - bodyParams["suggestedPresentationDelaySeconds"] = - input.SuggestedPresentationDelaySeconds; - } - return bodyParams; + return { + ...(input.AdTriggers !== undefined && { + adTriggers: serializeAws_restJson1_1AdTriggers(input.AdTriggers, context) + }), + ...(input.AdsOnDeliveryRestrictions !== undefined && { + adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1DashEncryption( + 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_1__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_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }), + ...(input.SuggestedPresentationDelaySeconds !== undefined && { + suggestedPresentationDelaySeconds: input.SuggestedPresentationDelaySeconds + }) + }; }; const serializeAws_restJson1_1HlsEncryption = ( input: HlsEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConstantInitializationVector !== undefined) { - bodyParams["constantInitializationVector"] = - input.ConstantInitializationVector; - } - if (input.EncryptionMethod !== undefined) { - bodyParams["encryptionMethod"] = input.EncryptionMethod; - } - if (input.KeyRotationIntervalSeconds !== undefined) { - bodyParams["keyRotationIntervalSeconds"] = input.KeyRotationIntervalSeconds; - } - if (input.RepeatExtXKey !== undefined) { - bodyParams["repeatExtXKey"] = input.RepeatExtXKey; - } - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + 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_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1HlsManifestCreateOrUpdateParameters = ( input: HlsManifestCreateOrUpdateParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdMarkers !== undefined) { - bodyParams["adMarkers"] = input.AdMarkers; - } - if (input.AdTriggers !== undefined) { - bodyParams["adTriggers"] = serializeAws_restJson1_1AdTriggers( - input.AdTriggers, - context - ); - } - if (input.AdsOnDeliveryRestrictions !== undefined) { - bodyParams["adsOnDeliveryRestrictions"] = input.AdsOnDeliveryRestrictions; - } - if (input.Id !== undefined) { - bodyParams["id"] = input.Id; - } - if (input.IncludeIframeOnlyStream !== undefined) { - bodyParams["includeIframeOnlyStream"] = input.IncludeIframeOnlyStream; - } - if (input.ManifestName !== undefined) { - bodyParams["manifestName"] = input.ManifestName; - } - if (input.PlaylistType !== undefined) { - bodyParams["playlistType"] = input.PlaylistType; - } - if (input.PlaylistWindowSeconds !== undefined) { - bodyParams["playlistWindowSeconds"] = input.PlaylistWindowSeconds; - } - if (input.ProgramDateTimeIntervalSeconds !== undefined) { - bodyParams["programDateTimeIntervalSeconds"] = - input.ProgramDateTimeIntervalSeconds; - } - return bodyParams; + return { + ...(input.AdMarkers !== undefined && { adMarkers: input.AdMarkers }), + ...(input.AdTriggers !== undefined && { + adTriggers: serializeAws_restJson1_1AdTriggers(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 + }) + }; }; const serializeAws_restJson1_1HlsPackage = ( input: HlsPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdMarkers !== undefined) { - bodyParams["adMarkers"] = input.AdMarkers; - } - if (input.AdTriggers !== undefined) { - bodyParams["adTriggers"] = serializeAws_restJson1_1AdTriggers( - input.AdTriggers, - context - ); - } - if (input.AdsOnDeliveryRestrictions !== undefined) { - bodyParams["adsOnDeliveryRestrictions"] = input.AdsOnDeliveryRestrictions; - } - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1HlsEncryption( - input.Encryption, - context - ); - } - if (input.IncludeIframeOnlyStream !== undefined) { - bodyParams["includeIframeOnlyStream"] = input.IncludeIframeOnlyStream; - } - if (input.PlaylistType !== undefined) { - bodyParams["playlistType"] = input.PlaylistType; - } - if (input.PlaylistWindowSeconds !== undefined) { - bodyParams["playlistWindowSeconds"] = input.PlaylistWindowSeconds; - } - if (input.ProgramDateTimeIntervalSeconds !== undefined) { - bodyParams["programDateTimeIntervalSeconds"] = - input.ProgramDateTimeIntervalSeconds; - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - if (input.UseAudioRenditionGroup !== undefined) { - bodyParams["useAudioRenditionGroup"] = input.UseAudioRenditionGroup; - } - return bodyParams; + return { + ...(input.AdMarkers !== undefined && { adMarkers: input.AdMarkers }), + ...(input.AdTriggers !== undefined && { + adTriggers: serializeAws_restJson1_1AdTriggers(input.AdTriggers, context) + }), + ...(input.AdsOnDeliveryRestrictions !== undefined && { + adsOnDeliveryRestrictions: input.AdsOnDeliveryRestrictions + }), + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1HlsEncryption( + 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_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }), + ...(input.UseAudioRenditionGroup !== undefined && { + useAudioRenditionGroup: input.UseAudioRenditionGroup + }) + }; }; const serializeAws_restJson1_1MssEncryption = ( input: MssEncryption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SpekeKeyProvider !== undefined) { - bodyParams["spekeKeyProvider"] = serializeAws_restJson1_1SpekeKeyProvider( - input.SpekeKeyProvider, - context - ); - } - return bodyParams; + return { + ...(input.SpekeKeyProvider !== undefined && { + spekeKeyProvider: serializeAws_restJson1_1SpekeKeyProvider( + input.SpekeKeyProvider, + context + ) + }) + }; }; const serializeAws_restJson1_1MssPackage = ( input: MssPackage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encryption !== undefined) { - bodyParams["encryption"] = serializeAws_restJson1_1MssEncryption( - input.Encryption, - context - ); - } - if (input.ManifestWindowSeconds !== undefined) { - bodyParams["manifestWindowSeconds"] = input.ManifestWindowSeconds; - } - if (input.SegmentDurationSeconds !== undefined) { - bodyParams["segmentDurationSeconds"] = input.SegmentDurationSeconds; - } - if (input.StreamSelection !== undefined) { - bodyParams["streamSelection"] = serializeAws_restJson1_1StreamSelection( - input.StreamSelection, - context - ); - } - return bodyParams; + return { + ...(input.Encryption !== undefined && { + encryption: serializeAws_restJson1_1MssEncryption( + input.Encryption, + context + ) + }), + ...(input.ManifestWindowSeconds !== undefined && { + manifestWindowSeconds: input.ManifestWindowSeconds + }), + ...(input.SegmentDurationSeconds !== undefined && { + segmentDurationSeconds: input.SegmentDurationSeconds + }), + ...(input.StreamSelection !== undefined && { + streamSelection: serializeAws_restJson1_1StreamSelection( + input.StreamSelection, + context + ) + }) + }; }; const serializeAws_restJson1_1S3Destination = ( input: S3Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketName !== undefined) { - bodyParams["bucketName"] = input.BucketName; - } - if (input.ManifestKey !== undefined) { - bodyParams["manifestKey"] = input.ManifestKey; - } - if (input.RoleArn !== undefined) { - bodyParams["roleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.BucketName !== undefined && { bucketName: input.BucketName }), + ...(input.ManifestKey !== undefined && { manifestKey: input.ManifestKey }), + ...(input.RoleArn !== undefined && { roleArn: input.RoleArn }) + }; }; const serializeAws_restJson1_1SpekeKeyProvider = ( input: SpekeKeyProvider, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertificateArn !== undefined) { - bodyParams["certificateArn"] = input.CertificateArn; - } - if (input.ResourceId !== undefined) { - bodyParams["resourceId"] = input.ResourceId; - } - if (input.RoleArn !== undefined) { - bodyParams["roleArn"] = input.RoleArn; - } - if (input.SystemIds !== undefined) { - bodyParams["systemIds"] = serializeAws_restJson1_1__listOf__string( - input.SystemIds, - context - ); - } - if (input.Url !== undefined) { - bodyParams["url"] = input.Url; - } - return bodyParams; + 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_1__listOf__string( + input.SystemIds, + context + ) + }), + ...(input.Url !== undefined && { url: input.Url }) + }; }; const serializeAws_restJson1_1StreamSelection = ( input: StreamSelection, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxVideoBitsPerSecond !== undefined) { - bodyParams["maxVideoBitsPerSecond"] = input.MaxVideoBitsPerSecond; - } - if (input.MinVideoBitsPerSecond !== undefined) { - bodyParams["minVideoBitsPerSecond"] = input.MinVideoBitsPerSecond; - } - if (input.StreamOrder !== undefined) { - bodyParams["streamOrder"] = input.StreamOrder; - } - return bodyParams; + return { + ...(input.MaxVideoBitsPerSecond !== undefined && { + maxVideoBitsPerSecond: input.MaxVideoBitsPerSecond + }), + ...(input.MinVideoBitsPerSecond !== undefined && { + minVideoBitsPerSecond: input.MinVideoBitsPerSecond + }), + ...(input.StreamOrder !== undefined && { streamOrder: input.StreamOrder }) + }; }; const serializeAws_restJson1_1Tags = ( diff --git a/clients/client-mediastore/protocols/Aws_json1_1.ts b/clients/client-mediastore/protocols/Aws_json1_1.ts index 2cf15c07dfa0..db5fcf8561c9 100644 --- a/clients/client-mediastore/protocols/Aws_json1_1.ts +++ b/clients/client-mediastore/protocols/Aws_json1_1.ts @@ -2066,104 +2066,104 @@ const serializeAws_json1_1CorsRule = ( input: CorsRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowedHeaders !== undefined) { - bodyParams["AllowedHeaders"] = serializeAws_json1_1AllowedHeaders( - input.AllowedHeaders, - context - ); - } - if (input.AllowedMethods !== undefined) { - bodyParams["AllowedMethods"] = serializeAws_json1_1AllowedMethods( - input.AllowedMethods, - context - ); - } - if (input.AllowedOrigins !== undefined) { - bodyParams["AllowedOrigins"] = serializeAws_json1_1AllowedOrigins( - input.AllowedOrigins, - context - ); - } - if (input.ExposeHeaders !== undefined) { - bodyParams["ExposeHeaders"] = serializeAws_json1_1ExposeHeaders( - input.ExposeHeaders, - context - ); - } - if (input.MaxAgeSeconds !== undefined) { - bodyParams["MaxAgeSeconds"] = input.MaxAgeSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateContainerInput = ( input: CreateContainerInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1DeleteContainerInput = ( input: DeleteContainerInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1DeleteContainerPolicyInput = ( input: DeleteContainerPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1DeleteCorsPolicyInput = ( input: DeleteCorsPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1DeleteLifecyclePolicyInput = ( input: DeleteLifecyclePolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1DescribeContainerInput = ( input: DescribeContainerInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1ExposeHeaders = ( @@ -2177,136 +2177,121 @@ const serializeAws_json1_1GetContainerPolicyInput = ( input: GetContainerPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1GetCorsPolicyInput = ( input: GetCorsPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1GetLifecyclePolicyInput = ( input: GetLifecyclePolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1ListContainersInput = ( input: ListContainersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Resource !== undefined) { - bodyParams["Resource"] = input.Resource; - } - return bodyParams; + return { + ...(input.Resource !== undefined && { Resource: input.Resource }) + }; }; const serializeAws_json1_1PutContainerPolicyInput = ( input: PutContainerPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }), + ...(input.Policy !== undefined && { Policy: input.Policy }) + }; }; const serializeAws_json1_1PutCorsPolicyInput = ( input: PutCorsPolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - if (input.CorsPolicy !== undefined) { - bodyParams["CorsPolicy"] = serializeAws_json1_1CorsPolicy( - input.CorsPolicy, - context - ); - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }), + ...(input.CorsPolicy !== undefined && { + CorsPolicy: serializeAws_json1_1CorsPolicy(input.CorsPolicy, context) + }) + }; }; const serializeAws_json1_1PutLifecyclePolicyInput = ( input: PutLifecyclePolicyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - if (input.LifecyclePolicy !== undefined) { - bodyParams["LifecyclePolicy"] = input.LifecyclePolicy; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }), + ...(input.LifecyclePolicy !== undefined && { + LifecyclePolicy: input.LifecyclePolicy + }) + }; }; const serializeAws_json1_1StartAccessLoggingInput = ( input: StartAccessLoggingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1StopAccessLoggingInput = ( input: StopAccessLoggingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerName !== undefined) { - bodyParams["ContainerName"] = input.ContainerName; - } - return bodyParams; + return { + ...(input.ContainerName !== undefined && { + ContainerName: input.ContainerName + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -2327,31 +2312,24 @@ const serializeAws_json1_1TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Resource !== undefined) { - bodyParams["Resource"] = input.Resource; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.Resource !== undefined && { Resource: input.Resource }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Resource !== undefined) { - bodyParams["Resource"] = input.Resource; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.Resource !== undefined && { Resource: input.Resource }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const deserializeAws_json1_1AllowedHeaders = ( diff --git a/clients/client-mediatailor/protocols/Aws_restJson1_1.ts b/clients/client-mediatailor/protocols/Aws_restJson1_1.ts index f064d978ecea..550370922e28 100644 --- a/clients/client-mediatailor/protocols/Aws_restJson1_1.ts +++ b/clients/client-mediatailor/protocols/Aws_restJson1_1.ts @@ -900,42 +900,40 @@ const serializeAws_restJson1_1CdnConfiguration = ( input: CdnConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdSegmentUrlPrefix !== undefined) { - bodyParams["AdSegmentUrlPrefix"] = input.AdSegmentUrlPrefix; - } - if (input.ContentSegmentUrlPrefix !== undefined) { - bodyParams["ContentSegmentUrlPrefix"] = input.ContentSegmentUrlPrefix; - } - return bodyParams; + return { + ...(input.AdSegmentUrlPrefix !== undefined && { + AdSegmentUrlPrefix: input.AdSegmentUrlPrefix + }), + ...(input.ContentSegmentUrlPrefix !== undefined && { + ContentSegmentUrlPrefix: input.ContentSegmentUrlPrefix + }) + }; }; const serializeAws_restJson1_1DashConfigurationForPut = ( input: DashConfigurationForPut, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MpdLocation !== undefined) { - bodyParams["MpdLocation"] = input.MpdLocation; - } - if (input.OriginManifestType !== undefined) { - bodyParams["OriginManifestType"] = input.OriginManifestType; - } - return bodyParams; + return { + ...(input.MpdLocation !== undefined && { MpdLocation: input.MpdLocation }), + ...(input.OriginManifestType !== undefined && { + OriginManifestType: input.OriginManifestType + }) + }; }; const serializeAws_restJson1_1LivePreRollConfiguration = ( input: LivePreRollConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdDecisionServerUrl !== undefined) { - bodyParams["AdDecisionServerUrl"] = input.AdDecisionServerUrl; - } - if (input.MaxDurationSeconds !== undefined) { - bodyParams["MaxDurationSeconds"] = input.MaxDurationSeconds; - } - return bodyParams; + return { + ...(input.AdDecisionServerUrl !== undefined && { + AdDecisionServerUrl: input.AdDecisionServerUrl + }), + ...(input.MaxDurationSeconds !== undefined && { + MaxDurationSeconds: input.MaxDurationSeconds + }) + }; }; const serializeAws_restJson1_1__mapOf__string = ( diff --git a/clients/client-migration-hub/protocols/Aws_json1_1.ts b/clients/client-migration-hub/protocols/Aws_json1_1.ts index 54e90134714a..8a93171daf65 100644 --- a/clients/client-migration-hub/protocols/Aws_json1_1.ts +++ b/clients/client-migration-hub/protocols/Aws_json1_1.ts @@ -2824,364 +2824,306 @@ const serializeAws_json1_1AssociateCreatedArtifactRequest = ( input: AssociateCreatedArtifactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedArtifact !== undefined) { - bodyParams["CreatedArtifact"] = serializeAws_json1_1CreatedArtifact( - input.CreatedArtifact, - context - ); - } - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1AssociateDiscoveredResourceRequest = ( input: AssociateDiscoveredResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DiscoveredResource !== undefined) { - bodyParams["DiscoveredResource"] = serializeAws_json1_1DiscoveredResource( - input.DiscoveredResource, - context - ); - } - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateProgressUpdateStreamRequest = ( input: CreateProgressUpdateStreamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.ProgressUpdateStreamName !== undefined) { - bodyParams["ProgressUpdateStreamName"] = input.ProgressUpdateStreamName; - } - return bodyParams; + return { + ...(input.DryRun !== undefined && { DryRun: input.DryRun }), + ...(input.ProgressUpdateStreamName !== undefined && { + ProgressUpdateStreamName: input.ProgressUpdateStreamName + }) + }; }; const serializeAws_json1_1CreatedArtifact = ( input: CreatedArtifact, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteProgressUpdateStreamRequest = ( input: DeleteProgressUpdateStreamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.ProgressUpdateStreamName !== undefined) { - bodyParams["ProgressUpdateStreamName"] = input.ProgressUpdateStreamName; - } - return bodyParams; + return { + ...(input.DryRun !== undefined && { DryRun: input.DryRun }), + ...(input.ProgressUpdateStreamName !== undefined && { + ProgressUpdateStreamName: input.ProgressUpdateStreamName + }) + }; }; const serializeAws_json1_1DescribeApplicationStateRequest = ( input: DescribeApplicationStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationId !== undefined) { - bodyParams["ApplicationId"] = input.ApplicationId; - } - return bodyParams; + return { + ...(input.ApplicationId !== undefined && { + ApplicationId: input.ApplicationId + }) + }; }; const serializeAws_json1_1DescribeMigrationTaskRequest = ( input: DescribeMigrationTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + return { + ...(input.MigrationTaskName !== undefined && { + MigrationTaskName: input.MigrationTaskName + }), + ...(input.ProgressUpdateStream !== undefined && { + ProgressUpdateStream: input.ProgressUpdateStream + }) + }; }; const serializeAws_json1_1DisassociateCreatedArtifactRequest = ( input: DisassociateCreatedArtifactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedArtifactName !== undefined) { - bodyParams["CreatedArtifactName"] = input.CreatedArtifactName; - } - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DisassociateDiscoveredResourceRequest = ( input: DisassociateDiscoveredResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationId !== undefined) { - bodyParams["ConfigurationId"] = input.ConfigurationId; - } - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DiscoveredResource = ( input: DiscoveredResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationId !== undefined) { - bodyParams["ConfigurationId"] = input.ConfigurationId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - return bodyParams; + return { + ...(input.ConfigurationId !== undefined && { + ConfigurationId: input.ConfigurationId + }), + ...(input.Description !== undefined && { Description: input.Description }) + }; }; const serializeAws_json1_1ImportMigrationTaskRequest = ( input: ImportMigrationTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + return { + ...(input.DryRun !== undefined && { DryRun: input.DryRun }), + ...(input.MigrationTaskName !== undefined && { + MigrationTaskName: input.MigrationTaskName + }), + ...(input.ProgressUpdateStream !== undefined && { + ProgressUpdateStream: input.ProgressUpdateStream + }) + }; }; const serializeAws_json1_1ListApplicationStatesRequest = ( input: ListApplicationStatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationIds !== undefined) { - bodyParams["ApplicationIds"] = serializeAws_json1_1ApplicationIds( - input.ApplicationIds, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ApplicationIds !== undefined && { + ApplicationIds: serializeAws_json1_1ApplicationIds( + input.ApplicationIds, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListCreatedArtifactsRequest = ( input: ListCreatedArtifactsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListDiscoveredResourcesRequest = ( input: ListDiscoveredResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListMigrationTasksRequest = ( input: ListMigrationTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceName !== undefined) { - bodyParams["ResourceName"] = input.ResourceName; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceName !== undefined && { + ResourceName: input.ResourceName + }) + }; }; const serializeAws_json1_1ListProgressUpdateStreamsRequest = ( input: ListProgressUpdateStreamsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1NotifyApplicationStateRequest = ( input: NotifyApplicationStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationId !== undefined) { - bodyParams["ApplicationId"] = input.ApplicationId; - } - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.UpdateDateTime !== undefined) { - bodyParams["UpdateDateTime"] = Math.round( - input.UpdateDateTime.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1NotifyMigrationTaskStateRequest = ( input: NotifyMigrationTaskStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.NextUpdateSeconds !== undefined) { - bodyParams["NextUpdateSeconds"] = input.NextUpdateSeconds; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - if (input.Task !== undefined) { - bodyParams["Task"] = serializeAws_json1_1Task(input.Task, context); - } - if (input.UpdateDateTime !== undefined) { - bodyParams["UpdateDateTime"] = Math.round( - input.UpdateDateTime.getTime() / 1000 - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PutResourceAttributesRequest = ( input: PutResourceAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.MigrationTaskName !== undefined) { - bodyParams["MigrationTaskName"] = input.MigrationTaskName; - } - if (input.ProgressUpdateStream !== undefined) { - bodyParams["ProgressUpdateStream"] = input.ProgressUpdateStream; - } - if (input.ResourceAttributeList !== undefined) { - bodyParams[ - "ResourceAttributeList" - ] = serializeAws_json1_1ResourceAttributeList( - input.ResourceAttributeList, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ResourceAttribute = ( input: ResourceAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ResourceAttributeList = ( @@ -3197,17 +3139,15 @@ const serializeAws_json1_1Task = ( input: Task, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProgressPercent !== undefined) { - bodyParams["ProgressPercent"] = input.ProgressPercent; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.StatusDetail !== undefined) { - bodyParams["StatusDetail"] = input.StatusDetail; - } - return bodyParams; + return { + ...(input.ProgressPercent !== undefined && { + ProgressPercent: input.ProgressPercent + }), + ...(input.Status !== undefined && { Status: input.Status }), + ...(input.StatusDetail !== undefined && { + StatusDetail: input.StatusDetail + }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-migrationhub-config/protocols/Aws_json1_1.ts b/clients/client-migrationhub-config/protocols/Aws_json1_1.ts index 0889ba6000d1..7cec34f49c30 100644 --- a/clients/client-migrationhub-config/protocols/Aws_json1_1.ts +++ b/clients/client-migrationhub-config/protocols/Aws_json1_1.ts @@ -477,62 +477,45 @@ const serializeAws_json1_1CreateHomeRegionControlRequest = ( input: CreateHomeRegionControlRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.HomeRegion !== undefined) { - bodyParams["HomeRegion"] = input.HomeRegion; - } - if (input.Target !== undefined) { - bodyParams["Target"] = serializeAws_json1_1Target(input.Target, context); - } - return bodyParams; + return { + ...(input.DryRun !== undefined && { DryRun: input.DryRun }), + ...(input.HomeRegion !== undefined && { HomeRegion: input.HomeRegion }), + ...(input.Target !== undefined && { + Target: serializeAws_json1_1Target(input.Target, context) + }) + }; }; const serializeAws_json1_1DescribeHomeRegionControlsRequest = ( input: DescribeHomeRegionControlsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ControlId !== undefined) { - bodyParams["ControlId"] = input.ControlId; - } - if (input.HomeRegion !== undefined) { - bodyParams["HomeRegion"] = input.HomeRegion; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Target !== undefined) { - bodyParams["Target"] = serializeAws_json1_1Target(input.Target, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GetHomeRegionRequest = ( input: GetHomeRegionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1Target = ( input: Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-mq/protocols/Aws_restJson1_1.ts b/clients/client-mq/protocols/Aws_restJson1_1.ts index a2597a7940e1..f2bda70a8ee0 100644 --- a/clients/client-mq/protocols/Aws_restJson1_1.ts +++ b/clients/client-mq/protocols/Aws_restJson1_1.ts @@ -3616,82 +3616,59 @@ const serializeAws_restJson1_1ConfigurationId = ( input: ConfigurationId, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["id"] = input.Id; - } - if (input.Revision !== undefined) { - bodyParams["revision"] = input.Revision; - } - return bodyParams; + return { + ...(input.Id !== undefined && { id: input.Id }), + ...(input.Revision !== undefined && { revision: input.Revision }) + }; }; const serializeAws_restJson1_1EncryptionOptions = ( input: EncryptionOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.KmsKeyId; - } - if (input.UseAwsOwnedKey !== undefined) { - bodyParams["useAwsOwnedKey"] = input.UseAwsOwnedKey; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { kmsKeyId: input.KmsKeyId }), + ...(input.UseAwsOwnedKey !== undefined && { + useAwsOwnedKey: input.UseAwsOwnedKey + }) + }; }; const serializeAws_restJson1_1Logs = ( input: Logs, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Audit !== undefined) { - bodyParams["audit"] = input.Audit; - } - if (input.General !== undefined) { - bodyParams["general"] = input.General; - } - return bodyParams; + return { + ...(input.Audit !== undefined && { audit: input.Audit }), + ...(input.General !== undefined && { general: input.General }) + }; }; const serializeAws_restJson1_1User = ( input: User, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConsoleAccess !== undefined) { - bodyParams["consoleAccess"] = input.ConsoleAccess; - } - if (input.Groups !== undefined) { - bodyParams["groups"] = serializeAws_restJson1_1__listOf__string( - input.Groups, - context - ); - } - if (input.Password !== undefined) { - bodyParams["password"] = input.Password; - } - if (input.Username !== undefined) { - bodyParams["username"] = input.Username; - } - return bodyParams; + return { + ...(input.ConsoleAccess !== undefined && { + consoleAccess: input.ConsoleAccess + }), + ...(input.Groups !== undefined && { + groups: serializeAws_restJson1_1__listOf__string(input.Groups, context) + }), + ...(input.Password !== undefined && { password: input.Password }), + ...(input.Username !== undefined && { username: input.Username }) + }; }; const serializeAws_restJson1_1WeeklyStartTime = ( input: WeeklyStartTime, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DayOfWeek !== undefined) { - bodyParams["dayOfWeek"] = input.DayOfWeek; - } - if (input.TimeOfDay !== undefined) { - bodyParams["timeOfDay"] = input.TimeOfDay; - } - if (input.TimeZone !== undefined) { - bodyParams["timeZone"] = input.TimeZone; - } - return bodyParams; + return { + ...(input.DayOfWeek !== undefined && { dayOfWeek: input.DayOfWeek }), + ...(input.TimeOfDay !== undefined && { timeOfDay: input.TimeOfDay }), + ...(input.TimeZone !== undefined && { timeZone: input.TimeZone }) + }; }; const serializeAws_restJson1_1__listOfUser = ( diff --git a/clients/client-mturk/protocols/Aws_json1_1.ts b/clients/client-mturk/protocols/Aws_json1_1.ts index 0ff9ac2faafa..65270cb0c2da 100644 --- a/clients/client-mturk/protocols/Aws_json1_1.ts +++ b/clients/client-mturk/protocols/Aws_json1_1.ts @@ -3774,31 +3774,31 @@ const serializeAws_json1_1AcceptQualificationRequestRequest = ( input: AcceptQualificationRequestRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IntegerValue !== undefined) { - bodyParams["IntegerValue"] = input.IntegerValue; - } - if (input.QualificationRequestId !== undefined) { - bodyParams["QualificationRequestId"] = input.QualificationRequestId; - } - return bodyParams; + return { + ...(input.IntegerValue !== undefined && { + IntegerValue: input.IntegerValue + }), + ...(input.QualificationRequestId !== undefined && { + QualificationRequestId: input.QualificationRequestId + }) + }; }; const serializeAws_json1_1ApproveAssignmentRequest = ( input: ApproveAssignmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentId !== undefined) { - bodyParams["AssignmentId"] = input.AssignmentId; - } - if (input.OverrideRejection !== undefined) { - bodyParams["OverrideRejection"] = input.OverrideRejection; - } - if (input.RequesterFeedback !== undefined) { - bodyParams["RequesterFeedback"] = input.RequesterFeedback; - } - return bodyParams; + return { + ...(input.AssignmentId !== undefined && { + AssignmentId: input.AssignmentId + }), + ...(input.OverrideRejection !== undefined && { + OverrideRejection: input.OverrideRejection + }), + ...(input.RequesterFeedback !== undefined && { + RequesterFeedback: input.RequesterFeedback + }) + }; }; const serializeAws_json1_1AssignmentStatusList = ( @@ -3812,247 +3812,190 @@ const serializeAws_json1_1AssociateQualificationWithWorkerRequest = ( input: AssociateQualificationWithWorkerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IntegerValue !== undefined) { - bodyParams["IntegerValue"] = input.IntegerValue; - } - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - if (input.SendNotification !== undefined) { - bodyParams["SendNotification"] = input.SendNotification; - } - if (input.WorkerId !== undefined) { - bodyParams["WorkerId"] = input.WorkerId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateAdditionalAssignmentsForHITRequest = ( input: CreateAdditionalAssignmentsForHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - if (input.NumberOfAdditionalAssignments !== undefined) { - bodyParams["NumberOfAdditionalAssignments"] = - input.NumberOfAdditionalAssignments; - } - if (input.UniqueRequestToken !== undefined) { - bodyParams["UniqueRequestToken"] = input.UniqueRequestToken; - } - return bodyParams; + return { + ...(input.HITId !== undefined && { HITId: input.HITId }), + ...(input.NumberOfAdditionalAssignments !== undefined && { + NumberOfAdditionalAssignments: input.NumberOfAdditionalAssignments + }), + ...(input.UniqueRequestToken !== undefined && { + UniqueRequestToken: input.UniqueRequestToken + }) + }; }; const serializeAws_json1_1CreateHITRequest = ( input: CreateHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentDurationInSeconds !== undefined) { - bodyParams["AssignmentDurationInSeconds"] = - input.AssignmentDurationInSeconds; - } - if (input.AssignmentReviewPolicy !== undefined) { - bodyParams["AssignmentReviewPolicy"] = serializeAws_json1_1ReviewPolicy( - input.AssignmentReviewPolicy, - context - ); - } - if (input.AutoApprovalDelayInSeconds !== undefined) { - bodyParams["AutoApprovalDelayInSeconds"] = input.AutoApprovalDelayInSeconds; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.HITLayoutId !== undefined) { - bodyParams["HITLayoutId"] = input.HITLayoutId; - } - if (input.HITLayoutParameters !== undefined) { - bodyParams[ - "HITLayoutParameters" - ] = serializeAws_json1_1HITLayoutParameterList( - input.HITLayoutParameters, - context - ); - } - if (input.HITReviewPolicy !== undefined) { - bodyParams["HITReviewPolicy"] = serializeAws_json1_1ReviewPolicy( - input.HITReviewPolicy, - context - ); - } - if (input.Keywords !== undefined) { - bodyParams["Keywords"] = input.Keywords; - } - if (input.LifetimeInSeconds !== undefined) { - bodyParams["LifetimeInSeconds"] = input.LifetimeInSeconds; - } - if (input.MaxAssignments !== undefined) { - bodyParams["MaxAssignments"] = input.MaxAssignments; - } - if (input.QualificationRequirements !== undefined) { - bodyParams[ - "QualificationRequirements" - ] = serializeAws_json1_1QualificationRequirementList( - input.QualificationRequirements, - context - ); - } - if (input.Question !== undefined) { - bodyParams["Question"] = input.Question; - } - if (input.RequesterAnnotation !== undefined) { - bodyParams["RequesterAnnotation"] = input.RequesterAnnotation; - } - if (input.Reward !== undefined) { - bodyParams["Reward"] = input.Reward; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.UniqueRequestToken !== undefined) { - bodyParams["UniqueRequestToken"] = input.UniqueRequestToken; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateHITTypeRequest = ( input: CreateHITTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentDurationInSeconds !== undefined) { - bodyParams["AssignmentDurationInSeconds"] = - input.AssignmentDurationInSeconds; - } - if (input.AutoApprovalDelayInSeconds !== undefined) { - bodyParams["AutoApprovalDelayInSeconds"] = input.AutoApprovalDelayInSeconds; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Keywords !== undefined) { - bodyParams["Keywords"] = input.Keywords; - } - if (input.QualificationRequirements !== undefined) { - bodyParams[ - "QualificationRequirements" - ] = serializeAws_json1_1QualificationRequirementList( - input.QualificationRequirements, - context - ); - } - if (input.Reward !== undefined) { - bodyParams["Reward"] = input.Reward; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateHITWithHITTypeRequest = ( input: CreateHITWithHITTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentReviewPolicy !== undefined) { - bodyParams["AssignmentReviewPolicy"] = serializeAws_json1_1ReviewPolicy( - input.AssignmentReviewPolicy, - context - ); - } - if (input.HITLayoutId !== undefined) { - bodyParams["HITLayoutId"] = input.HITLayoutId; - } - if (input.HITLayoutParameters !== undefined) { - bodyParams[ - "HITLayoutParameters" - ] = serializeAws_json1_1HITLayoutParameterList( - input.HITLayoutParameters, - context - ); - } - if (input.HITReviewPolicy !== undefined) { - bodyParams["HITReviewPolicy"] = serializeAws_json1_1ReviewPolicy( - input.HITReviewPolicy, - context - ); - } - if (input.HITTypeId !== undefined) { - bodyParams["HITTypeId"] = input.HITTypeId; - } - if (input.LifetimeInSeconds !== undefined) { - bodyParams["LifetimeInSeconds"] = input.LifetimeInSeconds; - } - if (input.MaxAssignments !== undefined) { - bodyParams["MaxAssignments"] = input.MaxAssignments; - } - if (input.Question !== undefined) { - bodyParams["Question"] = input.Question; - } - if (input.RequesterAnnotation !== undefined) { - bodyParams["RequesterAnnotation"] = input.RequesterAnnotation; - } - if (input.UniqueRequestToken !== undefined) { - bodyParams["UniqueRequestToken"] = input.UniqueRequestToken; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateQualificationTypeRequest = ( input: CreateQualificationTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnswerKey !== undefined) { - bodyParams["AnswerKey"] = input.AnswerKey; - } - if (input.AutoGranted !== undefined) { - bodyParams["AutoGranted"] = input.AutoGranted; - } - if (input.AutoGrantedValue !== undefined) { - bodyParams["AutoGrantedValue"] = input.AutoGrantedValue; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Keywords !== undefined) { - bodyParams["Keywords"] = input.Keywords; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.QualificationTypeStatus !== undefined) { - bodyParams["QualificationTypeStatus"] = input.QualificationTypeStatus; - } - if (input.RetryDelayInSeconds !== undefined) { - bodyParams["RetryDelayInSeconds"] = input.RetryDelayInSeconds; - } - if (input.Test !== undefined) { - bodyParams["Test"] = input.Test; - } - if (input.TestDurationInSeconds !== undefined) { - bodyParams["TestDurationInSeconds"] = input.TestDurationInSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateWorkerBlockRequest = ( input: CreateWorkerBlockRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Reason !== undefined) { - bodyParams["Reason"] = input.Reason; - } - if (input.WorkerId !== undefined) { - bodyParams["WorkerId"] = input.WorkerId; - } - return bodyParams; + return { + ...(input.Reason !== undefined && { Reason: input.Reason }), + ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }) + }; }; const serializeAws_json1_1CustomerIdList = ( @@ -4066,53 +4009,43 @@ const serializeAws_json1_1DeleteHITRequest = ( input: DeleteHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - return bodyParams; + return { + ...(input.HITId !== undefined && { HITId: input.HITId }) + }; }; const serializeAws_json1_1DeleteQualificationTypeRequest = ( input: DeleteQualificationTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - return bodyParams; + return { + ...(input.QualificationTypeId !== undefined && { + QualificationTypeId: input.QualificationTypeId + }) + }; }; const serializeAws_json1_1DeleteWorkerBlockRequest = ( input: DeleteWorkerBlockRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Reason !== undefined) { - bodyParams["Reason"] = input.Reason; - } - if (input.WorkerId !== undefined) { - bodyParams["WorkerId"] = input.WorkerId; - } - return bodyParams; + return { + ...(input.Reason !== undefined && { Reason: input.Reason }), + ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }) + }; }; const serializeAws_json1_1DisassociateQualificationFromWorkerRequest = ( input: DisassociateQualificationFromWorkerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - if (input.Reason !== undefined) { - bodyParams["Reason"] = input.Reason; - } - if (input.WorkerId !== undefined) { - bodyParams["WorkerId"] = input.WorkerId; - } - return bodyParams; + return { + ...(input.QualificationTypeId !== undefined && { + QualificationTypeId: input.QualificationTypeId + }), + ...(input.Reason !== undefined && { Reason: input.Reason }), + ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }) + }; }; const serializeAws_json1_1EventTypeList = ( @@ -4126,83 +4059,74 @@ const serializeAws_json1_1GetAccountBalanceRequest = ( input: GetAccountBalanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetAssignmentRequest = ( input: GetAssignmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentId !== undefined) { - bodyParams["AssignmentId"] = input.AssignmentId; - } - return bodyParams; + return { + ...(input.AssignmentId !== undefined && { + AssignmentId: input.AssignmentId + }) + }; }; const serializeAws_json1_1GetFileUploadURLRequest = ( input: GetFileUploadURLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentId !== undefined) { - bodyParams["AssignmentId"] = input.AssignmentId; - } - if (input.QuestionIdentifier !== undefined) { - bodyParams["QuestionIdentifier"] = input.QuestionIdentifier; - } - return bodyParams; + return { + ...(input.AssignmentId !== undefined && { + AssignmentId: input.AssignmentId + }), + ...(input.QuestionIdentifier !== undefined && { + QuestionIdentifier: input.QuestionIdentifier + }) + }; }; const serializeAws_json1_1GetHITRequest = ( input: GetHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - return bodyParams; + return { + ...(input.HITId !== undefined && { HITId: input.HITId }) + }; }; const serializeAws_json1_1GetQualificationScoreRequest = ( input: GetQualificationScoreRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - if (input.WorkerId !== undefined) { - bodyParams["WorkerId"] = input.WorkerId; - } - return bodyParams; + return { + ...(input.QualificationTypeId !== undefined && { + QualificationTypeId: input.QualificationTypeId + }), + ...(input.WorkerId !== undefined && { WorkerId: input.WorkerId }) + }; }; const serializeAws_json1_1GetQualificationTypeRequest = ( input: GetQualificationTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - return bodyParams; + return { + ...(input.QualificationTypeId !== undefined && { + QualificationTypeId: input.QualificationTypeId + }) + }; }; const serializeAws_json1_1HITLayoutParameter = ( input: HITLayoutParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1HITLayoutParameterList = ( @@ -4225,211 +4149,153 @@ const serializeAws_json1_1ListAssignmentsForHITRequest = ( input: ListAssignmentsForHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentStatuses !== undefined) { - bodyParams["AssignmentStatuses"] = serializeAws_json1_1AssignmentStatusList( - input.AssignmentStatuses, - context - ); - } - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListBonusPaymentsRequest = ( input: ListBonusPaymentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentId !== undefined) { - bodyParams["AssignmentId"] = input.AssignmentId; - } - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListHITsForQualificationTypeRequest = ( input: ListHITsForQualificationTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.QualificationTypeId !== undefined && { + QualificationTypeId: input.QualificationTypeId + }) + }; }; const serializeAws_json1_1ListHITsRequest = ( input: ListHITsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListQualificationRequestsRequest = ( input: ListQualificationRequestsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.QualificationTypeId !== undefined && { + QualificationTypeId: input.QualificationTypeId + }) + }; }; const serializeAws_json1_1ListQualificationTypesRequest = ( input: ListQualificationTypesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MustBeOwnedByCaller !== undefined) { - bodyParams["MustBeOwnedByCaller"] = input.MustBeOwnedByCaller; - } - if (input.MustBeRequestable !== undefined) { - bodyParams["MustBeRequestable"] = input.MustBeRequestable; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Query !== undefined) { - bodyParams["Query"] = input.Query; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListReviewPolicyResultsForHITRequest = ( input: ListReviewPolicyResultsForHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PolicyLevels !== undefined) { - bodyParams["PolicyLevels"] = serializeAws_json1_1ReviewPolicyLevelList( - input.PolicyLevels, - context - ); - } - if (input.RetrieveActions !== undefined) { - bodyParams["RetrieveActions"] = input.RetrieveActions; - } - if (input.RetrieveResults !== undefined) { - bodyParams["RetrieveResults"] = input.RetrieveResults; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListReviewableHITsRequest = ( input: ListReviewableHITsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITTypeId !== undefined) { - bodyParams["HITTypeId"] = input.HITTypeId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListWorkerBlocksRequest = ( input: ListWorkerBlocksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListWorkersWithQualificationTypeRequest = ( input: ListWorkersWithQualificationTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Locale = ( input: Locale, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Country !== undefined) { - bodyParams["Country"] = input.Country; - } - if (input.Subdivision !== undefined) { - bodyParams["Subdivision"] = input.Subdivision; - } - return bodyParams; + return { + ...(input.Country !== undefined && { Country: input.Country }), + ...(input.Subdivision !== undefined && { Subdivision: input.Subdivision }) + }; }; const serializeAws_json1_1LocaleList = ( @@ -4443,60 +4309,39 @@ const serializeAws_json1_1NotificationSpecification = ( input: NotificationSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Destination !== undefined) { - bodyParams["Destination"] = input.Destination; - } - if (input.EventTypes !== undefined) { - bodyParams["EventTypes"] = serializeAws_json1_1EventTypeList( - input.EventTypes, - context - ); - } - if (input.Transport !== undefined) { - bodyParams["Transport"] = input.Transport; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NotifyWorkersRequest = ( input: NotifyWorkersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageText !== undefined) { - bodyParams["MessageText"] = input.MessageText; - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = input.Subject; - } - if (input.WorkerIds !== undefined) { - bodyParams["WorkerIds"] = serializeAws_json1_1CustomerIdList( - input.WorkerIds, - context - ); - } - return bodyParams; + return { + ...(input.MessageText !== undefined && { MessageText: input.MessageText }), + ...(input.Subject !== undefined && { Subject: input.Subject }), + ...(input.WorkerIds !== undefined && { + WorkerIds: serializeAws_json1_1CustomerIdList(input.WorkerIds, context) + }) + }; }; const serializeAws_json1_1ParameterMapEntry = ( input: ParameterMapEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1StringList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1StringList(input.Values, context) + }) + }; }; const serializeAws_json1_1ParameterMapEntryList = ( @@ -4512,23 +4357,18 @@ const serializeAws_json1_1PolicyParameter = ( input: PolicyParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.MapEntries !== undefined) { - bodyParams["MapEntries"] = serializeAws_json1_1ParameterMapEntryList( - input.MapEntries, - context - ); - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1StringList( - input.Values, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1PolicyParameterList = ( @@ -4544,32 +4384,27 @@ const serializeAws_json1_1QualificationRequirement = ( input: QualificationRequirement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActionsGuarded !== undefined) { - bodyParams["ActionsGuarded"] = input.ActionsGuarded; - } - if (input.Comparator !== undefined) { - bodyParams["Comparator"] = input.Comparator; - } - if (input.IntegerValues !== undefined) { - bodyParams["IntegerValues"] = serializeAws_json1_1IntegerList( - input.IntegerValues, - context - ); - } - if (input.LocaleValues !== undefined) { - bodyParams["LocaleValues"] = serializeAws_json1_1LocaleList( - input.LocaleValues, - context - ); - } - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - if (input.RequiredToPreview !== undefined) { - bodyParams["RequiredToPreview"] = input.RequiredToPreview; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1QualificationRequirementList = ( @@ -4585,45 +4420,41 @@ const serializeAws_json1_1RejectAssignmentRequest = ( input: RejectAssignmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentId !== undefined) { - bodyParams["AssignmentId"] = input.AssignmentId; - } - if (input.RequesterFeedback !== undefined) { - bodyParams["RequesterFeedback"] = input.RequesterFeedback; - } - return bodyParams; + return { + ...(input.AssignmentId !== undefined && { + AssignmentId: input.AssignmentId + }), + ...(input.RequesterFeedback !== undefined && { + RequesterFeedback: input.RequesterFeedback + }) + }; }; const serializeAws_json1_1RejectQualificationRequestRequest = ( input: RejectQualificationRequestRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QualificationRequestId !== undefined) { - bodyParams["QualificationRequestId"] = input.QualificationRequestId; - } - if (input.Reason !== undefined) { - bodyParams["Reason"] = input.Reason; - } - return bodyParams; + return { + ...(input.QualificationRequestId !== undefined && { + QualificationRequestId: input.QualificationRequestId + }), + ...(input.Reason !== undefined && { Reason: input.Reason }) + }; }; const serializeAws_json1_1ReviewPolicy = ( input: ReviewPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1PolicyParameterList( - input.Parameters, - context - ); - } - if (input.PolicyName !== undefined) { - bodyParams["PolicyName"] = input.PolicyName; - } - return bodyParams; + return { + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_1PolicyParameterList( + input.Parameters, + context + ) + }), + ...(input.PolicyName !== undefined && { PolicyName: input.PolicyName }) + }; }; const serializeAws_json1_1ReviewPolicyLevelList = ( @@ -4637,40 +4468,34 @@ const serializeAws_json1_1SendBonusRequest = ( input: SendBonusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssignmentId !== undefined) { - bodyParams["AssignmentId"] = input.AssignmentId; - } - if (input.BonusAmount !== undefined) { - bodyParams["BonusAmount"] = input.BonusAmount; - } - if (input.Reason !== undefined) { - bodyParams["Reason"] = input.Reason; - } - if (input.UniqueRequestToken !== undefined) { - bodyParams["UniqueRequestToken"] = input.UniqueRequestToken; - } - if (input.WorkerId !== undefined) { - bodyParams["WorkerId"] = input.WorkerId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SendTestEventNotificationRequest = ( input: SendTestEventNotificationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1NotificationSpecification( - input.Notification, - context - ); - } - if (input.TestEventType !== undefined) { - bodyParams["TestEventType"] = input.TestEventType; - } - return bodyParams; + return { + ...(input.Notification !== undefined && { + Notification: serializeAws_json1_1NotificationSpecification( + input.Notification, + context + ) + }), + ...(input.TestEventType !== undefined && { + TestEventType: input.TestEventType + }) + }; }; const serializeAws_json1_1StringList = ( @@ -4684,97 +4509,75 @@ const serializeAws_json1_1UpdateExpirationForHITRequest = ( input: UpdateExpirationForHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExpireAt !== undefined) { - bodyParams["ExpireAt"] = Math.round(input.ExpireAt.getTime() / 1000); - } - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - return bodyParams; + return { + ...(input.ExpireAt !== undefined && { + ExpireAt: Math.round(input.ExpireAt.getTime() / 1000) + }), + ...(input.HITId !== undefined && { HITId: input.HITId }) + }; }; const serializeAws_json1_1UpdateHITReviewStatusRequest = ( input: UpdateHITReviewStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - if (input.Revert !== undefined) { - bodyParams["Revert"] = input.Revert; - } - return bodyParams; + return { + ...(input.HITId !== undefined && { HITId: input.HITId }), + ...(input.Revert !== undefined && { Revert: input.Revert }) + }; }; const serializeAws_json1_1UpdateHITTypeOfHITRequest = ( input: UpdateHITTypeOfHITRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HITId !== undefined) { - bodyParams["HITId"] = input.HITId; - } - if (input.HITTypeId !== undefined) { - bodyParams["HITTypeId"] = input.HITTypeId; - } - return bodyParams; + return { + ...(input.HITId !== undefined && { HITId: input.HITId }), + ...(input.HITTypeId !== undefined && { HITTypeId: input.HITTypeId }) + }; }; const serializeAws_json1_1UpdateNotificationSettingsRequest = ( input: UpdateNotificationSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Active !== undefined) { - bodyParams["Active"] = input.Active; - } - if (input.HITTypeId !== undefined) { - bodyParams["HITTypeId"] = input.HITTypeId; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1NotificationSpecification( - input.Notification, - context - ); - } - return bodyParams; + return { + ...(input.Active !== undefined && { Active: input.Active }), + ...(input.HITTypeId !== undefined && { HITTypeId: input.HITTypeId }), + ...(input.Notification !== undefined && { + Notification: serializeAws_json1_1NotificationSpecification( + input.Notification, + context + ) + }) + }; }; const serializeAws_json1_1UpdateQualificationTypeRequest = ( input: UpdateQualificationTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnswerKey !== undefined) { - bodyParams["AnswerKey"] = input.AnswerKey; - } - if (input.AutoGranted !== undefined) { - bodyParams["AutoGranted"] = input.AutoGranted; - } - if (input.AutoGrantedValue !== undefined) { - bodyParams["AutoGrantedValue"] = input.AutoGrantedValue; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.QualificationTypeId !== undefined) { - bodyParams["QualificationTypeId"] = input.QualificationTypeId; - } - if (input.QualificationTypeStatus !== undefined) { - bodyParams["QualificationTypeStatus"] = input.QualificationTypeStatus; - } - if (input.RetryDelayInSeconds !== undefined) { - bodyParams["RetryDelayInSeconds"] = input.RetryDelayInSeconds; - } - if (input.Test !== undefined) { - bodyParams["Test"] = input.Test; - } - if (input.TestDurationInSeconds !== undefined) { - bodyParams["TestDurationInSeconds"] = input.TestDurationInSeconds; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1AcceptQualificationRequestResponse = ( diff --git a/clients/client-networkmanager/protocols/Aws_restJson1_1.ts b/clients/client-networkmanager/protocols/Aws_restJson1_1.ts index 46e41822ac87..af17845ff10b 100644 --- a/clients/client-networkmanager/protocols/Aws_restJson1_1.ts +++ b/clients/client-networkmanager/protocols/Aws_restJson1_1.ts @@ -4947,45 +4947,33 @@ const serializeAws_restJson1_1Bandwidth = ( input: Bandwidth, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DownloadSpeed !== undefined) { - bodyParams["DownloadSpeed"] = input.DownloadSpeed; - } - if (input.UploadSpeed !== undefined) { - bodyParams["UploadSpeed"] = input.UploadSpeed; - } - return bodyParams; + return { + ...(input.DownloadSpeed !== undefined && { + DownloadSpeed: input.DownloadSpeed + }), + ...(input.UploadSpeed !== undefined && { UploadSpeed: input.UploadSpeed }) + }; }; const serializeAws_restJson1_1Location = ( input: Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.Latitude !== undefined) { - bodyParams["Latitude"] = input.Latitude; - } - if (input.Longitude !== undefined) { - bodyParams["Longitude"] = input.Longitude; - } - return bodyParams; + return { + ...(input.Address !== undefined && { Address: input.Address }), + ...(input.Latitude !== undefined && { Latitude: input.Latitude }), + ...(input.Longitude !== undefined && { Longitude: input.Longitude }) + }; }; const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagList = ( diff --git a/clients/client-opsworks/protocols/Aws_json1_1.ts b/clients/client-opsworks/protocols/Aws_json1_1.ts index 32e7aceabb02..28041a67d4c5 100644 --- a/clients/client-opsworks/protocols/Aws_json1_1.ts +++ b/clients/client-opsworks/protocols/Aws_json1_1.ts @@ -6709,108 +6709,87 @@ const serializeAws_json1_1AssignInstanceRequest = ( input: AssignInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.LayerIds !== undefined && { + LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) + }) + }; }; const serializeAws_json1_1AssignVolumeRequest = ( input: AssignVolumeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.VolumeId !== undefined) { - bodyParams["VolumeId"] = input.VolumeId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }) + }; }; const serializeAws_json1_1AssociateElasticIpRequest = ( input: AssociateElasticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticIp !== undefined) { - bodyParams["ElasticIp"] = input.ElasticIp; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1AttachElasticLoadBalancerRequest = ( input: AttachElasticLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticLoadBalancerName !== undefined) { - bodyParams["ElasticLoadBalancerName"] = input.ElasticLoadBalancerName; - } - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - return bodyParams; + return { + ...(input.ElasticLoadBalancerName !== undefined && { + ElasticLoadBalancerName: input.ElasticLoadBalancerName + }), + ...(input.LayerId !== undefined && { LayerId: input.LayerId }) + }; }; const serializeAws_json1_1AutoScalingThresholds = ( input: AutoScalingThresholds, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alarms !== undefined) { - bodyParams["Alarms"] = serializeAws_json1_1Strings(input.Alarms, context); - } - if (input.CpuThreshold !== undefined) { - bodyParams["CpuThreshold"] = input.CpuThreshold; - } - if (input.IgnoreMetricsTime !== undefined) { - bodyParams["IgnoreMetricsTime"] = input.IgnoreMetricsTime; - } - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.LoadThreshold !== undefined) { - bodyParams["LoadThreshold"] = input.LoadThreshold; - } - if (input.MemoryThreshold !== undefined) { - bodyParams["MemoryThreshold"] = input.MemoryThreshold; - } - if (input.ThresholdsWaitTime !== undefined) { - bodyParams["ThresholdsWaitTime"] = input.ThresholdsWaitTime; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1BlockDeviceMapping = ( input: BlockDeviceMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceName !== undefined) { - bodyParams["DeviceName"] = input.DeviceName; - } - if (input.Ebs !== undefined) { - bodyParams["Ebs"] = serializeAws_json1_1EbsBlockDevice(input.Ebs, context); - } - if (input.NoDevice !== undefined) { - bodyParams["NoDevice"] = input.NoDevice; - } - if (input.VirtualName !== undefined) { - bodyParams["VirtualName"] = input.VirtualName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1BlockDeviceMappings = ( @@ -6826,163 +6805,133 @@ const serializeAws_json1_1ChefConfiguration = ( input: ChefConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BerkshelfVersion !== undefined) { - bodyParams["BerkshelfVersion"] = input.BerkshelfVersion; - } - if (input.ManageBerkshelf !== undefined) { - bodyParams["ManageBerkshelf"] = input.ManageBerkshelf; - } - return bodyParams; + return { + ...(input.BerkshelfVersion !== undefined && { + BerkshelfVersion: input.BerkshelfVersion + }), + ...(input.ManageBerkshelf !== undefined && { + ManageBerkshelf: input.ManageBerkshelf + }) + }; }; const serializeAws_json1_1CloneStackRequest = ( input: CloneStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentVersion !== undefined) { - bodyParams["AgentVersion"] = input.AgentVersion; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1StackAttributes( - input.Attributes, - context - ); - } - if (input.ChefConfiguration !== undefined) { - bodyParams["ChefConfiguration"] = serializeAws_json1_1ChefConfiguration( - input.ChefConfiguration, - context - ); - } - if (input.CloneAppIds !== undefined) { - bodyParams["CloneAppIds"] = serializeAws_json1_1Strings( - input.CloneAppIds, - context - ); - } - if (input.ClonePermissions !== undefined) { - bodyParams["ClonePermissions"] = input.ClonePermissions; - } - if (input.ConfigurationManager !== undefined) { - bodyParams[ - "ConfigurationManager" - ] = serializeAws_json1_1StackConfigurationManager( - input.ConfigurationManager, - context - ); - } - if (input.CustomCookbooksSource !== undefined) { - bodyParams["CustomCookbooksSource"] = serializeAws_json1_1Source( - input.CustomCookbooksSource, - context - ); - } - if (input.CustomJson !== undefined) { - bodyParams["CustomJson"] = input.CustomJson; - } - if (input.DefaultAvailabilityZone !== undefined) { - bodyParams["DefaultAvailabilityZone"] = input.DefaultAvailabilityZone; - } - if (input.DefaultInstanceProfileArn !== undefined) { - bodyParams["DefaultInstanceProfileArn"] = input.DefaultInstanceProfileArn; - } - if (input.DefaultOs !== undefined) { - bodyParams["DefaultOs"] = input.DefaultOs; - } - if (input.DefaultRootDeviceType !== undefined) { - bodyParams["DefaultRootDeviceType"] = input.DefaultRootDeviceType; - } - if (input.DefaultSshKeyName !== undefined) { - bodyParams["DefaultSshKeyName"] = input.DefaultSshKeyName; - } - if (input.DefaultSubnetId !== undefined) { - bodyParams["DefaultSubnetId"] = input.DefaultSubnetId; - } - if (input.HostnameTheme !== undefined) { - bodyParams["HostnameTheme"] = input.HostnameTheme; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.SourceStackId !== undefined) { - bodyParams["SourceStackId"] = input.SourceStackId; - } - if (input.UseCustomCookbooks !== undefined) { - bodyParams["UseCustomCookbooks"] = input.UseCustomCookbooks; - } - if (input.UseOpsworksSecurityGroups !== undefined) { - bodyParams["UseOpsworksSecurityGroups"] = input.UseOpsworksSecurityGroups; - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CloudWatchLogsConfiguration = ( input: CloudWatchLogsConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.LogStreams !== undefined) { - bodyParams["LogStreams"] = serializeAws_json1_1CloudWatchLogsLogStreams( - input.LogStreams, - context - ); - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.LogStreams !== undefined && { + LogStreams: serializeAws_json1_1CloudWatchLogsLogStreams( + input.LogStreams, + context + ) + }) + }; }; const serializeAws_json1_1CloudWatchLogsLogStream = ( input: CloudWatchLogsLogStream, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchCount !== undefined) { - bodyParams["BatchCount"] = input.BatchCount; - } - if (input.BatchSize !== undefined) { - bodyParams["BatchSize"] = input.BatchSize; - } - if (input.BufferDuration !== undefined) { - bodyParams["BufferDuration"] = input.BufferDuration; - } - if (input.DatetimeFormat !== undefined) { - bodyParams["DatetimeFormat"] = input.DatetimeFormat; - } - if (input.Encoding !== undefined) { - bodyParams["Encoding"] = input.Encoding; - } - if (input.File !== undefined) { - bodyParams["File"] = input.File; - } - if (input.FileFingerprintLines !== undefined) { - bodyParams["FileFingerprintLines"] = input.FileFingerprintLines; - } - if (input.InitialPosition !== undefined) { - bodyParams["InitialPosition"] = input.InitialPosition; - } - if (input.LogGroupName !== undefined) { - bodyParams["LogGroupName"] = input.LogGroupName; - } - if (input.MultiLineStartPattern !== undefined) { - bodyParams["MultiLineStartPattern"] = input.MultiLineStartPattern; - } - if (input.TimeZone !== undefined) { - bodyParams["TimeZone"] = input.TimeZone; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CloudWatchLogsLogStreams = ( @@ -6998,353 +6947,254 @@ const serializeAws_json1_1CreateAppRequest = ( input: CreateAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppSource !== undefined) { - bodyParams["AppSource"] = serializeAws_json1_1Source( - input.AppSource, - context - ); - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1AppAttributes( - input.Attributes, - context - ); - } - if (input.DataSources !== undefined) { - bodyParams["DataSources"] = serializeAws_json1_1DataSources( - input.DataSources, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Domains !== undefined) { - bodyParams["Domains"] = serializeAws_json1_1Strings(input.Domains, context); - } - if (input.EnableSsl !== undefined) { - bodyParams["EnableSsl"] = input.EnableSsl; - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1EnvironmentVariables( - input.Environment, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Shortname !== undefined) { - bodyParams["Shortname"] = input.Shortname; - } - if (input.SslConfiguration !== undefined) { - bodyParams["SslConfiguration"] = serializeAws_json1_1SslConfiguration( - input.SslConfiguration, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateDeploymentRequest = ( input: CreateDeploymentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppId !== undefined) { - bodyParams["AppId"] = input.AppId; - } - if (input.Command !== undefined) { - bodyParams["Command"] = serializeAws_json1_1DeploymentCommand( - input.Command, - context - ); - } - if (input.Comment !== undefined) { - bodyParams["Comment"] = input.Comment; - } - if (input.CustomJson !== undefined) { - bodyParams["CustomJson"] = input.CustomJson; - } - if (input.InstanceIds !== undefined) { - bodyParams["InstanceIds"] = serializeAws_json1_1Strings( - input.InstanceIds, - context - ); - } - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateInstanceRequest = ( input: CreateInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentVersion !== undefined) { - bodyParams["AgentVersion"] = input.AgentVersion; - } - if (input.AmiId !== undefined) { - bodyParams["AmiId"] = input.AmiId; - } - if (input.Architecture !== undefined) { - bodyParams["Architecture"] = input.Architecture; - } - if (input.AutoScalingType !== undefined) { - bodyParams["AutoScalingType"] = input.AutoScalingType; - } - if (input.AvailabilityZone !== undefined) { - bodyParams["AvailabilityZone"] = input.AvailabilityZone; - } - if (input.BlockDeviceMappings !== undefined) { - bodyParams["BlockDeviceMappings"] = serializeAws_json1_1BlockDeviceMappings( - input.BlockDeviceMappings, - context - ); - } - if (input.EbsOptimized !== undefined) { - bodyParams["EbsOptimized"] = input.EbsOptimized; - } - if (input.Hostname !== undefined) { - bodyParams["Hostname"] = input.Hostname; - } - if (input.InstallUpdatesOnBoot !== undefined) { - bodyParams["InstallUpdatesOnBoot"] = input.InstallUpdatesOnBoot; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - if (input.Os !== undefined) { - bodyParams["Os"] = input.Os; - } - if (input.RootDeviceType !== undefined) { - bodyParams["RootDeviceType"] = input.RootDeviceType; - } - if (input.SshKeyName !== undefined) { - bodyParams["SshKeyName"] = input.SshKeyName; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.Tenancy !== undefined) { - bodyParams["Tenancy"] = input.Tenancy; - } - if (input.VirtualizationType !== undefined) { - bodyParams["VirtualizationType"] = input.VirtualizationType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateLayerRequest = ( input: CreateLayerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1LayerAttributes( - input.Attributes, - context - ); - } - if (input.AutoAssignElasticIps !== undefined) { - bodyParams["AutoAssignElasticIps"] = input.AutoAssignElasticIps; - } - if (input.AutoAssignPublicIps !== undefined) { - bodyParams["AutoAssignPublicIps"] = input.AutoAssignPublicIps; - } - if (input.CloudWatchLogsConfiguration !== undefined) { - bodyParams[ - "CloudWatchLogsConfiguration" - ] = serializeAws_json1_1CloudWatchLogsConfiguration( - input.CloudWatchLogsConfiguration, - context - ); - } - if (input.CustomInstanceProfileArn !== undefined) { - bodyParams["CustomInstanceProfileArn"] = input.CustomInstanceProfileArn; - } - if (input.CustomJson !== undefined) { - bodyParams["CustomJson"] = input.CustomJson; - } - if (input.CustomRecipes !== undefined) { - bodyParams["CustomRecipes"] = serializeAws_json1_1Recipes( - input.CustomRecipes, - context - ); - } - if (input.CustomSecurityGroupIds !== undefined) { - bodyParams["CustomSecurityGroupIds"] = serializeAws_json1_1Strings( - input.CustomSecurityGroupIds, - context - ); - } - if (input.EnableAutoHealing !== undefined) { - bodyParams["EnableAutoHealing"] = input.EnableAutoHealing; - } - if (input.InstallUpdatesOnBoot !== undefined) { - bodyParams["InstallUpdatesOnBoot"] = input.InstallUpdatesOnBoot; - } - if (input.LifecycleEventConfiguration !== undefined) { - bodyParams[ - "LifecycleEventConfiguration" - ] = serializeAws_json1_1LifecycleEventConfiguration( - input.LifecycleEventConfiguration, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Packages !== undefined) { - bodyParams["Packages"] = serializeAws_json1_1Strings( - input.Packages, - context - ); - } - if (input.Shortname !== undefined) { - bodyParams["Shortname"] = input.Shortname; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.UseEbsOptimizedInstances !== undefined) { - bodyParams["UseEbsOptimizedInstances"] = input.UseEbsOptimizedInstances; - } - if (input.VolumeConfigurations !== undefined) { - bodyParams[ - "VolumeConfigurations" - ] = serializeAws_json1_1VolumeConfigurations( - input.VolumeConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateStackRequest = ( input: CreateStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentVersion !== undefined) { - bodyParams["AgentVersion"] = input.AgentVersion; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1StackAttributes( - input.Attributes, - context - ); - } - if (input.ChefConfiguration !== undefined) { - bodyParams["ChefConfiguration"] = serializeAws_json1_1ChefConfiguration( - input.ChefConfiguration, - context - ); - } - if (input.ConfigurationManager !== undefined) { - bodyParams[ - "ConfigurationManager" - ] = serializeAws_json1_1StackConfigurationManager( - input.ConfigurationManager, - context - ); - } - if (input.CustomCookbooksSource !== undefined) { - bodyParams["CustomCookbooksSource"] = serializeAws_json1_1Source( - input.CustomCookbooksSource, - context - ); - } - if (input.CustomJson !== undefined) { - bodyParams["CustomJson"] = input.CustomJson; - } - if (input.DefaultAvailabilityZone !== undefined) { - bodyParams["DefaultAvailabilityZone"] = input.DefaultAvailabilityZone; - } - if (input.DefaultInstanceProfileArn !== undefined) { - bodyParams["DefaultInstanceProfileArn"] = input.DefaultInstanceProfileArn; - } - if (input.DefaultOs !== undefined) { - bodyParams["DefaultOs"] = input.DefaultOs; - } - if (input.DefaultRootDeviceType !== undefined) { - bodyParams["DefaultRootDeviceType"] = input.DefaultRootDeviceType; - } - if (input.DefaultSshKeyName !== undefined) { - bodyParams["DefaultSshKeyName"] = input.DefaultSshKeyName; - } - if (input.DefaultSubnetId !== undefined) { - bodyParams["DefaultSubnetId"] = input.DefaultSubnetId; - } - if (input.HostnameTheme !== undefined) { - bodyParams["HostnameTheme"] = input.HostnameTheme; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.UseCustomCookbooks !== undefined) { - bodyParams["UseCustomCookbooks"] = input.UseCustomCookbooks; - } - if (input.UseOpsworksSecurityGroups !== undefined) { - bodyParams["UseOpsworksSecurityGroups"] = input.UseOpsworksSecurityGroups; - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateUserProfileRequest = ( input: CreateUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowSelfManagement !== undefined) { - bodyParams["AllowSelfManagement"] = input.AllowSelfManagement; - } - if (input.IamUserArn !== undefined) { - bodyParams["IamUserArn"] = input.IamUserArn; - } - if (input.SshPublicKey !== undefined) { - bodyParams["SshPublicKey"] = input.SshPublicKey; - } - if (input.SshUsername !== undefined) { - bodyParams["SshUsername"] = input.SshUsername; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DailyAutoScalingSchedule = ( @@ -7361,17 +7211,13 @@ const serializeAws_json1_1DataSource = ( input: DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.DatabaseName !== undefined) { - bodyParams["DatabaseName"] = input.DatabaseName; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.DatabaseName !== undefined && { + DatabaseName: input.DatabaseName + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1DataSources = ( @@ -7385,78 +7231,63 @@ const serializeAws_json1_1DeleteAppRequest = ( input: DeleteAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppId !== undefined) { - bodyParams["AppId"] = input.AppId; - } - return bodyParams; + return { + ...(input.AppId !== undefined && { AppId: input.AppId }) + }; }; const serializeAws_json1_1DeleteInstanceRequest = ( input: DeleteInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteElasticIp !== undefined) { - bodyParams["DeleteElasticIp"] = input.DeleteElasticIp; - } - if (input.DeleteVolumes !== undefined) { - bodyParams["DeleteVolumes"] = input.DeleteVolumes; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.DeleteElasticIp !== undefined && { + DeleteElasticIp: input.DeleteElasticIp + }), + ...(input.DeleteVolumes !== undefined && { + DeleteVolumes: input.DeleteVolumes + }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1DeleteLayerRequest = ( input: DeleteLayerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - return bodyParams; + return { + ...(input.LayerId !== undefined && { LayerId: input.LayerId }) + }; }; const serializeAws_json1_1DeleteStackRequest = ( input: DeleteStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DeleteUserProfileRequest = ( input: DeleteUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamUserArn !== undefined) { - bodyParams["IamUserArn"] = input.IamUserArn; - } - return bodyParams; + return { + ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }) + }; }; const serializeAws_json1_1DeploymentCommand = ( input: DeploymentCommand, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Args !== undefined) { - bodyParams["Args"] = serializeAws_json1_1DeploymentCommandArgs( - input.Args, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Args !== undefined && { + Args: serializeAws_json1_1DeploymentCommandArgs(input.Args, context) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeploymentCommandArgs = ( @@ -7473,459 +7304,345 @@ const serializeAws_json1_1DeregisterEcsClusterRequest = ( input: DeregisterEcsClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EcsClusterArn !== undefined) { - bodyParams["EcsClusterArn"] = input.EcsClusterArn; - } - return bodyParams; + return { + ...(input.EcsClusterArn !== undefined && { + EcsClusterArn: input.EcsClusterArn + }) + }; }; const serializeAws_json1_1DeregisterElasticIpRequest = ( input: DeregisterElasticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticIp !== undefined) { - bodyParams["ElasticIp"] = input.ElasticIp; - } - return bodyParams; + return { + ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }) + }; }; const serializeAws_json1_1DeregisterInstanceRequest = ( input: DeregisterInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1DeregisterRdsDbInstanceRequest = ( input: DeregisterRdsDbInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RdsDbInstanceArn !== undefined) { - bodyParams["RdsDbInstanceArn"] = input.RdsDbInstanceArn; - } - return bodyParams; + return { + ...(input.RdsDbInstanceArn !== undefined && { + RdsDbInstanceArn: input.RdsDbInstanceArn + }) + }; }; const serializeAws_json1_1DeregisterVolumeRequest = ( input: DeregisterVolumeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeId !== undefined) { - bodyParams["VolumeId"] = input.VolumeId; - } - return bodyParams; + return { + ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }) + }; }; const serializeAws_json1_1DescribeAgentVersionsRequest = ( input: DescribeAgentVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationManager !== undefined) { - bodyParams[ - "ConfigurationManager" - ] = serializeAws_json1_1StackConfigurationManager( - input.ConfigurationManager, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.ConfigurationManager !== undefined && { + ConfigurationManager: serializeAws_json1_1StackConfigurationManager( + input.ConfigurationManager, + context + ) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeAppsRequest = ( input: DescribeAppsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppIds !== undefined) { - bodyParams["AppIds"] = serializeAws_json1_1Strings(input.AppIds, context); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.AppIds !== undefined && { + AppIds: serializeAws_json1_1Strings(input.AppIds, context) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeCommandsRequest = ( input: DescribeCommandsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommandIds !== undefined) { - bodyParams["CommandIds"] = serializeAws_json1_1Strings( - input.CommandIds, - context - ); - } - if (input.DeploymentId !== undefined) { - bodyParams["DeploymentId"] = input.DeploymentId; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.CommandIds !== undefined && { + CommandIds: serializeAws_json1_1Strings(input.CommandIds, context) + }), + ...(input.DeploymentId !== undefined && { + DeploymentId: input.DeploymentId + }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1DescribeDeploymentsRequest = ( input: DescribeDeploymentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppId !== undefined) { - bodyParams["AppId"] = input.AppId; - } - if (input.DeploymentIds !== undefined) { - bodyParams["DeploymentIds"] = serializeAws_json1_1Strings( - input.DeploymentIds, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.AppId !== undefined && { AppId: input.AppId }), + ...(input.DeploymentIds !== undefined && { + DeploymentIds: serializeAws_json1_1Strings(input.DeploymentIds, context) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeEcsClustersRequest = ( input: DescribeEcsClustersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EcsClusterArns !== undefined) { - bodyParams["EcsClusterArns"] = serializeAws_json1_1Strings( - input.EcsClusterArns, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeElasticIpsRequest = ( input: DescribeElasticIpsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.Ips !== undefined) { - bodyParams["Ips"] = serializeAws_json1_1Strings(input.Ips, context); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Ips !== undefined && { + Ips: serializeAws_json1_1Strings(input.Ips, context) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeElasticLoadBalancersRequest = ( input: DescribeElasticLoadBalancersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.LayerIds !== undefined && { + LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeInstancesRequest = ( input: DescribeInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceIds !== undefined) { - bodyParams["InstanceIds"] = serializeAws_json1_1Strings( - input.InstanceIds, - context - ); - } - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.InstanceIds !== undefined && { + InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) + }), + ...(input.LayerId !== undefined && { LayerId: input.LayerId }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeLayersRequest = ( input: DescribeLayersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.LayerIds !== undefined && { + LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeLoadBasedAutoScalingRequest = ( input: DescribeLoadBasedAutoScalingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - return bodyParams; + return { + ...(input.LayerIds !== undefined && { + LayerIds: serializeAws_json1_1Strings(input.LayerIds, context) + }) + }; }; const serializeAws_json1_1DescribePermissionsRequest = ( input: DescribePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamUserArn !== undefined) { - bodyParams["IamUserArn"] = input.IamUserArn; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.IamUserArn !== undefined && { IamUserArn: input.IamUserArn }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeRaidArraysRequest = ( input: DescribeRaidArraysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.RaidArrayIds !== undefined) { - bodyParams["RaidArrayIds"] = serializeAws_json1_1Strings( - input.RaidArrayIds, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.RaidArrayIds !== undefined && { + RaidArrayIds: serializeAws_json1_1Strings(input.RaidArrayIds, context) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeRdsDbInstancesRequest = ( input: DescribeRdsDbInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RdsDbInstanceArns !== undefined) { - bodyParams["RdsDbInstanceArns"] = serializeAws_json1_1Strings( - input.RdsDbInstanceArns, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.RdsDbInstanceArns !== undefined && { + RdsDbInstanceArns: serializeAws_json1_1Strings( + input.RdsDbInstanceArns, + context + ) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeServiceErrorsRequest = ( input: DescribeServiceErrorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.ServiceErrorIds !== undefined) { - bodyParams["ServiceErrorIds"] = serializeAws_json1_1Strings( - input.ServiceErrorIds, - context - ); - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ServiceErrorIds !== undefined && { + ServiceErrorIds: serializeAws_json1_1Strings( + input.ServiceErrorIds, + context + ) + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeStackProvisioningParametersRequest = ( input: DescribeStackProvisioningParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeStackSummaryRequest = ( input: DescribeStackSummaryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1DescribeStacksRequest = ( input: DescribeStacksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackIds !== undefined) { - bodyParams["StackIds"] = serializeAws_json1_1Strings( - input.StackIds, - context - ); - } - return bodyParams; + return { + ...(input.StackIds !== undefined && { + StackIds: serializeAws_json1_1Strings(input.StackIds, context) + }) + }; }; const serializeAws_json1_1DescribeTimeBasedAutoScalingRequest = ( input: DescribeTimeBasedAutoScalingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceIds !== undefined) { - bodyParams["InstanceIds"] = serializeAws_json1_1Strings( - input.InstanceIds, - context - ); - } - return bodyParams; + return { + ...(input.InstanceIds !== undefined && { + InstanceIds: serializeAws_json1_1Strings(input.InstanceIds, context) + }) + }; }; const serializeAws_json1_1DescribeUserProfilesRequest = ( input: DescribeUserProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamUserArns !== undefined) { - bodyParams["IamUserArns"] = serializeAws_json1_1Strings( - input.IamUserArns, - context - ); - } - return bodyParams; + return { + ...(input.IamUserArns !== undefined && { + IamUserArns: serializeAws_json1_1Strings(input.IamUserArns, context) + }) + }; }; const serializeAws_json1_1DescribeVolumesRequest = ( input: DescribeVolumesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.RaidArrayId !== undefined) { - bodyParams["RaidArrayId"] = input.RaidArrayId; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - if (input.VolumeIds !== undefined) { - bodyParams["VolumeIds"] = serializeAws_json1_1Strings( - input.VolumeIds, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DetachElasticLoadBalancerRequest = ( input: DetachElasticLoadBalancerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticLoadBalancerName !== undefined) { - bodyParams["ElasticLoadBalancerName"] = input.ElasticLoadBalancerName; - } - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - return bodyParams; + return { + ...(input.ElasticLoadBalancerName !== undefined && { + ElasticLoadBalancerName: input.ElasticLoadBalancerName + }), + ...(input.LayerId !== undefined && { LayerId: input.LayerId }) + }; }; const serializeAws_json1_1DisassociateElasticIpRequest = ( input: DisassociateElasticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticIp !== undefined) { - bodyParams["ElasticIp"] = input.ElasticIp; - } - return bodyParams; + return { + ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }) + }; }; const serializeAws_json1_1EbsBlockDevice = ( input: EbsBlockDevice, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeleteOnTermination !== undefined) { - bodyParams["DeleteOnTermination"] = input.DeleteOnTermination; - } - if (input.Iops !== undefined) { - bodyParams["Iops"] = input.Iops; - } - if (input.SnapshotId !== undefined) { - bodyParams["SnapshotId"] = input.SnapshotId; - } - if (input.VolumeSize !== undefined) { - bodyParams["VolumeSize"] = input.VolumeSize; - } - if (input.VolumeType !== undefined) { - bodyParams["VolumeType"] = input.VolumeType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1EnvironmentVariable = ( input: EnvironmentVariable, context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Secure !== undefined) { - bodyParams["Secure"] = input.Secure; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; +): any => { + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Secure !== undefined && { Secure: input.Secure }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1EnvironmentVariables = ( @@ -7941,39 +7658,31 @@ const serializeAws_json1_1GetHostnameSuggestionRequest = ( input: GetHostnameSuggestionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - return bodyParams; + return { + ...(input.LayerId !== undefined && { LayerId: input.LayerId }) + }; }; const serializeAws_json1_1GrantAccessRequest = ( input: GrantAccessRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.ValidForInMinutes !== undefined) { - bodyParams["ValidForInMinutes"] = input.ValidForInMinutes; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ValidForInMinutes !== undefined && { + ValidForInMinutes: input.ValidForInMinutes + }) + }; }; const serializeAws_json1_1InstanceIdentity = ( input: InstanceIdentity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Document !== undefined) { - bodyParams["Document"] = input.Document; - } - if (input.Signature !== undefined) { - bodyParams["Signature"] = input.Signature; - } - return bodyParams; + return { + ...(input.Document !== undefined && { Document: input.Document }), + ...(input.Signature !== undefined && { Signature: input.Signature }) + }; }; const serializeAws_json1_1LayerAttributes = ( @@ -7990,294 +7699,216 @@ const serializeAws_json1_1LifecycleEventConfiguration = ( input: LifecycleEventConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Shutdown !== undefined) { - bodyParams["Shutdown"] = serializeAws_json1_1ShutdownEventConfiguration( - input.Shutdown, - context - ); - } - return bodyParams; + return { + ...(input.Shutdown !== undefined && { + Shutdown: serializeAws_json1_1ShutdownEventConfiguration( + input.Shutdown, + context + ) + }) + }; }; const serializeAws_json1_1ListTagsRequest = ( input: ListTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1RebootInstanceRequest = ( input: RebootInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1Recipes = ( input: Recipes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configure !== undefined) { - bodyParams["Configure"] = serializeAws_json1_1Strings( - input.Configure, - context - ); - } - if (input.Deploy !== undefined) { - bodyParams["Deploy"] = serializeAws_json1_1Strings(input.Deploy, context); - } - if (input.Setup !== undefined) { - bodyParams["Setup"] = serializeAws_json1_1Strings(input.Setup, context); - } - if (input.Shutdown !== undefined) { - bodyParams["Shutdown"] = serializeAws_json1_1Strings( - input.Shutdown, - context - ); - } - if (input.Undeploy !== undefined) { - bodyParams["Undeploy"] = serializeAws_json1_1Strings( - input.Undeploy, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RegisterEcsClusterRequest = ( input: RegisterEcsClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EcsClusterArn !== undefined) { - bodyParams["EcsClusterArn"] = input.EcsClusterArn; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.EcsClusterArn !== undefined && { + EcsClusterArn: input.EcsClusterArn + }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1RegisterElasticIpRequest = ( input: RegisterElasticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticIp !== undefined) { - bodyParams["ElasticIp"] = input.ElasticIp; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1RegisterInstanceRequest = ( input: RegisterInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Hostname !== undefined) { - bodyParams["Hostname"] = input.Hostname; - } - if (input.InstanceIdentity !== undefined) { - bodyParams["InstanceIdentity"] = serializeAws_json1_1InstanceIdentity( - input.InstanceIdentity, - context - ); - } - if (input.PrivateIp !== undefined) { - bodyParams["PrivateIp"] = input.PrivateIp; - } - if (input.PublicIp !== undefined) { - bodyParams["PublicIp"] = input.PublicIp; - } - if (input.RsaPublicKey !== undefined) { - bodyParams["RsaPublicKey"] = input.RsaPublicKey; - } - if (input.RsaPublicKeyFingerprint !== undefined) { - bodyParams["RsaPublicKeyFingerprint"] = input.RsaPublicKeyFingerprint; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RegisterRdsDbInstanceRequest = ( input: RegisterRdsDbInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DbPassword !== undefined) { - bodyParams["DbPassword"] = input.DbPassword; - } - if (input.DbUser !== undefined) { - bodyParams["DbUser"] = input.DbUser; - } - if (input.RdsDbInstanceArn !== undefined) { - bodyParams["RdsDbInstanceArn"] = input.RdsDbInstanceArn; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RegisterVolumeRequest = ( input: RegisterVolumeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ec2VolumeId !== undefined) { - bodyParams["Ec2VolumeId"] = input.Ec2VolumeId; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.Ec2VolumeId !== undefined && { Ec2VolumeId: input.Ec2VolumeId }), + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1SetLoadBasedAutoScalingRequest = ( input: SetLoadBasedAutoScalingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DownScaling !== undefined) { - bodyParams["DownScaling"] = serializeAws_json1_1AutoScalingThresholds( - input.DownScaling, - context - ); - } - if (input.Enable !== undefined) { - bodyParams["Enable"] = input.Enable; - } - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - if (input.UpScaling !== undefined) { - bodyParams["UpScaling"] = serializeAws_json1_1AutoScalingThresholds( - input.UpScaling, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SetPermissionRequest = ( input: SetPermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowSsh !== undefined) { - bodyParams["AllowSsh"] = input.AllowSsh; - } - if (input.AllowSudo !== undefined) { - bodyParams["AllowSudo"] = input.AllowSudo; - } - if (input.IamUserArn !== undefined) { - bodyParams["IamUserArn"] = input.IamUserArn; - } - if (input.Level !== undefined) { - bodyParams["Level"] = input.Level; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SetTimeBasedAutoScalingRequest = ( input: SetTimeBasedAutoScalingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoScalingSchedule !== undefined) { - bodyParams[ - "AutoScalingSchedule" - ] = serializeAws_json1_1WeeklyAutoScalingSchedule( - input.AutoScalingSchedule, - context - ); - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.AutoScalingSchedule !== undefined && { + AutoScalingSchedule: serializeAws_json1_1WeeklyAutoScalingSchedule( + input.AutoScalingSchedule, + context + ) + }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1ShutdownEventConfiguration = ( input: ShutdownEventConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DelayUntilElbConnectionsDrained !== undefined) { - bodyParams["DelayUntilElbConnectionsDrained"] = - input.DelayUntilElbConnectionsDrained; - } - if (input.ExecutionTimeout !== undefined) { - bodyParams["ExecutionTimeout"] = input.ExecutionTimeout; - } - return bodyParams; + return { + ...(input.DelayUntilElbConnectionsDrained !== undefined && { + DelayUntilElbConnectionsDrained: input.DelayUntilElbConnectionsDrained + }), + ...(input.ExecutionTimeout !== undefined && { + ExecutionTimeout: input.ExecutionTimeout + }) + }; }; const serializeAws_json1_1Source = ( input: Source, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Revision !== undefined) { - bodyParams["Revision"] = input.Revision; - } - if (input.SshKey !== undefined) { - bodyParams["SshKey"] = input.SshKey; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SslConfiguration = ( input: SslConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.Chain !== undefined) { - bodyParams["Chain"] = input.Chain; - } - if (input.PrivateKey !== undefined) { - bodyParams["PrivateKey"] = input.PrivateKey; - } - return bodyParams; + return { + ...(input.Certificate !== undefined && { Certificate: input.Certificate }), + ...(input.Chain !== undefined && { Chain: input.Chain }), + ...(input.PrivateKey !== undefined && { PrivateKey: input.PrivateKey }) + }; }; const serializeAws_json1_1StackAttributes = ( @@ -8294,61 +7925,47 @@ const serializeAws_json1_1StackConfigurationManager = ( input: StackConfigurationManager, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1StartInstanceRequest = ( input: StartInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1StartStackRequest = ( input: StartStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1StopInstanceRequest = ( input: StopInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Force !== undefined) { - bodyParams["Force"] = input.Force; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.Force !== undefined && { Force: input.Force }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1StopStackRequest = ( input: StopStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - return bodyParams; + return { + ...(input.StackId !== undefined && { StackId: input.StackId }) + }; }; const serializeAws_json1_1Strings = ( @@ -8369,14 +7986,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -8393,409 +8008,305 @@ const serializeAws_json1_1UnassignInstanceRequest = ( input: UnassignInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1UnassignVolumeRequest = ( input: UnassignVolumeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeId !== undefined) { - bodyParams["VolumeId"] = input.VolumeId; - } - return bodyParams; + return { + ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateAppRequest = ( input: UpdateAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppId !== undefined) { - bodyParams["AppId"] = input.AppId; - } - if (input.AppSource !== undefined) { - bodyParams["AppSource"] = serializeAws_json1_1Source( - input.AppSource, - context - ); - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1AppAttributes( - input.Attributes, - context - ); - } - if (input.DataSources !== undefined) { - bodyParams["DataSources"] = serializeAws_json1_1DataSources( - input.DataSources, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Domains !== undefined) { - bodyParams["Domains"] = serializeAws_json1_1Strings(input.Domains, context); - } - if (input.EnableSsl !== undefined) { - bodyParams["EnableSsl"] = input.EnableSsl; - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1EnvironmentVariables( - input.Environment, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SslConfiguration !== undefined) { - bodyParams["SslConfiguration"] = serializeAws_json1_1SslConfiguration( - input.SslConfiguration, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateElasticIpRequest = ( input: UpdateElasticIpRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ElasticIp !== undefined) { - bodyParams["ElasticIp"] = input.ElasticIp; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ElasticIp !== undefined && { ElasticIp: input.ElasticIp }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateInstanceRequest = ( input: UpdateInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentVersion !== undefined) { - bodyParams["AgentVersion"] = input.AgentVersion; - } - if (input.AmiId !== undefined) { - bodyParams["AmiId"] = input.AmiId; - } - if (input.Architecture !== undefined) { - bodyParams["Architecture"] = input.Architecture; - } - if (input.AutoScalingType !== undefined) { - bodyParams["AutoScalingType"] = input.AutoScalingType; - } - if (input.EbsOptimized !== undefined) { - bodyParams["EbsOptimized"] = input.EbsOptimized; - } - if (input.Hostname !== undefined) { - bodyParams["Hostname"] = input.Hostname; - } - if (input.InstallUpdatesOnBoot !== undefined) { - bodyParams["InstallUpdatesOnBoot"] = input.InstallUpdatesOnBoot; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.LayerIds !== undefined) { - bodyParams["LayerIds"] = serializeAws_json1_1Strings( - input.LayerIds, - context - ); - } - if (input.Os !== undefined) { - bodyParams["Os"] = input.Os; - } - if (input.SshKeyName !== undefined) { - bodyParams["SshKeyName"] = input.SshKeyName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateLayerRequest = ( input: UpdateLayerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1LayerAttributes( - input.Attributes, - context - ); - } - if (input.AutoAssignElasticIps !== undefined) { - bodyParams["AutoAssignElasticIps"] = input.AutoAssignElasticIps; - } - if (input.AutoAssignPublicIps !== undefined) { - bodyParams["AutoAssignPublicIps"] = input.AutoAssignPublicIps; - } - if (input.CloudWatchLogsConfiguration !== undefined) { - bodyParams[ - "CloudWatchLogsConfiguration" - ] = serializeAws_json1_1CloudWatchLogsConfiguration( - input.CloudWatchLogsConfiguration, - context - ); - } - if (input.CustomInstanceProfileArn !== undefined) { - bodyParams["CustomInstanceProfileArn"] = input.CustomInstanceProfileArn; - } - if (input.CustomJson !== undefined) { - bodyParams["CustomJson"] = input.CustomJson; - } - if (input.CustomRecipes !== undefined) { - bodyParams["CustomRecipes"] = serializeAws_json1_1Recipes( - input.CustomRecipes, - context - ); - } - if (input.CustomSecurityGroupIds !== undefined) { - bodyParams["CustomSecurityGroupIds"] = serializeAws_json1_1Strings( - input.CustomSecurityGroupIds, - context - ); - } - if (input.EnableAutoHealing !== undefined) { - bodyParams["EnableAutoHealing"] = input.EnableAutoHealing; - } - if (input.InstallUpdatesOnBoot !== undefined) { - bodyParams["InstallUpdatesOnBoot"] = input.InstallUpdatesOnBoot; - } - if (input.LayerId !== undefined) { - bodyParams["LayerId"] = input.LayerId; - } - if (input.LifecycleEventConfiguration !== undefined) { - bodyParams[ - "LifecycleEventConfiguration" - ] = serializeAws_json1_1LifecycleEventConfiguration( - input.LifecycleEventConfiguration, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Packages !== undefined) { - bodyParams["Packages"] = serializeAws_json1_1Strings( - input.Packages, - context - ); - } - if (input.Shortname !== undefined) { - bodyParams["Shortname"] = input.Shortname; - } - if (input.UseEbsOptimizedInstances !== undefined) { - bodyParams["UseEbsOptimizedInstances"] = input.UseEbsOptimizedInstances; - } - if (input.VolumeConfigurations !== undefined) { - bodyParams[ - "VolumeConfigurations" - ] = serializeAws_json1_1VolumeConfigurations( - input.VolumeConfigurations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateMyUserProfileRequest = ( input: UpdateMyUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SshPublicKey !== undefined) { - bodyParams["SshPublicKey"] = input.SshPublicKey; - } - return bodyParams; + return { + ...(input.SshPublicKey !== undefined && { + SshPublicKey: input.SshPublicKey + }) + }; }; const serializeAws_json1_1UpdateRdsDbInstanceRequest = ( input: UpdateRdsDbInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DbPassword !== undefined) { - bodyParams["DbPassword"] = input.DbPassword; - } - if (input.DbUser !== undefined) { - bodyParams["DbUser"] = input.DbUser; - } - if (input.RdsDbInstanceArn !== undefined) { - bodyParams["RdsDbInstanceArn"] = input.RdsDbInstanceArn; - } - return bodyParams; + return { + ...(input.DbPassword !== undefined && { DbPassword: input.DbPassword }), + ...(input.DbUser !== undefined && { DbUser: input.DbUser }), + ...(input.RdsDbInstanceArn !== undefined && { + RdsDbInstanceArn: input.RdsDbInstanceArn + }) + }; }; const serializeAws_json1_1UpdateStackRequest = ( input: UpdateStackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AgentVersion !== undefined) { - bodyParams["AgentVersion"] = input.AgentVersion; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1StackAttributes( - input.Attributes, - context - ); - } - if (input.ChefConfiguration !== undefined) { - bodyParams["ChefConfiguration"] = serializeAws_json1_1ChefConfiguration( - input.ChefConfiguration, - context - ); - } - if (input.ConfigurationManager !== undefined) { - bodyParams[ - "ConfigurationManager" - ] = serializeAws_json1_1StackConfigurationManager( - input.ConfigurationManager, - context - ); - } - if (input.CustomCookbooksSource !== undefined) { - bodyParams["CustomCookbooksSource"] = serializeAws_json1_1Source( - input.CustomCookbooksSource, - context - ); - } - if (input.CustomJson !== undefined) { - bodyParams["CustomJson"] = input.CustomJson; - } - if (input.DefaultAvailabilityZone !== undefined) { - bodyParams["DefaultAvailabilityZone"] = input.DefaultAvailabilityZone; - } - if (input.DefaultInstanceProfileArn !== undefined) { - bodyParams["DefaultInstanceProfileArn"] = input.DefaultInstanceProfileArn; - } - if (input.DefaultOs !== undefined) { - bodyParams["DefaultOs"] = input.DefaultOs; - } - if (input.DefaultRootDeviceType !== undefined) { - bodyParams["DefaultRootDeviceType"] = input.DefaultRootDeviceType; - } - if (input.DefaultSshKeyName !== undefined) { - bodyParams["DefaultSshKeyName"] = input.DefaultSshKeyName; - } - if (input.DefaultSubnetId !== undefined) { - bodyParams["DefaultSubnetId"] = input.DefaultSubnetId; - } - if (input.HostnameTheme !== undefined) { - bodyParams["HostnameTheme"] = input.HostnameTheme; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.StackId !== undefined) { - bodyParams["StackId"] = input.StackId; - } - if (input.UseCustomCookbooks !== undefined) { - bodyParams["UseCustomCookbooks"] = input.UseCustomCookbooks; - } - if (input.UseOpsworksSecurityGroups !== undefined) { - bodyParams["UseOpsworksSecurityGroups"] = input.UseOpsworksSecurityGroups; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateUserProfileRequest = ( input: UpdateUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowSelfManagement !== undefined) { - bodyParams["AllowSelfManagement"] = input.AllowSelfManagement; - } - if (input.IamUserArn !== undefined) { - bodyParams["IamUserArn"] = input.IamUserArn; - } - if (input.SshPublicKey !== undefined) { - bodyParams["SshPublicKey"] = input.SshPublicKey; - } - if (input.SshUsername !== undefined) { - bodyParams["SshUsername"] = input.SshUsername; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateVolumeRequest = ( input: UpdateVolumeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MountPoint !== undefined) { - bodyParams["MountPoint"] = input.MountPoint; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.VolumeId !== undefined) { - bodyParams["VolumeId"] = input.VolumeId; - } - return bodyParams; + return { + ...(input.MountPoint !== undefined && { MountPoint: input.MountPoint }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.VolumeId !== undefined && { VolumeId: input.VolumeId }) + }; }; const serializeAws_json1_1VolumeConfiguration = ( input: VolumeConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Encrypted !== undefined) { - bodyParams["Encrypted"] = input.Encrypted; - } - if (input.Iops !== undefined) { - bodyParams["Iops"] = input.Iops; - } - if (input.MountPoint !== undefined) { - bodyParams["MountPoint"] = input.MountPoint; - } - if (input.NumberOfDisks !== undefined) { - bodyParams["NumberOfDisks"] = input.NumberOfDisks; - } - if (input.RaidLevel !== undefined) { - bodyParams["RaidLevel"] = input.RaidLevel; - } - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - if (input.VolumeType !== undefined) { - bodyParams["VolumeType"] = input.VolumeType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1VolumeConfigurations = ( @@ -8811,50 +8322,50 @@ const serializeAws_json1_1WeeklyAutoScalingSchedule = ( input: WeeklyAutoScalingSchedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Friday !== undefined) { - bodyParams["Friday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Friday, - context - ); - } - if (input.Monday !== undefined) { - bodyParams["Monday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Monday, - context - ); - } - if (input.Saturday !== undefined) { - bodyParams["Saturday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Saturday, - context - ); - } - if (input.Sunday !== undefined) { - bodyParams["Sunday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Sunday, - context - ); - } - if (input.Thursday !== undefined) { - bodyParams["Thursday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Thursday, - context - ); - } - if (input.Tuesday !== undefined) { - bodyParams["Tuesday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Tuesday, - context - ); - } - if (input.Wednesday !== undefined) { - bodyParams["Wednesday"] = serializeAws_json1_1DailyAutoScalingSchedule( - input.Wednesday, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const deserializeAws_json1_1AgentVersion = ( diff --git a/clients/client-opsworkscm/protocols/Aws_json1_1.ts b/clients/client-opsworkscm/protocols/Aws_json1_1.ts index 2a3335fdd7d6..4bbbda54570e 100644 --- a/clients/client-opsworkscm/protocols/Aws_json1_1.ts +++ b/clients/client-opsworkscm/protocols/Aws_json1_1.ts @@ -2086,249 +2086,193 @@ const serializeAws_json1_1AssociateNodeRequest = ( input: AssociateNodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EngineAttributes !== undefined) { - bodyParams["EngineAttributes"] = serializeAws_json1_1EngineAttributes( - input.EngineAttributes, - context - ); - } - if (input.NodeName !== undefined) { - bodyParams["NodeName"] = input.NodeName; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.EngineAttributes !== undefined && { + EngineAttributes: serializeAws_json1_1EngineAttributes( + input.EngineAttributes, + context + ) + }), + ...(input.NodeName !== undefined && { NodeName: input.NodeName }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1CreateBackupRequest = ( input: CreateBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateServerRequest = ( input: CreateServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociatePublicIpAddress !== undefined) { - bodyParams["AssociatePublicIpAddress"] = input.AssociatePublicIpAddress; - } - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - if (input.BackupRetentionCount !== undefined) { - bodyParams["BackupRetentionCount"] = input.BackupRetentionCount; - } - if (input.CustomCertificate !== undefined) { - bodyParams["CustomCertificate"] = input.CustomCertificate; - } - if (input.CustomDomain !== undefined) { - bodyParams["CustomDomain"] = input.CustomDomain; - } - if (input.CustomPrivateKey !== undefined) { - bodyParams["CustomPrivateKey"] = input.CustomPrivateKey; - } - if (input.DisableAutomatedBackup !== undefined) { - bodyParams["DisableAutomatedBackup"] = input.DisableAutomatedBackup; - } - if (input.Engine !== undefined) { - bodyParams["Engine"] = input.Engine; - } - if (input.EngineAttributes !== undefined) { - bodyParams["EngineAttributes"] = serializeAws_json1_1EngineAttributes( - input.EngineAttributes, - context - ); - } - if (input.EngineModel !== undefined) { - bodyParams["EngineModel"] = input.EngineModel; - } - if (input.EngineVersion !== undefined) { - bodyParams["EngineVersion"] = input.EngineVersion; - } - if (input.InstanceProfileArn !== undefined) { - bodyParams["InstanceProfileArn"] = input.InstanceProfileArn; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.KeyPair !== undefined) { - bodyParams["KeyPair"] = input.KeyPair; - } - if (input.PreferredBackupWindow !== undefined) { - bodyParams["PreferredBackupWindow"] = input.PreferredBackupWindow; - } - if (input.PreferredMaintenanceWindow !== undefined) { - bodyParams["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1Strings( - input.SecurityGroupIds, - context - ); - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1Strings( - input.SubnetIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteBackupRequest = ( input: DeleteBackupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - return bodyParams; + return { + ...(input.BackupId !== undefined && { BackupId: input.BackupId }) + }; }; const serializeAws_json1_1DeleteServerRequest = ( input: DeleteServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1DescribeAccountAttributesRequest = ( input: DescribeAccountAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeBackupsRequest = ( input: DescribeBackupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeEventsRequest = ( input: DescribeEventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1DescribeNodeAssociationStatusRequest = ( input: DescribeNodeAssociationStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NodeAssociationStatusToken !== undefined) { - bodyParams["NodeAssociationStatusToken"] = input.NodeAssociationStatusToken; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.NodeAssociationStatusToken !== undefined && { + NodeAssociationStatusToken: input.NodeAssociationStatusToken + }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1DescribeServersRequest = ( input: DescribeServersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1DisassociateNodeRequest = ( input: DisassociateNodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EngineAttributes !== undefined) { - bodyParams["EngineAttributes"] = serializeAws_json1_1EngineAttributes( - input.EngineAttributes, - context - ); - } - if (input.NodeName !== undefined) { - bodyParams["NodeName"] = input.NodeName; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.EngineAttributes !== undefined && { + EngineAttributes: serializeAws_json1_1EngineAttributes( + input.EngineAttributes, + context + ) + }), + ...(input.NodeName !== undefined && { NodeName: input.NodeName }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1EngineAttribute = ( input: EngineAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1EngineAttributes = ( @@ -2344,74 +2288,58 @@ const serializeAws_json1_1ExportServerEngineAttributeRequest = ( input: ExportServerEngineAttributeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExportAttributeName !== undefined) { - bodyParams["ExportAttributeName"] = input.ExportAttributeName; - } - if (input.InputAttributes !== undefined) { - bodyParams["InputAttributes"] = serializeAws_json1_1EngineAttributes( - input.InputAttributes, - context - ); - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.ExportAttributeName !== undefined && { + ExportAttributeName: input.ExportAttributeName + }), + ...(input.InputAttributes !== undefined && { + InputAttributes: serializeAws_json1_1EngineAttributes( + input.InputAttributes, + context + ) + }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1RestoreServerRequest = ( input: RestoreServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupId !== undefined) { - bodyParams["BackupId"] = input.BackupId; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.KeyPair !== undefined) { - bodyParams["KeyPair"] = input.KeyPair; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartMaintenanceRequest = ( input: StartMaintenanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EngineAttributes !== undefined) { - bodyParams["EngineAttributes"] = serializeAws_json1_1EngineAttributes( - input.EngineAttributes, - context - ); - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.EngineAttributes !== undefined && { + EngineAttributes: serializeAws_json1_1EngineAttributes( + input.EngineAttributes, + context + ) + }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1Strings = ( @@ -2422,14 +2350,10 @@ const serializeAws_json1_1Strings = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -2450,71 +2374,60 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateServerEngineAttributesRequest = ( input: UpdateServerEngineAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.AttributeValue !== undefined) { - bodyParams["AttributeValue"] = input.AttributeValue; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + return { + ...(input.AttributeName !== undefined && { + AttributeName: input.AttributeName + }), + ...(input.AttributeValue !== undefined && { + AttributeValue: input.AttributeValue + }), + ...(input.ServerName !== undefined && { ServerName: input.ServerName }) + }; }; const serializeAws_json1_1UpdateServerRequest = ( input: UpdateServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackupRetentionCount !== undefined) { - bodyParams["BackupRetentionCount"] = input.BackupRetentionCount; - } - if (input.DisableAutomatedBackup !== undefined) { - bodyParams["DisableAutomatedBackup"] = input.DisableAutomatedBackup; - } - if (input.PreferredBackupWindow !== undefined) { - bodyParams["PreferredBackupWindow"] = input.PreferredBackupWindow; - } - if (input.PreferredMaintenanceWindow !== undefined) { - bodyParams["PreferredMaintenanceWindow"] = input.PreferredMaintenanceWindow; - } - if (input.ServerName !== undefined) { - bodyParams["ServerName"] = input.ServerName; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AccountAttribute = ( diff --git a/clients/client-organizations/protocols/Aws_json1_1.ts b/clients/client-organizations/protocols/Aws_json1_1.ts index 4a3c90b5fed8..280e04631d3e 100644 --- a/clients/client-organizations/protocols/Aws_json1_1.ts +++ b/clients/client-organizations/protocols/Aws_json1_1.ts @@ -8206,56 +8206,42 @@ const serializeAws_json1_1AcceptHandshakeRequest = ( input: AcceptHandshakeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HandshakeId !== undefined) { - bodyParams["HandshakeId"] = input.HandshakeId; - } - return bodyParams; + return { + ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }) + }; }; const serializeAws_json1_1AttachPolicyRequest = ( input: AttachPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - if (input.TargetId !== undefined) { - bodyParams["TargetId"] = input.TargetId; - } - return bodyParams; + return { + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.TargetId !== undefined && { TargetId: input.TargetId }) + }; }; const serializeAws_json1_1CancelHandshakeRequest = ( input: CancelHandshakeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HandshakeId !== undefined) { - bodyParams["HandshakeId"] = input.HandshakeId; - } - return bodyParams; + return { + ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }) + }; }; const serializeAws_json1_1CreateAccountRequest = ( input: CreateAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountName !== undefined) { - bodyParams["AccountName"] = input.AccountName; - } - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.IamUserAccessToBilling !== undefined) { - bodyParams["IamUserAccessToBilling"] = input.IamUserAccessToBilling; - } - if (input.RoleName !== undefined) { - bodyParams["RoleName"] = input.RoleName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateAccountStates = ( @@ -8269,564 +8255,415 @@ const serializeAws_json1_1CreateGovCloudAccountRequest = ( input: CreateGovCloudAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountName !== undefined) { - bodyParams["AccountName"] = input.AccountName; - } - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.IamUserAccessToBilling !== undefined) { - bodyParams["IamUserAccessToBilling"] = input.IamUserAccessToBilling; - } - if (input.RoleName !== undefined) { - bodyParams["RoleName"] = input.RoleName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateOrganizationRequest = ( input: CreateOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FeatureSet !== undefined) { - bodyParams["FeatureSet"] = input.FeatureSet; - } - return bodyParams; + return { + ...(input.FeatureSet !== undefined && { FeatureSet: input.FeatureSet }) + }; }; const serializeAws_json1_1CreateOrganizationalUnitRequest = ( input: CreateOrganizationalUnitRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ParentId !== undefined) { - bodyParams["ParentId"] = input.ParentId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ParentId !== undefined && { ParentId: input.ParentId }) + }; }; const serializeAws_json1_1CreatePolicyRequest = ( input: CreatePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Content !== undefined && { Content: input.Content }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1DeclineHandshakeRequest = ( input: DeclineHandshakeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HandshakeId !== undefined) { - bodyParams["HandshakeId"] = input.HandshakeId; - } - return bodyParams; + return { + ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }) + }; }; const serializeAws_json1_1DeleteOrganizationalUnitRequest = ( input: DeleteOrganizationalUnitRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationalUnitId !== undefined) { - bodyParams["OrganizationalUnitId"] = input.OrganizationalUnitId; - } - return bodyParams; + return { + ...(input.OrganizationalUnitId !== undefined && { + OrganizationalUnitId: input.OrganizationalUnitId + }) + }; }; const serializeAws_json1_1DeletePolicyRequest = ( input: DeletePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1DescribeAccountRequest = ( input: DescribeAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }) + }; }; const serializeAws_json1_1DescribeCreateAccountStatusRequest = ( input: DescribeCreateAccountStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreateAccountRequestId !== undefined) { - bodyParams["CreateAccountRequestId"] = input.CreateAccountRequestId; - } - return bodyParams; + return { + ...(input.CreateAccountRequestId !== undefined && { + CreateAccountRequestId: input.CreateAccountRequestId + }) + }; }; const serializeAws_json1_1DescribeEffectivePolicyRequest = ( input: DescribeEffectivePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyType !== undefined) { - bodyParams["PolicyType"] = input.PolicyType; - } - if (input.TargetId !== undefined) { - bodyParams["TargetId"] = input.TargetId; - } - return bodyParams; + return { + ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), + ...(input.TargetId !== undefined && { TargetId: input.TargetId }) + }; }; const serializeAws_json1_1DescribeHandshakeRequest = ( input: DescribeHandshakeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HandshakeId !== undefined) { - bodyParams["HandshakeId"] = input.HandshakeId; - } - return bodyParams; + return { + ...(input.HandshakeId !== undefined && { HandshakeId: input.HandshakeId }) + }; }; const serializeAws_json1_1DescribeOrganizationalUnitRequest = ( input: DescribeOrganizationalUnitRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationalUnitId !== undefined) { - bodyParams["OrganizationalUnitId"] = input.OrganizationalUnitId; - } - return bodyParams; + return { + ...(input.OrganizationalUnitId !== undefined && { + OrganizationalUnitId: input.OrganizationalUnitId + }) + }; }; const serializeAws_json1_1DescribePolicyRequest = ( input: DescribePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1DetachPolicyRequest = ( input: DetachPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - if (input.TargetId !== undefined) { - bodyParams["TargetId"] = input.TargetId; - } - return bodyParams; + return { + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }), + ...(input.TargetId !== undefined && { TargetId: input.TargetId }) + }; }; const serializeAws_json1_1DisableAWSServiceAccessRequest = ( input: DisableAWSServiceAccessRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServicePrincipal !== undefined) { - bodyParams["ServicePrincipal"] = input.ServicePrincipal; - } - return bodyParams; + return { + ...(input.ServicePrincipal !== undefined && { + ServicePrincipal: input.ServicePrincipal + }) + }; }; const serializeAws_json1_1DisablePolicyTypeRequest = ( input: DisablePolicyTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyType !== undefined) { - bodyParams["PolicyType"] = input.PolicyType; - } - if (input.RootId !== undefined) { - bodyParams["RootId"] = input.RootId; - } - return bodyParams; + return { + ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), + ...(input.RootId !== undefined && { RootId: input.RootId }) + }; }; const serializeAws_json1_1EnableAWSServiceAccessRequest = ( input: EnableAWSServiceAccessRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServicePrincipal !== undefined) { - bodyParams["ServicePrincipal"] = input.ServicePrincipal; - } - return bodyParams; + return { + ...(input.ServicePrincipal !== undefined && { + ServicePrincipal: input.ServicePrincipal + }) + }; }; const serializeAws_json1_1EnableAllFeaturesRequest = ( input: EnableAllFeaturesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1EnablePolicyTypeRequest = ( input: EnablePolicyTypeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PolicyType !== undefined) { - bodyParams["PolicyType"] = input.PolicyType; - } - if (input.RootId !== undefined) { - bodyParams["RootId"] = input.RootId; - } - return bodyParams; + return { + ...(input.PolicyType !== undefined && { PolicyType: input.PolicyType }), + ...(input.RootId !== undefined && { RootId: input.RootId }) + }; }; const serializeAws_json1_1HandshakeFilter = ( input: HandshakeFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActionType !== undefined) { - bodyParams["ActionType"] = input.ActionType; - } - if (input.ParentHandshakeId !== undefined) { - bodyParams["ParentHandshakeId"] = input.ParentHandshakeId; - } - return bodyParams; + return { + ...(input.ActionType !== undefined && { ActionType: input.ActionType }), + ...(input.ParentHandshakeId !== undefined && { + ParentHandshakeId: input.ParentHandshakeId + }) + }; }; const serializeAws_json1_1HandshakeParty = ( input: HandshakeParty, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1InviteAccountToOrganizationRequest = ( input: InviteAccountToOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Notes !== undefined) { - bodyParams["Notes"] = input.Notes; - } - if (input.Target !== undefined) { - bodyParams["Target"] = serializeAws_json1_1HandshakeParty( - input.Target, - context - ); - } - return bodyParams; + return { + ...(input.Notes !== undefined && { Notes: input.Notes }), + ...(input.Target !== undefined && { + Target: serializeAws_json1_1HandshakeParty(input.Target, context) + }) + }; }; const serializeAws_json1_1ListAWSServiceAccessForOrganizationRequest = ( input: ListAWSServiceAccessForOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListAccountsForParentRequest = ( input: ListAccountsForParentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParentId !== undefined) { - bodyParams["ParentId"] = input.ParentId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ParentId !== undefined && { ParentId: input.ParentId }) + }; }; const serializeAws_json1_1ListAccountsRequest = ( input: ListAccountsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListChildrenRequest = ( input: ListChildrenRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChildType !== undefined) { - bodyParams["ChildType"] = input.ChildType; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParentId !== undefined) { - bodyParams["ParentId"] = input.ParentId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListCreateAccountStatusRequest = ( input: ListCreateAccountStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.States !== undefined) { - bodyParams["States"] = serializeAws_json1_1CreateAccountStates( - input.States, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.States !== undefined && { + States: serializeAws_json1_1CreateAccountStates(input.States, context) + }) + }; }; const serializeAws_json1_1ListHandshakesForAccountRequest = ( input: ListHandshakesForAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1HandshakeFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1HandshakeFilter(input.Filter, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListHandshakesForOrganizationRequest = ( input: ListHandshakesForOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1HandshakeFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1HandshakeFilter(input.Filter, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListOrganizationalUnitsForParentRequest = ( input: ListOrganizationalUnitsForParentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParentId !== undefined) { - bodyParams["ParentId"] = input.ParentId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ParentId !== undefined && { ParentId: input.ParentId }) + }; }; const serializeAws_json1_1ListParentsRequest = ( input: ListParentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChildId !== undefined) { - bodyParams["ChildId"] = input.ChildId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ChildId !== undefined && { ChildId: input.ChildId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListPoliciesForTargetRequest = ( input: ListPoliciesForTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = input.Filter; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TargetId !== undefined) { - bodyParams["TargetId"] = input.TargetId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListPoliciesRequest = ( input: ListPoliciesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = input.Filter; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { Filter: input.Filter }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListRootsRequest = ( input: ListRootsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1ListTargetsForPolicyRequest = ( input: ListTargetsForPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.PolicyId !== undefined && { PolicyId: input.PolicyId }) + }; }; const serializeAws_json1_1MoveAccountRequest = ( input: MoveAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.DestinationParentId !== undefined) { - bodyParams["DestinationParentId"] = input.DestinationParentId; - } - if (input.SourceParentId !== undefined) { - bodyParams["SourceParentId"] = input.SourceParentId; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.DestinationParentId !== undefined && { + DestinationParentId: input.DestinationParentId + }), + ...(input.SourceParentId !== undefined && { + SourceParentId: input.SourceParentId + }) + }; }; const serializeAws_json1_1RemoveAccountFromOrganizationRequest = ( input: RemoveAccountFromOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -8840,14 +8677,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -8861,48 +8696,36 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateOrganizationalUnitRequest = ( input: UpdateOrganizationalUnitRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OrganizationalUnitId !== undefined) { - bodyParams["OrganizationalUnitId"] = input.OrganizationalUnitId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.OrganizationalUnitId !== undefined && { + OrganizationalUnitId: input.OrganizationalUnitId + }) + }; }; const serializeAws_json1_1UpdatePolicyRequest = ( input: UpdatePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PolicyId !== undefined) { - bodyParams["PolicyId"] = input.PolicyId; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AWSOrganizationsNotInUseException = ( diff --git a/clients/client-personalize-events/protocols/Aws_restJson1_1.ts b/clients/client-personalize-events/protocols/Aws_restJson1_1.ts index fc56b8fa1ccd..dca634b7e8cc 100644 --- a/clients/client-personalize-events/protocols/Aws_restJson1_1.ts +++ b/clients/client-personalize-events/protocols/Aws_restJson1_1.ts @@ -131,20 +131,16 @@ const serializeAws_restJson1_1Event = ( input: Event, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventId !== undefined) { - bodyParams["eventId"] = input.eventId; - } - if (input.eventType !== undefined) { - bodyParams["eventType"] = input.eventType; - } - if (input.properties !== undefined) { - bodyParams["properties"] = __LazyJsonString.fromObject(input.properties); - } - if (input.sentAt !== undefined) { - bodyParams["sentAt"] = Math.round(input.sentAt.getTime() / 1000); - } - return bodyParams; + return { + ...(input.eventId !== undefined && { eventId: input.eventId }), + ...(input.eventType !== undefined && { eventType: input.eventType }), + ...(input.properties !== undefined && { + properties: __LazyJsonString.fromObject(input.properties) + }), + ...(input.sentAt !== undefined && { + sentAt: Math.round(input.sentAt.getTime() / 1000) + }) + }; }; const serializeAws_restJson1_1EventList = ( diff --git a/clients/client-personalize/protocols/Aws_json1_1.ts b/clients/client-personalize/protocols/Aws_json1_1.ts index 055c5352a30b..2d492a106278 100644 --- a/clients/client-personalize/protocols/Aws_json1_1.ts +++ b/clients/client-personalize/protocols/Aws_json1_1.ts @@ -4103,62 +4103,52 @@ const serializeAws_json1_1AutoMLConfig = ( input: AutoMLConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.recipeList !== undefined) { - bodyParams["recipeList"] = serializeAws_json1_1ArnList( - input.recipeList, - context - ); - } - return bodyParams; + return { + ...(input.metricName !== undefined && { metricName: input.metricName }), + ...(input.recipeList !== undefined && { + recipeList: serializeAws_json1_1ArnList(input.recipeList, context) + }) + }; }; const serializeAws_json1_1BatchInferenceJobInput = ( input: BatchInferenceJobInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3DataSource !== undefined) { - bodyParams["s3DataSource"] = serializeAws_json1_1S3DataConfig( - input.s3DataSource, - context - ); - } - return bodyParams; + return { + ...(input.s3DataSource !== undefined && { + s3DataSource: serializeAws_json1_1S3DataConfig( + input.s3DataSource, + context + ) + }) + }; }; const serializeAws_json1_1BatchInferenceJobOutput = ( input: BatchInferenceJobOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3DataDestination !== undefined) { - bodyParams["s3DataDestination"] = serializeAws_json1_1S3DataConfig( - input.s3DataDestination, - context - ); - } - return bodyParams; + return { + ...(input.s3DataDestination !== undefined && { + s3DataDestination: serializeAws_json1_1S3DataConfig( + input.s3DataDestination, + context + ) + }) + }; }; const serializeAws_json1_1CategoricalHyperParameterRange = ( input: CategoricalHyperParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_json1_1CategoricalValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_json1_1CategoricalValues(input.values, context) + }) + }; }; const serializeAws_json1_1CategoricalHyperParameterRanges = ( @@ -4181,17 +4171,11 @@ const serializeAws_json1_1ContinuousHyperParameterRange = ( input: ContinuousHyperParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxValue !== undefined) { - bodyParams["maxValue"] = input.maxValue; - } - if (input.minValue !== undefined) { - bodyParams["minValue"] = input.minValue; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.maxValue !== undefined && { maxValue: input.maxValue }), + ...(input.minValue !== undefined && { minValue: input.minValue }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1ContinuousHyperParameterRanges = ( @@ -4207,392 +4191,329 @@ const serializeAws_json1_1CreateBatchInferenceJobRequest = ( input: CreateBatchInferenceJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.jobInput !== undefined) { - bodyParams["jobInput"] = serializeAws_json1_1BatchInferenceJobInput( - input.jobInput, - context - ); - } - if (input.jobName !== undefined) { - bodyParams["jobName"] = input.jobName; - } - if (input.jobOutput !== undefined) { - bodyParams["jobOutput"] = serializeAws_json1_1BatchInferenceJobOutput( - input.jobOutput, - context - ); - } - if (input.numResults !== undefined) { - bodyParams["numResults"] = input.numResults; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.solutionVersionArn !== undefined) { - bodyParams["solutionVersionArn"] = input.solutionVersionArn; - } - return bodyParams; + return { + ...(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 + }) + }; }; const serializeAws_json1_1CreateCampaignRequest = ( input: CreateCampaignRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.minProvisionedTPS !== undefined) { - bodyParams["minProvisionedTPS"] = input.minProvisionedTPS; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.solutionVersionArn !== undefined) { - bodyParams["solutionVersionArn"] = input.solutionVersionArn; - } - return bodyParams; + return { + ...(input.minProvisionedTPS !== undefined && { + minProvisionedTPS: input.minProvisionedTPS + }), + ...(input.name !== undefined && { name: input.name }), + ...(input.solutionVersionArn !== undefined && { + solutionVersionArn: input.solutionVersionArn + }) + }; }; const serializeAws_json1_1CreateDatasetGroupRequest = ( input: CreateDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.kmsKeyArn !== undefined) { - bodyParams["kmsKeyArn"] = input.kmsKeyArn; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + return { + ...(input.kmsKeyArn !== undefined && { kmsKeyArn: input.kmsKeyArn }), + ...(input.name !== undefined && { name: input.name }), + ...(input.roleArn !== undefined && { roleArn: input.roleArn }) + }; }; const serializeAws_json1_1CreateDatasetImportJobRequest = ( input: CreateDatasetImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataSource !== undefined) { - bodyParams["dataSource"] = serializeAws_json1_1DataSource( - input.dataSource, - context - ); - } - if (input.datasetArn !== undefined) { - bodyParams["datasetArn"] = input.datasetArn; - } - if (input.jobName !== undefined) { - bodyParams["jobName"] = input.jobName; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateDatasetRequest = ( input: CreateDatasetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - if (input.datasetType !== undefined) { - bodyParams["datasetType"] = input.datasetType; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.schemaArn !== undefined) { - bodyParams["schemaArn"] = input.schemaArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateEventTrackerRequest = ( input: CreateEventTrackerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.datasetGroupArn !== undefined && { + datasetGroupArn: input.datasetGroupArn + }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1CreateSchemaRequest = ( input: CreateSchemaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.schema !== undefined) { - bodyParams["schema"] = input.schema; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.schema !== undefined && { schema: input.schema }) + }; }; const serializeAws_json1_1CreateSolutionRequest = ( input: CreateSolutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - if (input.eventType !== undefined) { - bodyParams["eventType"] = input.eventType; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.performAutoML !== undefined) { - bodyParams["performAutoML"] = input.performAutoML; - } - if (input.performHPO !== undefined) { - bodyParams["performHPO"] = input.performHPO; - } - if (input.recipeArn !== undefined) { - bodyParams["recipeArn"] = input.recipeArn; - } - if (input.solutionConfig !== undefined) { - bodyParams["solutionConfig"] = serializeAws_json1_1SolutionConfig( - input.solutionConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateSolutionVersionRequest = ( input: CreateSolutionVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.solutionArn !== undefined) { - bodyParams["solutionArn"] = input.solutionArn; - } - if (input.trainingMode !== undefined) { - bodyParams["trainingMode"] = input.trainingMode; - } - return bodyParams; + return { + ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }), + ...(input.trainingMode !== undefined && { + trainingMode: input.trainingMode + }) + }; }; const serializeAws_json1_1DataSource = ( input: DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.dataLocation !== undefined) { - bodyParams["dataLocation"] = input.dataLocation; - } - return bodyParams; + return { + ...(input.dataLocation !== undefined && { + dataLocation: input.dataLocation + }) + }; }; const serializeAws_json1_1DeleteCampaignRequest = ( input: DeleteCampaignRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.campaignArn !== undefined) { - bodyParams["campaignArn"] = input.campaignArn; - } - return bodyParams; + return { + ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }) + }; }; const serializeAws_json1_1DeleteDatasetGroupRequest = ( input: DeleteDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - return bodyParams; + return { + ...(input.datasetGroupArn !== undefined && { + datasetGroupArn: input.datasetGroupArn + }) + }; }; const serializeAws_json1_1DeleteDatasetRequest = ( input: DeleteDatasetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetArn !== undefined) { - bodyParams["datasetArn"] = input.datasetArn; - } - return bodyParams; + return { + ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }) + }; }; const serializeAws_json1_1DeleteEventTrackerRequest = ( input: DeleteEventTrackerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventTrackerArn !== undefined) { - bodyParams["eventTrackerArn"] = input.eventTrackerArn; - } - return bodyParams; + return { + ...(input.eventTrackerArn !== undefined && { + eventTrackerArn: input.eventTrackerArn + }) + }; }; const serializeAws_json1_1DeleteSchemaRequest = ( input: DeleteSchemaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.schemaArn !== undefined) { - bodyParams["schemaArn"] = input.schemaArn; - } - return bodyParams; + return { + ...(input.schemaArn !== undefined && { schemaArn: input.schemaArn }) + }; }; const serializeAws_json1_1DeleteSolutionRequest = ( input: DeleteSolutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.solutionArn !== undefined) { - bodyParams["solutionArn"] = input.solutionArn; - } - return bodyParams; + return { + ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }) + }; }; const serializeAws_json1_1DescribeAlgorithmRequest = ( input: DescribeAlgorithmRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.algorithmArn !== undefined) { - bodyParams["algorithmArn"] = input.algorithmArn; - } - return bodyParams; + return { + ...(input.algorithmArn !== undefined && { + algorithmArn: input.algorithmArn + }) + }; }; const serializeAws_json1_1DescribeBatchInferenceJobRequest = ( input: DescribeBatchInferenceJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.batchInferenceJobArn !== undefined) { - bodyParams["batchInferenceJobArn"] = input.batchInferenceJobArn; - } - return bodyParams; + return { + ...(input.batchInferenceJobArn !== undefined && { + batchInferenceJobArn: input.batchInferenceJobArn + }) + }; }; const serializeAws_json1_1DescribeCampaignRequest = ( input: DescribeCampaignRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.campaignArn !== undefined) { - bodyParams["campaignArn"] = input.campaignArn; - } - return bodyParams; + return { + ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }) + }; }; const serializeAws_json1_1DescribeDatasetGroupRequest = ( input: DescribeDatasetGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - return bodyParams; + return { + ...(input.datasetGroupArn !== undefined && { + datasetGroupArn: input.datasetGroupArn + }) + }; }; const serializeAws_json1_1DescribeDatasetImportJobRequest = ( input: DescribeDatasetImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetImportJobArn !== undefined) { - bodyParams["datasetImportJobArn"] = input.datasetImportJobArn; - } - return bodyParams; + return { + ...(input.datasetImportJobArn !== undefined && { + datasetImportJobArn: input.datasetImportJobArn + }) + }; }; const serializeAws_json1_1DescribeDatasetRequest = ( input: DescribeDatasetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetArn !== undefined) { - bodyParams["datasetArn"] = input.datasetArn; - } - return bodyParams; + return { + ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }) + }; }; const serializeAws_json1_1DescribeEventTrackerRequest = ( input: DescribeEventTrackerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.eventTrackerArn !== undefined) { - bodyParams["eventTrackerArn"] = input.eventTrackerArn; - } - return bodyParams; + return { + ...(input.eventTrackerArn !== undefined && { + eventTrackerArn: input.eventTrackerArn + }) + }; }; const serializeAws_json1_1DescribeFeatureTransformationRequest = ( input: DescribeFeatureTransformationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.featureTransformationArn !== undefined) { - bodyParams["featureTransformationArn"] = input.featureTransformationArn; - } - return bodyParams; + return { + ...(input.featureTransformationArn !== undefined && { + featureTransformationArn: input.featureTransformationArn + }) + }; }; const serializeAws_json1_1DescribeRecipeRequest = ( input: DescribeRecipeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.recipeArn !== undefined) { - bodyParams["recipeArn"] = input.recipeArn; - } - return bodyParams; + return { + ...(input.recipeArn !== undefined && { recipeArn: input.recipeArn }) + }; }; const serializeAws_json1_1DescribeSchemaRequest = ( input: DescribeSchemaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.schemaArn !== undefined) { - bodyParams["schemaArn"] = input.schemaArn; - } - return bodyParams; + return { + ...(input.schemaArn !== undefined && { schemaArn: input.schemaArn }) + }; }; const serializeAws_json1_1DescribeSolutionRequest = ( input: DescribeSolutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.solutionArn !== undefined) { - bodyParams["solutionArn"] = input.solutionArn; - } - return bodyParams; + return { + ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }) + }; }; const serializeAws_json1_1DescribeSolutionVersionRequest = ( input: DescribeSolutionVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.solutionVersionArn !== undefined) { - bodyParams["solutionVersionArn"] = input.solutionVersionArn; - } - return bodyParams; + return { + ...(input.solutionVersionArn !== undefined && { + solutionVersionArn: input.solutionVersionArn + }) + }; }; const serializeAws_json1_1FeatureTransformationParameters = ( @@ -4609,102 +4530,88 @@ const serializeAws_json1_1GetSolutionMetricsRequest = ( input: GetSolutionMetricsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.solutionVersionArn !== undefined) { - bodyParams["solutionVersionArn"] = input.solutionVersionArn; - } - return bodyParams; + return { + ...(input.solutionVersionArn !== undefined && { + solutionVersionArn: input.solutionVersionArn + }) + }; }; const serializeAws_json1_1HPOConfig = ( input: HPOConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.algorithmHyperParameterRanges !== undefined) { - bodyParams[ - "algorithmHyperParameterRanges" - ] = serializeAws_json1_1HyperParameterRanges( - input.algorithmHyperParameterRanges, - context - ); - } - if (input.hpoObjective !== undefined) { - bodyParams["hpoObjective"] = serializeAws_json1_1HPOObjective( - input.hpoObjective, - context - ); - } - if (input.hpoResourceConfig !== undefined) { - bodyParams["hpoResourceConfig"] = serializeAws_json1_1HPOResourceConfig( - input.hpoResourceConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1HPOObjective = ( input: HPOObjective, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.metricName !== undefined) { - bodyParams["metricName"] = input.metricName; - } - if (input.metricRegex !== undefined) { - bodyParams["metricRegex"] = input.metricRegex; - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + return { + ...(input.metricName !== undefined && { metricName: input.metricName }), + ...(input.metricRegex !== undefined && { metricRegex: input.metricRegex }), + ...(input.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_1HPOResourceConfig = ( input: HPOResourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxNumberOfTrainingJobs !== undefined) { - bodyParams["maxNumberOfTrainingJobs"] = input.maxNumberOfTrainingJobs; - } - if (input.maxParallelTrainingJobs !== undefined) { - bodyParams["maxParallelTrainingJobs"] = input.maxParallelTrainingJobs; - } - return bodyParams; + return { + ...(input.maxNumberOfTrainingJobs !== undefined && { + maxNumberOfTrainingJobs: input.maxNumberOfTrainingJobs + }), + ...(input.maxParallelTrainingJobs !== undefined && { + maxParallelTrainingJobs: input.maxParallelTrainingJobs + }) + }; }; const serializeAws_json1_1HyperParameterRanges = ( input: HyperParameterRanges, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.categoricalHyperParameterRanges !== undefined) { - bodyParams[ - "categoricalHyperParameterRanges" - ] = serializeAws_json1_1CategoricalHyperParameterRanges( - input.categoricalHyperParameterRanges, - context - ); - } - if (input.continuousHyperParameterRanges !== undefined) { - bodyParams[ - "continuousHyperParameterRanges" - ] = serializeAws_json1_1ContinuousHyperParameterRanges( - input.continuousHyperParameterRanges, - context - ); - } - if (input.integerHyperParameterRanges !== undefined) { - bodyParams[ - "integerHyperParameterRanges" - ] = serializeAws_json1_1IntegerHyperParameterRanges( - input.integerHyperParameterRanges, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1HyperParameters = ( @@ -4721,17 +4628,11 @@ const serializeAws_json1_1IntegerHyperParameterRange = ( input: IntegerHyperParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxValue !== undefined) { - bodyParams["maxValue"] = input.maxValue; - } - if (input.minValue !== undefined) { - bodyParams["minValue"] = input.minValue; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.maxValue !== undefined && { maxValue: input.maxValue }), + ...(input.minValue !== undefined && { minValue: input.minValue }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_1IntegerHyperParameterRanges = ( @@ -4747,234 +4648,175 @@ const serializeAws_json1_1ListBatchInferenceJobsRequest = ( input: ListBatchInferenceJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.solutionVersionArn !== undefined) { - bodyParams["solutionVersionArn"] = input.solutionVersionArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.solutionVersionArn !== undefined && { + solutionVersionArn: input.solutionVersionArn + }) + }; }; const serializeAws_json1_1ListCampaignsRequest = ( input: ListCampaignsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.solutionArn !== undefined) { - bodyParams["solutionArn"] = input.solutionArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }) + }; }; const serializeAws_json1_1ListDatasetGroupsRequest = ( input: ListDatasetGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListDatasetImportJobsRequest = ( input: ListDatasetImportJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetArn !== undefined) { - bodyParams["datasetArn"] = input.datasetArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.datasetArn !== undefined && { datasetArn: input.datasetArn }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListDatasetsRequest = ( input: ListDatasetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.datasetGroupArn !== undefined && { + datasetGroupArn: input.datasetGroupArn + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListEventTrackersRequest = ( input: ListEventTrackersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.datasetGroupArn !== undefined && { + datasetGroupArn: input.datasetGroupArn + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListRecipesRequest = ( input: ListRecipesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.recipeProvider !== undefined) { - bodyParams["recipeProvider"] = input.recipeProvider; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.recipeProvider !== undefined && { + recipeProvider: input.recipeProvider + }) + }; }; const serializeAws_json1_1ListSchemasRequest = ( input: ListSchemasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1ListSolutionVersionsRequest = ( input: ListSolutionVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.solutionArn !== undefined) { - bodyParams["solutionArn"] = input.solutionArn; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.solutionArn !== undefined && { solutionArn: input.solutionArn }) + }; }; const serializeAws_json1_1ListSolutionsRequest = ( input: ListSolutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.datasetGroupArn !== undefined) { - bodyParams["datasetGroupArn"] = input.datasetGroupArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.datasetGroupArn !== undefined && { + datasetGroupArn: input.datasetGroupArn + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1S3DataConfig = ( input: S3DataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.kmsKeyArn !== undefined) { - bodyParams["kmsKeyArn"] = input.kmsKeyArn; - } - if (input.path !== undefined) { - bodyParams["path"] = input.path; - } - return bodyParams; + return { + ...(input.kmsKeyArn !== undefined && { kmsKeyArn: input.kmsKeyArn }), + ...(input.path !== undefined && { path: input.path }) + }; }; const serializeAws_json1_1SolutionConfig = ( input: SolutionConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.algorithmHyperParameters !== undefined) { - bodyParams[ - "algorithmHyperParameters" - ] = serializeAws_json1_1HyperParameters( - input.algorithmHyperParameters, - context - ); - } - if (input.autoMLConfig !== undefined) { - bodyParams["autoMLConfig"] = serializeAws_json1_1AutoMLConfig( - input.autoMLConfig, - context - ); - } - if (input.eventValueThreshold !== undefined) { - bodyParams["eventValueThreshold"] = input.eventValueThreshold; - } - if (input.featureTransformationParameters !== undefined) { - bodyParams[ - "featureTransformationParameters" - ] = serializeAws_json1_1FeatureTransformationParameters( - input.featureTransformationParameters, - context - ); - } - if (input.hpoConfig !== undefined) { - bodyParams["hpoConfig"] = serializeAws_json1_1HPOConfig( - input.hpoConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateCampaignRequest = ( input: UpdateCampaignRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.campaignArn !== undefined) { - bodyParams["campaignArn"] = input.campaignArn; - } - if (input.minProvisionedTPS !== undefined) { - bodyParams["minProvisionedTPS"] = input.minProvisionedTPS; - } - if (input.solutionVersionArn !== undefined) { - bodyParams["solutionVersionArn"] = input.solutionVersionArn; - } - return bodyParams; + return { + ...(input.campaignArn !== undefined && { campaignArn: input.campaignArn }), + ...(input.minProvisionedTPS !== undefined && { + minProvisionedTPS: input.minProvisionedTPS + }), + ...(input.solutionVersionArn !== undefined && { + solutionVersionArn: input.solutionVersionArn + }) + }; }; const deserializeAws_json1_1Algorithm = ( diff --git a/clients/client-pi/protocols/Aws_json1_1.ts b/clients/client-pi/protocols/Aws_json1_1.ts index bc9c28901806..a32b579b4456 100644 --- a/clients/client-pi/protocols/Aws_json1_1.ts +++ b/clients/client-pi/protocols/Aws_json1_1.ts @@ -293,128 +293,89 @@ const serializeAws_json1_1DescribeDimensionKeysRequest = ( input: DescribeDimensionKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1MetricQueryFilterMap( - input.Filter, - context - ); - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1DimensionGroup( - input.GroupBy, - context - ); - } - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Metric !== undefined) { - bodyParams["Metric"] = input.Metric; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PartitionBy !== undefined) { - bodyParams["PartitionBy"] = serializeAws_json1_1DimensionGroup( - input.PartitionBy, - context - ); - } - if (input.PeriodInSeconds !== undefined) { - bodyParams["PeriodInSeconds"] = input.PeriodInSeconds; - } - if (input.ServiceType !== undefined) { - bodyParams["ServiceType"] = input.ServiceType; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DimensionGroup = ( input: DimensionGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_json1_1StringList( - input.Dimensions, - context - ); - } - if (input.Group !== undefined) { - bodyParams["Group"] = input.Group; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - return bodyParams; + return { + ...(input.Dimensions !== undefined && { + Dimensions: serializeAws_json1_1StringList(input.Dimensions, context) + }), + ...(input.Group !== undefined && { Group: input.Group }), + ...(input.Limit !== undefined && { Limit: input.Limit }) + }; }; const serializeAws_json1_1GetResourceMetricsRequest = ( input: GetResourceMetricsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.Identifier !== undefined) { - bodyParams["Identifier"] = input.Identifier; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MetricQueries !== undefined) { - bodyParams["MetricQueries"] = serializeAws_json1_1MetricQueryList( - input.MetricQueries, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PeriodInSeconds !== undefined) { - bodyParams["PeriodInSeconds"] = input.PeriodInSeconds; - } - if (input.ServiceType !== undefined) { - bodyParams["ServiceType"] = input.ServiceType; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1MetricQuery = ( input: MetricQuery, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1MetricQueryFilterMap( - input.Filter, - context - ); - } - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1DimensionGroup( - input.GroupBy, - context - ); - } - if (input.Metric !== undefined) { - bodyParams["Metric"] = input.Metric; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1MetricQueryFilterMap = ( diff --git a/clients/client-pinpoint-email/protocols/Aws_restJson1_1.ts b/clients/client-pinpoint-email/protocols/Aws_restJson1_1.ts index e37a82395c46..178dfa26b468 100644 --- a/clients/client-pinpoint-email/protocols/Aws_restJson1_1.ts +++ b/clients/client-pinpoint-email/protocols/Aws_restJson1_1.ts @@ -5833,14 +5833,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagList = ( @@ -5854,47 +5850,45 @@ const serializeAws_restJson1_1Body = ( input: Body, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Html !== undefined) { - bodyParams["Html"] = serializeAws_restJson1_1Content(input.Html, context); - } - if (input.Text !== undefined) { - bodyParams["Text"] = serializeAws_restJson1_1Content(input.Text, context); - } - return bodyParams; + return { + ...(input.Html !== undefined && { + Html: serializeAws_restJson1_1Content(input.Html, context) + }), + ...(input.Text !== undefined && { + Text: serializeAws_restJson1_1Content(input.Text, context) + }) + }; }; const serializeAws_restJson1_1CloudWatchDestination = ( input: CloudWatchDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DimensionConfigurations !== undefined) { - bodyParams[ - "DimensionConfigurations" - ] = serializeAws_restJson1_1CloudWatchDimensionConfigurations( - input.DimensionConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.DimensionConfigurations !== undefined && { + DimensionConfigurations: serializeAws_restJson1_1CloudWatchDimensionConfigurations( + input.DimensionConfigurations, + context + ) + }) + }; }; const serializeAws_restJson1_1CloudWatchDimensionConfiguration = ( input: CloudWatchDimensionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultDimensionValue !== undefined) { - bodyParams["DefaultDimensionValue"] = input.DefaultDimensionValue; - } - if (input.DimensionName !== undefined) { - bodyParams["DimensionName"] = input.DimensionName; - } - if (input.DimensionValueSource !== undefined) { - bodyParams["DimensionValueSource"] = input.DimensionValueSource; - } - return bodyParams; + return { + ...(input.DefaultDimensionValue !== undefined && { + DefaultDimensionValue: input.DefaultDimensionValue + }), + ...(input.DimensionName !== undefined && { + DimensionName: input.DimensionName + }), + ...(input.DimensionValueSource !== undefined && { + DimensionValueSource: input.DimensionValueSource + }) + }; }; const serializeAws_restJson1_1CloudWatchDimensionConfigurations = ( @@ -5910,78 +5904,68 @@ const serializeAws_restJson1_1Content = ( input: Content, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Charset !== undefined) { - bodyParams["Charset"] = input.Charset; - } - if (input.Data !== undefined) { - bodyParams["Data"] = input.Data; - } - return bodyParams; + return { + ...(input.Charset !== undefined && { Charset: input.Charset }), + ...(input.Data !== undefined && { Data: input.Data }) + }; }; const serializeAws_restJson1_1DeliveryOptions = ( input: DeliveryOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SendingPoolName !== undefined) { - bodyParams["SendingPoolName"] = input.SendingPoolName; - } - if (input.TlsPolicy !== undefined) { - bodyParams["TlsPolicy"] = input.TlsPolicy; - } - return bodyParams; + return { + ...(input.SendingPoolName !== undefined && { + SendingPoolName: input.SendingPoolName + }), + ...(input.TlsPolicy !== undefined && { TlsPolicy: input.TlsPolicy }) + }; }; const serializeAws_restJson1_1Destination = ( input: Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BccAddresses !== undefined) { - bodyParams["BccAddresses"] = serializeAws_restJson1_1EmailAddressList( - input.BccAddresses, - context - ); - } - if (input.CcAddresses !== undefined) { - bodyParams["CcAddresses"] = serializeAws_restJson1_1EmailAddressList( - input.CcAddresses, - context - ); - } - if (input.ToAddresses !== undefined) { - bodyParams["ToAddresses"] = serializeAws_restJson1_1EmailAddressList( - input.ToAddresses, - context - ); - } - return bodyParams; + return { + ...(input.BccAddresses !== undefined && { + BccAddresses: serializeAws_restJson1_1EmailAddressList( + input.BccAddresses, + context + ) + }), + ...(input.CcAddresses !== undefined && { + CcAddresses: serializeAws_restJson1_1EmailAddressList( + input.CcAddresses, + context + ) + }), + ...(input.ToAddresses !== undefined && { + ToAddresses: serializeAws_restJson1_1EmailAddressList( + input.ToAddresses, + context + ) + }) + }; }; const serializeAws_restJson1_1DomainDeliverabilityTrackingOption = ( input: DomainDeliverabilityTrackingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.InboxPlacementTrackingOption !== undefined) { - bodyParams[ - "InboxPlacementTrackingOption" - ] = serializeAws_restJson1_1InboxPlacementTrackingOption( - input.InboxPlacementTrackingOption, - context - ); - } - if (input.SubscriptionStartDate !== undefined) { - bodyParams["SubscriptionStartDate"] = Math.round( - input.SubscriptionStartDate.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.InboxPlacementTrackingOption !== undefined && { + InboxPlacementTrackingOption: serializeAws_restJson1_1InboxPlacementTrackingOption( + input.InboxPlacementTrackingOption, + context + ) + }), + ...(input.SubscriptionStartDate !== undefined && { + SubscriptionStartDate: Math.round( + input.SubscriptionStartDate.getTime() / 1000 + ) + }) + }; }; const serializeAws_restJson1_1DomainDeliverabilityTrackingOptions = ( @@ -6004,70 +5988,56 @@ const serializeAws_restJson1_1EmailContent = ( input: EmailContent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Raw !== undefined) { - bodyParams["Raw"] = serializeAws_restJson1_1RawMessage(input.Raw, context); - } - if (input.Simple !== undefined) { - bodyParams["Simple"] = serializeAws_restJson1_1Message( - input.Simple, - context - ); - } - if (input.Template !== undefined) { - bodyParams["Template"] = serializeAws_restJson1_1Template( - input.Template, - context - ); - } - return bodyParams; + return { + ...(input.Raw !== undefined && { + Raw: serializeAws_restJson1_1RawMessage(input.Raw, context) + }), + ...(input.Simple !== undefined && { + Simple: serializeAws_restJson1_1Message(input.Simple, context) + }), + ...(input.Template !== undefined && { + Template: serializeAws_restJson1_1Template(input.Template, context) + }) + }; }; const serializeAws_restJson1_1EventDestinationDefinition = ( input: EventDestinationDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchDestination !== undefined) { - bodyParams[ - "CloudWatchDestination" - ] = serializeAws_restJson1_1CloudWatchDestination( - input.CloudWatchDestination, - context - ); - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.KinesisFirehoseDestination !== undefined) { - bodyParams[ - "KinesisFirehoseDestination" - ] = serializeAws_restJson1_1KinesisFirehoseDestination( - input.KinesisFirehoseDestination, - context - ); - } - if (input.MatchingEventTypes !== undefined) { - bodyParams["MatchingEventTypes"] = serializeAws_restJson1_1EventTypes( - input.MatchingEventTypes, - context - ); - } - if (input.PinpointDestination !== undefined) { - bodyParams[ - "PinpointDestination" - ] = serializeAws_restJson1_1PinpointDestination( - input.PinpointDestination, - context - ); - } - if (input.SnsDestination !== undefined) { - bodyParams["SnsDestination"] = serializeAws_restJson1_1SnsDestination( - input.SnsDestination, - context - ); - } - return bodyParams; + return { + ...(input.CloudWatchDestination !== undefined && { + CloudWatchDestination: serializeAws_restJson1_1CloudWatchDestination( + input.CloudWatchDestination, + context + ) + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.KinesisFirehoseDestination !== undefined && { + KinesisFirehoseDestination: serializeAws_restJson1_1KinesisFirehoseDestination( + input.KinesisFirehoseDestination, + context + ) + }), + ...(input.MatchingEventTypes !== undefined && { + MatchingEventTypes: serializeAws_restJson1_1EventTypes( + input.MatchingEventTypes, + context + ) + }), + ...(input.PinpointDestination !== undefined && { + PinpointDestination: serializeAws_restJson1_1PinpointDestination( + input.PinpointDestination, + context + ) + }), + ...(input.SnsDestination !== undefined && { + SnsDestination: serializeAws_restJson1_1SnsDestination( + input.SnsDestination, + context + ) + }) + }; }; const serializeAws_restJson1_1EventTypes = ( @@ -6081,17 +6051,15 @@ const serializeAws_restJson1_1InboxPlacementTrackingOption = ( input: InboxPlacementTrackingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Global !== undefined) { - bodyParams["Global"] = input.Global; - } - if (input.TrackedIsps !== undefined) { - bodyParams["TrackedIsps"] = serializeAws_restJson1_1IspNameList( - input.TrackedIsps, - context - ); - } - return bodyParams; + return { + ...(input.Global !== undefined && { Global: input.Global }), + ...(input.TrackedIsps !== undefined && { + TrackedIsps: serializeAws_restJson1_1IspNameList( + input.TrackedIsps, + context + ) + }) + }; }; const serializeAws_restJson1_1IspNameList = ( @@ -6105,45 +6073,36 @@ const serializeAws_restJson1_1KinesisFirehoseDestination = ( input: KinesisFirehoseDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamArn !== undefined) { - bodyParams["DeliveryStreamArn"] = input.DeliveryStreamArn; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - return bodyParams; + return { + ...(input.DeliveryStreamArn !== undefined && { + DeliveryStreamArn: input.DeliveryStreamArn + }), + ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }) + }; }; const serializeAws_restJson1_1Message = ( input: Message, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = serializeAws_restJson1_1Body(input.Body, context); - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = serializeAws_restJson1_1Content( - input.Subject, - context - ); - } - return bodyParams; + return { + ...(input.Body !== undefined && { + Body: serializeAws_restJson1_1Body(input.Body, context) + }), + ...(input.Subject !== undefined && { + Subject: serializeAws_restJson1_1Content(input.Subject, context) + }) + }; }; const serializeAws_restJson1_1MessageTag = ( input: MessageTag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1MessageTagList = ( @@ -6157,85 +6116,77 @@ const serializeAws_restJson1_1PinpointDestination = ( input: PinpointDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationArn !== undefined) { - bodyParams["ApplicationArn"] = input.ApplicationArn; - } - return bodyParams; + return { + ...(input.ApplicationArn !== undefined && { + ApplicationArn: input.ApplicationArn + }) + }; }; const serializeAws_restJson1_1RawMessage = ( input: RawMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = context.base64Encoder(input.Data); - } - return bodyParams; + return { + ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }) + }; }; const serializeAws_restJson1_1ReputationOptions = ( input: ReputationOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LastFreshStart !== undefined) { - bodyParams["LastFreshStart"] = Math.round( - input.LastFreshStart.getTime() / 1000 - ); - } - if (input.ReputationMetricsEnabled !== undefined) { - bodyParams["ReputationMetricsEnabled"] = input.ReputationMetricsEnabled; - } - return bodyParams; + return { + ...(input.LastFreshStart !== undefined && { + LastFreshStart: Math.round(input.LastFreshStart.getTime() / 1000) + }), + ...(input.ReputationMetricsEnabled !== undefined && { + ReputationMetricsEnabled: input.ReputationMetricsEnabled + }) + }; }; const serializeAws_restJson1_1SendingOptions = ( input: SendingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SendingEnabled !== undefined) { - bodyParams["SendingEnabled"] = input.SendingEnabled; - } - return bodyParams; + return { + ...(input.SendingEnabled !== undefined && { + SendingEnabled: input.SendingEnabled + }) + }; }; const serializeAws_restJson1_1SnsDestination = ( input: SnsDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TopicArn !== undefined) { - bodyParams["TopicArn"] = input.TopicArn; - } - return bodyParams; + return { + ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }) + }; }; const serializeAws_restJson1_1Template = ( input: Template, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TemplateArn !== undefined) { - bodyParams["TemplateArn"] = input.TemplateArn; - } - if (input.TemplateData !== undefined) { - bodyParams["TemplateData"] = input.TemplateData; - } - return bodyParams; + return { + ...(input.TemplateArn !== undefined && { TemplateArn: input.TemplateArn }), + ...(input.TemplateData !== undefined && { + TemplateData: input.TemplateData + }) + }; }; const serializeAws_restJson1_1TrackingOptions = ( input: TrackingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomRedirectDomain !== undefined) { - bodyParams["CustomRedirectDomain"] = input.CustomRedirectDomain; - } - return bodyParams; + return { + ...(input.CustomRedirectDomain !== undefined && { + CustomRedirectDomain: input.CustomRedirectDomain + }) + }; }; const deserializeAws_restJson1_1Tag = ( diff --git a/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1_1.ts b/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1_1.ts index 192eedae776a..fdb41712a00b 100644 --- a/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1_1.ts +++ b/clients/client-pinpoint-sms-voice/protocols/Aws_restJson1_1.ts @@ -1267,64 +1267,52 @@ const serializeAws_restJson1_1CallInstructionsMessageType = ( input: CallInstructionsMessageType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }) + }; }; const serializeAws_restJson1_1CloudWatchLogsDestination = ( input: CloudWatchLogsDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - if (input.LogGroupArn !== undefined) { - bodyParams["LogGroupArn"] = input.LogGroupArn; - } - return bodyParams; + return { + ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }), + ...(input.LogGroupArn !== undefined && { LogGroupArn: input.LogGroupArn }) + }; }; const serializeAws_restJson1_1EventDestinationDefinition = ( input: EventDestinationDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogsDestination !== undefined) { - bodyParams[ - "CloudWatchLogsDestination" - ] = serializeAws_restJson1_1CloudWatchLogsDestination( - input.CloudWatchLogsDestination, - context - ); - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.KinesisFirehoseDestination !== undefined) { - bodyParams[ - "KinesisFirehoseDestination" - ] = serializeAws_restJson1_1KinesisFirehoseDestination( - input.KinesisFirehoseDestination, - context - ); - } - if (input.MatchingEventTypes !== undefined) { - bodyParams["MatchingEventTypes"] = serializeAws_restJson1_1EventTypes( - input.MatchingEventTypes, - context - ); - } - if (input.SnsDestination !== undefined) { - bodyParams["SnsDestination"] = serializeAws_restJson1_1SnsDestination( - input.SnsDestination, - context - ); - } - return bodyParams; + return { + ...(input.CloudWatchLogsDestination !== undefined && { + CloudWatchLogsDestination: serializeAws_restJson1_1CloudWatchLogsDestination( + input.CloudWatchLogsDestination, + context + ) + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.KinesisFirehoseDestination !== undefined && { + KinesisFirehoseDestination: serializeAws_restJson1_1KinesisFirehoseDestination( + input.KinesisFirehoseDestination, + context + ) + }), + ...(input.MatchingEventTypes !== undefined && { + MatchingEventTypes: serializeAws_restJson1_1EventTypes( + input.MatchingEventTypes, + context + ) + }), + ...(input.SnsDestination !== undefined && { + SnsDestination: serializeAws_restJson1_1SnsDestination( + input.SnsDestination, + context + ) + }) + }; }; const serializeAws_restJson1_1EventTypes = ( @@ -1338,89 +1326,73 @@ const serializeAws_restJson1_1KinesisFirehoseDestination = ( input: KinesisFirehoseDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamArn !== undefined) { - bodyParams["DeliveryStreamArn"] = input.DeliveryStreamArn; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - return bodyParams; + return { + ...(input.DeliveryStreamArn !== undefined && { + DeliveryStreamArn: input.DeliveryStreamArn + }), + ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }) + }; }; const serializeAws_restJson1_1PlainTextMessageType = ( input: PlainTextMessageType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - if (input.VoiceId !== undefined) { - bodyParams["VoiceId"] = input.VoiceId; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.Text !== undefined && { Text: input.Text }), + ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }) + }; }; const serializeAws_restJson1_1SSMLMessageType = ( input: SSMLMessageType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - if (input.VoiceId !== undefined) { - bodyParams["VoiceId"] = input.VoiceId; - } - return bodyParams; + return { + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.Text !== undefined && { Text: input.Text }), + ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }) + }; }; const serializeAws_restJson1_1SnsDestination = ( input: SnsDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TopicArn !== undefined) { - bodyParams["TopicArn"] = input.TopicArn; - } - return bodyParams; + return { + ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }) + }; }; const serializeAws_restJson1_1VoiceMessageContent = ( input: VoiceMessageContent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CallInstructionsMessage !== undefined) { - bodyParams[ - "CallInstructionsMessage" - ] = serializeAws_restJson1_1CallInstructionsMessageType( - input.CallInstructionsMessage, - context - ); - } - if (input.PlainTextMessage !== undefined) { - bodyParams[ - "PlainTextMessage" - ] = serializeAws_restJson1_1PlainTextMessageType( - input.PlainTextMessage, - context - ); - } - if (input.SSMLMessage !== undefined) { - bodyParams["SSMLMessage"] = serializeAws_restJson1_1SSMLMessageType( - input.SSMLMessage, - context - ); - } - return bodyParams; + return { + ...(input.CallInstructionsMessage !== undefined && { + CallInstructionsMessage: serializeAws_restJson1_1CallInstructionsMessageType( + input.CallInstructionsMessage, + context + ) + }), + ...(input.PlainTextMessage !== undefined && { + PlainTextMessage: serializeAws_restJson1_1PlainTextMessageType( + input.PlainTextMessage, + context + ) + }), + ...(input.SSMLMessage !== undefined && { + SSMLMessage: serializeAws_restJson1_1SSMLMessageType( + input.SSMLMessage, + context + ) + }) + }; }; const deserializeAws_restJson1_1CloudWatchLogsDestination = ( diff --git a/clients/client-pinpoint/protocols/Aws_restJson1_1.ts b/clients/client-pinpoint/protocols/Aws_restJson1_1.ts index 7958e53d50e1..032c3a0bed4d 100644 --- a/clients/client-pinpoint/protocols/Aws_restJson1_1.ts +++ b/clients/client-pinpoint/protocols/Aws_restJson1_1.ts @@ -17691,1512 +17691,1073 @@ const serializeAws_restJson1_1ADMChannelRequest = ( input: ADMChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.ClientSecret !== undefined) { - bodyParams["ClientSecret"] = input.ClientSecret; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.ClientSecret !== undefined && { + ClientSecret: input.ClientSecret + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_restJson1_1ADMMessage = ( input: ADMMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.ConsolidationKey !== undefined) { - bodyParams["ConsolidationKey"] = input.ConsolidationKey; - } - if (input.Data !== undefined) { - bodyParams["Data"] = serializeAws_restJson1_1MapOf__string( - input.Data, - context - ); - } - if (input.ExpiresAfter !== undefined) { - bodyParams["ExpiresAfter"] = input.ExpiresAfter; - } - if (input.IconReference !== undefined) { - bodyParams["IconReference"] = input.IconReference; - } - if (input.ImageIconUrl !== undefined) { - bodyParams["ImageIconUrl"] = input.ImageIconUrl; - } - if (input.ImageUrl !== undefined) { - bodyParams["ImageUrl"] = input.ImageUrl; - } - if (input.MD5 !== undefined) { - bodyParams["MD5"] = input.MD5; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.SilentPush !== undefined) { - bodyParams["SilentPush"] = input.SilentPush; - } - if (input.SmallImageIconUrl !== undefined) { - bodyParams["SmallImageIconUrl"] = input.SmallImageIconUrl; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.ConsolidationKey !== undefined && { + ConsolidationKey: input.ConsolidationKey + }), + ...(input.Data !== undefined && { + Data: serializeAws_restJson1_1MapOf__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_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Url !== undefined && { Url: input.Url }) + }; }; const serializeAws_restJson1_1APNSChannelRequest = ( input: APNSChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.DefaultAuthenticationMethod !== undefined) { - bodyParams["DefaultAuthenticationMethod"] = - input.DefaultAuthenticationMethod; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.PrivateKey !== undefined) { - bodyParams["PrivateKey"] = input.PrivateKey; - } - if (input.TeamId !== undefined) { - bodyParams["TeamId"] = input.TeamId; - } - if (input.TokenKey !== undefined) { - bodyParams["TokenKey"] = input.TokenKey; - } - if (input.TokenKeyId !== undefined) { - bodyParams["TokenKeyId"] = input.TokenKeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1APNSMessage = ( input: APNSMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.APNSPushType !== undefined) { - bodyParams["APNSPushType"] = input.APNSPushType; - } - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Badge !== undefined) { - bodyParams["Badge"] = input.Badge; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.Category !== undefined) { - bodyParams["Category"] = input.Category; - } - if (input.CollapseId !== undefined) { - bodyParams["CollapseId"] = input.CollapseId; - } - if (input.Data !== undefined) { - bodyParams["Data"] = serializeAws_restJson1_1MapOf__string( - input.Data, - context - ); - } - if (input.MediaUrl !== undefined) { - bodyParams["MediaUrl"] = input.MediaUrl; - } - if (input.PreferredAuthenticationMethod !== undefined) { - bodyParams["PreferredAuthenticationMethod"] = - input.PreferredAuthenticationMethod; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.SilentPush !== undefined) { - bodyParams["SilentPush"] = input.SilentPush; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.ThreadId !== undefined) { - bodyParams["ThreadId"] = input.ThreadId; - } - if (input.TimeToLive !== undefined) { - bodyParams["TimeToLive"] = input.TimeToLive; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + 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_restJson1_1MapOf__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_restJson1_1MapOfListOf__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 }) + }; }; const serializeAws_restJson1_1APNSPushNotificationTemplate = ( input: APNSPushNotificationTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.MediaUrl !== undefined) { - bodyParams["MediaUrl"] = input.MediaUrl; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1APNSSandboxChannelRequest = ( input: APNSSandboxChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.DefaultAuthenticationMethod !== undefined) { - bodyParams["DefaultAuthenticationMethod"] = - input.DefaultAuthenticationMethod; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.PrivateKey !== undefined) { - bodyParams["PrivateKey"] = input.PrivateKey; - } - if (input.TeamId !== undefined) { - bodyParams["TeamId"] = input.TeamId; - } - if (input.TokenKey !== undefined) { - bodyParams["TokenKey"] = input.TokenKey; - } - if (input.TokenKeyId !== undefined) { - bodyParams["TokenKeyId"] = input.TokenKeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1APNSVoipChannelRequest = ( input: APNSVoipChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.DefaultAuthenticationMethod !== undefined) { - bodyParams["DefaultAuthenticationMethod"] = - input.DefaultAuthenticationMethod; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.PrivateKey !== undefined) { - bodyParams["PrivateKey"] = input.PrivateKey; - } - if (input.TeamId !== undefined) { - bodyParams["TeamId"] = input.TeamId; - } - if (input.TokenKey !== undefined) { - bodyParams["TokenKey"] = input.TokenKey; - } - if (input.TokenKeyId !== undefined) { - bodyParams["TokenKeyId"] = input.TokenKeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1APNSVoipSandboxChannelRequest = ( input: APNSVoipSandboxChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.Certificate !== undefined) { - bodyParams["Certificate"] = input.Certificate; - } - if (input.DefaultAuthenticationMethod !== undefined) { - bodyParams["DefaultAuthenticationMethod"] = - input.DefaultAuthenticationMethod; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.PrivateKey !== undefined) { - bodyParams["PrivateKey"] = input.PrivateKey; - } - if (input.TeamId !== undefined) { - bodyParams["TeamId"] = input.TeamId; - } - if (input.TokenKey !== undefined) { - bodyParams["TokenKey"] = input.TokenKey; - } - if (input.TokenKeyId !== undefined) { - bodyParams["TokenKeyId"] = input.TokenKeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Activity = ( input: Activity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionalSplit !== undefined) { - bodyParams[ - "ConditionalSplit" - ] = serializeAws_restJson1_1ConditionalSplitActivity( - input.ConditionalSplit, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.EMAIL !== undefined) { - bodyParams["EMAIL"] = serializeAws_restJson1_1EmailMessageActivity( - input.EMAIL, - context - ); - } - if (input.Holdout !== undefined) { - bodyParams["Holdout"] = serializeAws_restJson1_1HoldoutActivity( - input.Holdout, - context - ); - } - if (input.MultiCondition !== undefined) { - bodyParams[ - "MultiCondition" - ] = serializeAws_restJson1_1MultiConditionalSplitActivity( - input.MultiCondition, - context - ); - } - if (input.RandomSplit !== undefined) { - bodyParams["RandomSplit"] = serializeAws_restJson1_1RandomSplitActivity( - input.RandomSplit, - context - ); - } - if (input.Wait !== undefined) { - bodyParams["Wait"] = serializeAws_restJson1_1WaitActivity( - input.Wait, - context - ); - } - return bodyParams; + return { + ...(input.ConditionalSplit !== undefined && { + ConditionalSplit: serializeAws_restJson1_1ConditionalSplitActivity( + input.ConditionalSplit, + context + ) + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.EMAIL !== undefined && { + EMAIL: serializeAws_restJson1_1EmailMessageActivity(input.EMAIL, context) + }), + ...(input.Holdout !== undefined && { + Holdout: serializeAws_restJson1_1HoldoutActivity(input.Holdout, context) + }), + ...(input.MultiCondition !== undefined && { + MultiCondition: serializeAws_restJson1_1MultiConditionalSplitActivity( + input.MultiCondition, + context + ) + }), + ...(input.RandomSplit !== undefined && { + RandomSplit: serializeAws_restJson1_1RandomSplitActivity( + input.RandomSplit, + context + ) + }), + ...(input.Wait !== undefined && { + Wait: serializeAws_restJson1_1WaitActivity(input.Wait, context) + }) + }; }; const serializeAws_restJson1_1AddressConfiguration = ( input: AddressConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BodyOverride !== undefined) { - bodyParams["BodyOverride"] = input.BodyOverride; - } - if (input.ChannelType !== undefined) { - bodyParams["ChannelType"] = input.ChannelType; - } - if (input.Context !== undefined) { - bodyParams["Context"] = serializeAws_restJson1_1MapOf__string( - input.Context, - context - ); - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.TitleOverride !== undefined) { - bodyParams["TitleOverride"] = input.TitleOverride; - } - return bodyParams; + return { + ...(input.BodyOverride !== undefined && { + BodyOverride: input.BodyOverride + }), + ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), + ...(input.Context !== undefined && { + Context: serializeAws_restJson1_1MapOf__string(input.Context, context) + }), + ...(input.RawContent !== undefined && { RawContent: input.RawContent }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.TitleOverride !== undefined && { + TitleOverride: input.TitleOverride + }) + }; }; const serializeAws_restJson1_1AndroidPushNotificationTemplate = ( input: AndroidPushNotificationTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.ImageIconUrl !== undefined) { - bodyParams["ImageIconUrl"] = input.ImageIconUrl; - } - if (input.ImageUrl !== undefined) { - bodyParams["ImageUrl"] = input.ImageUrl; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.SmallImageIconUrl !== undefined) { - bodyParams["SmallImageIconUrl"] = input.SmallImageIconUrl; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1AttributeDimension = ( input: AttributeDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeType !== undefined) { - bodyParams["AttributeType"] = input.AttributeType; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1ListOf__string( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.AttributeType !== undefined && { + AttributeType: input.AttributeType + }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1ListOf__string(input.Values, context) + }) + }; }; const serializeAws_restJson1_1BaiduChannelRequest = ( input: BaiduChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApiKey !== undefined) { - bodyParams["ApiKey"] = input.ApiKey; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.SecretKey !== undefined) { - bodyParams["SecretKey"] = input.SecretKey; - } - return bodyParams; + return { + ...(input.ApiKey !== undefined && { ApiKey: input.ApiKey }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.SecretKey !== undefined && { SecretKey: input.SecretKey }) + }; }; const serializeAws_restJson1_1BaiduMessage = ( input: BaiduMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.Data !== undefined) { - bodyParams["Data"] = serializeAws_restJson1_1MapOf__string( - input.Data, - context - ); - } - if (input.IconReference !== undefined) { - bodyParams["IconReference"] = input.IconReference; - } - if (input.ImageIconUrl !== undefined) { - bodyParams["ImageIconUrl"] = input.ImageIconUrl; - } - if (input.ImageUrl !== undefined) { - bodyParams["ImageUrl"] = input.ImageUrl; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.SilentPush !== undefined) { - bodyParams["SilentPush"] = input.SilentPush; - } - if (input.SmallImageIconUrl !== undefined) { - bodyParams["SmallImageIconUrl"] = input.SmallImageIconUrl; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.TimeToLive !== undefined) { - bodyParams["TimeToLive"] = input.TimeToLive; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.Data !== undefined && { + Data: serializeAws_restJson1_1MapOf__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_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), + ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Url !== undefined && { Url: input.Url }) + }; }; const serializeAws_restJson1_1CampaignEmailMessage = ( input: CampaignEmailMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.FromAddress !== undefined) { - bodyParams["FromAddress"] = input.FromAddress; - } - if (input.HtmlBody !== undefined) { - bodyParams["HtmlBody"] = input.HtmlBody; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CampaignEventFilter = ( input: CampaignEventFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_restJson1_1EventDimensions( - input.Dimensions, - context - ); - } - if (input.FilterType !== undefined) { - bodyParams["FilterType"] = input.FilterType; - } - return bodyParams; + return { + ...(input.Dimensions !== undefined && { + Dimensions: serializeAws_restJson1_1EventDimensions( + input.Dimensions, + context + ) + }), + ...(input.FilterType !== undefined && { FilterType: input.FilterType }) + }; }; const serializeAws_restJson1_1CampaignHook = ( input: CampaignHook, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LambdaFunctionName !== undefined) { - bodyParams["LambdaFunctionName"] = input.LambdaFunctionName; - } - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - if (input.WebUrl !== undefined) { - bodyParams["WebUrl"] = input.WebUrl; - } - return bodyParams; + return { + ...(input.LambdaFunctionName !== undefined && { + LambdaFunctionName: input.LambdaFunctionName + }), + ...(input.Mode !== undefined && { Mode: input.Mode }), + ...(input.WebUrl !== undefined && { WebUrl: input.WebUrl }) + }; }; const serializeAws_restJson1_1CampaignLimits = ( input: CampaignLimits, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Daily !== undefined) { - bodyParams["Daily"] = input.Daily; - } - if (input.MaximumDuration !== undefined) { - bodyParams["MaximumDuration"] = input.MaximumDuration; - } - if (input.MessagesPerSecond !== undefined) { - bodyParams["MessagesPerSecond"] = input.MessagesPerSecond; - } - if (input.Total !== undefined) { - bodyParams["Total"] = input.Total; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1CampaignSmsMessage = ( input: CampaignSmsMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.MessageType !== undefined) { - bodyParams["MessageType"] = input.MessageType; - } - if (input.SenderId !== undefined) { - bodyParams["SenderId"] = input.SenderId; - } - return bodyParams; + return { + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.MessageType !== undefined && { MessageType: input.MessageType }), + ...(input.SenderId !== undefined && { SenderId: input.SenderId }) + }; }; const serializeAws_restJson1_1Condition = ( input: Condition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Conditions !== undefined) { - bodyParams["Conditions"] = serializeAws_restJson1_1ListOfSimpleCondition( - input.Conditions, - context - ); - } - if (input.Operator !== undefined) { - bodyParams["Operator"] = input.Operator; - } - return bodyParams; + return { + ...(input.Conditions !== undefined && { + Conditions: serializeAws_restJson1_1ListOfSimpleCondition( + input.Conditions, + context + ) + }), + ...(input.Operator !== undefined && { Operator: input.Operator }) + }; }; const serializeAws_restJson1_1ConditionalSplitActivity = ( input: ConditionalSplitActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = serializeAws_restJson1_1Condition( - input.Condition, - context - ); - } - if (input.EvaluationWaitTime !== undefined) { - bodyParams["EvaluationWaitTime"] = serializeAws_restJson1_1WaitTime( - input.EvaluationWaitTime, - context - ); - } - if (input.FalseActivity !== undefined) { - bodyParams["FalseActivity"] = input.FalseActivity; - } - if (input.TrueActivity !== undefined) { - bodyParams["TrueActivity"] = input.TrueActivity; - } - return bodyParams; + return { + ...(input.Condition !== undefined && { + Condition: serializeAws_restJson1_1Condition(input.Condition, context) + }), + ...(input.EvaluationWaitTime !== undefined && { + EvaluationWaitTime: serializeAws_restJson1_1WaitTime( + input.EvaluationWaitTime, + context + ) + }), + ...(input.FalseActivity !== undefined && { + FalseActivity: input.FalseActivity + }), + ...(input.TrueActivity !== undefined && { + TrueActivity: input.TrueActivity + }) + }; }; const serializeAws_restJson1_1CreateApplicationRequest = ( input: CreateApplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1DefaultMessage = ( input: DefaultMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - return bodyParams; + return { + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }) + }; }; const serializeAws_restJson1_1DefaultPushNotificationMessage = ( input: DefaultPushNotificationMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.Data !== undefined) { - bodyParams["Data"] = serializeAws_restJson1_1MapOf__string( - input.Data, - context - ); - } - if (input.SilentPush !== undefined) { - bodyParams["SilentPush"] = input.SilentPush; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.Data !== undefined && { + Data: serializeAws_restJson1_1MapOf__string(input.Data, context) + }), + ...(input.SilentPush !== undefined && { SilentPush: input.SilentPush }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Url !== undefined && { Url: input.Url }) + }; }; const serializeAws_restJson1_1DefaultPushNotificationTemplate = ( input: DefaultPushNotificationTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DirectMessageConfiguration = ( input: DirectMessageConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ADMMessage !== undefined) { - bodyParams["ADMMessage"] = serializeAws_restJson1_1ADMMessage( - input.ADMMessage, - context - ); - } - if (input.APNSMessage !== undefined) { - bodyParams["APNSMessage"] = serializeAws_restJson1_1APNSMessage( - input.APNSMessage, - context - ); - } - if (input.BaiduMessage !== undefined) { - bodyParams["BaiduMessage"] = serializeAws_restJson1_1BaiduMessage( - input.BaiduMessage, - context - ); - } - if (input.DefaultMessage !== undefined) { - bodyParams["DefaultMessage"] = serializeAws_restJson1_1DefaultMessage( - input.DefaultMessage, - context - ); - } - if (input.DefaultPushNotificationMessage !== undefined) { - bodyParams[ - "DefaultPushNotificationMessage" - ] = serializeAws_restJson1_1DefaultPushNotificationMessage( - input.DefaultPushNotificationMessage, - context - ); - } - if (input.EmailMessage !== undefined) { - bodyParams["EmailMessage"] = serializeAws_restJson1_1EmailMessage( - input.EmailMessage, - context - ); - } - if (input.GCMMessage !== undefined) { - bodyParams["GCMMessage"] = serializeAws_restJson1_1GCMMessage( - input.GCMMessage, - context - ); - } - if (input.SMSMessage !== undefined) { - bodyParams["SMSMessage"] = serializeAws_restJson1_1SMSMessage( - input.SMSMessage, - context - ); - } - if (input.VoiceMessage !== undefined) { - bodyParams["VoiceMessage"] = serializeAws_restJson1_1VoiceMessage( - input.VoiceMessage, - context - ); - } - return bodyParams; + return { + ...(input.ADMMessage !== undefined && { + ADMMessage: serializeAws_restJson1_1ADMMessage(input.ADMMessage, context) + }), + ...(input.APNSMessage !== undefined && { + APNSMessage: serializeAws_restJson1_1APNSMessage( + input.APNSMessage, + context + ) + }), + ...(input.BaiduMessage !== undefined && { + BaiduMessage: serializeAws_restJson1_1BaiduMessage( + input.BaiduMessage, + context + ) + }), + ...(input.DefaultMessage !== undefined && { + DefaultMessage: serializeAws_restJson1_1DefaultMessage( + input.DefaultMessage, + context + ) + }), + ...(input.DefaultPushNotificationMessage !== undefined && { + DefaultPushNotificationMessage: serializeAws_restJson1_1DefaultPushNotificationMessage( + input.DefaultPushNotificationMessage, + context + ) + }), + ...(input.EmailMessage !== undefined && { + EmailMessage: serializeAws_restJson1_1EmailMessage( + input.EmailMessage, + context + ) + }), + ...(input.GCMMessage !== undefined && { + GCMMessage: serializeAws_restJson1_1GCMMessage(input.GCMMessage, context) + }), + ...(input.SMSMessage !== undefined && { + SMSMessage: serializeAws_restJson1_1SMSMessage(input.SMSMessage, context) + }), + ...(input.VoiceMessage !== undefined && { + VoiceMessage: serializeAws_restJson1_1VoiceMessage( + input.VoiceMessage, + context + ) + }) + }; }; const serializeAws_restJson1_1EmailChannelRequest = ( input: EmailChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConfigurationSet !== undefined) { - bodyParams["ConfigurationSet"] = input.ConfigurationSet; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.FromAddress !== undefined) { - bodyParams["FromAddress"] = input.FromAddress; - } - if (input.Identity !== undefined) { - bodyParams["Identity"] = input.Identity; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1EmailMessage = ( input: EmailMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.FeedbackForwardingAddress !== undefined) { - bodyParams["FeedbackForwardingAddress"] = input.FeedbackForwardingAddress; - } - if (input.FromAddress !== undefined) { - bodyParams["FromAddress"] = input.FromAddress; - } - if (input.RawEmail !== undefined) { - bodyParams["RawEmail"] = serializeAws_restJson1_1RawEmail( - input.RawEmail, - context - ); - } - if (input.ReplyToAddresses !== undefined) { - bodyParams["ReplyToAddresses"] = serializeAws_restJson1_1ListOf__string( - input.ReplyToAddresses, - context - ); - } - if (input.SimpleEmail !== undefined) { - bodyParams["SimpleEmail"] = serializeAws_restJson1_1SimpleEmail( - input.SimpleEmail, - context - ); - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - return bodyParams; + return { + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.FeedbackForwardingAddress !== undefined && { + FeedbackForwardingAddress: input.FeedbackForwardingAddress + }), + ...(input.FromAddress !== undefined && { FromAddress: input.FromAddress }), + ...(input.RawEmail !== undefined && { + RawEmail: serializeAws_restJson1_1RawEmail(input.RawEmail, context) + }), + ...(input.ReplyToAddresses !== undefined && { + ReplyToAddresses: serializeAws_restJson1_1ListOf__string( + input.ReplyToAddresses, + context + ) + }), + ...(input.SimpleEmail !== undefined && { + SimpleEmail: serializeAws_restJson1_1SimpleEmail( + input.SimpleEmail, + context + ) + }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }) + }; }; const serializeAws_restJson1_1EmailMessageActivity = ( input: EmailMessageActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageConfig !== undefined) { - bodyParams["MessageConfig"] = serializeAws_restJson1_1JourneyEmailMessage( - input.MessageConfig, - context - ); - } - if (input.NextActivity !== undefined) { - bodyParams["NextActivity"] = input.NextActivity; - } - if (input.TemplateName !== undefined) { - bodyParams["TemplateName"] = input.TemplateName; - } - if (input.TemplateVersion !== undefined) { - bodyParams["TemplateVersion"] = input.TemplateVersion; - } - return bodyParams; + return { + ...(input.MessageConfig !== undefined && { + MessageConfig: serializeAws_restJson1_1JourneyEmailMessage( + input.MessageConfig, + context + ) + }), + ...(input.NextActivity !== undefined && { + NextActivity: input.NextActivity + }), + ...(input.TemplateName !== undefined && { + TemplateName: input.TemplateName + }), + ...(input.TemplateVersion !== undefined && { + TemplateVersion: input.TemplateVersion + }) + }; }; const serializeAws_restJson1_1EmailTemplateRequest = ( input: EmailTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultSubstitutions !== undefined) { - bodyParams["DefaultSubstitutions"] = input.DefaultSubstitutions; - } - if (input.HtmlPart !== undefined) { - bodyParams["HtmlPart"] = input.HtmlPart; - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = input.Subject; - } - if (input.TemplateDescription !== undefined) { - bodyParams["TemplateDescription"] = input.TemplateDescription; - } - if (input.TextPart !== undefined) { - bodyParams["TextPart"] = input.TextPart; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.DefaultSubstitutions !== undefined && { + DefaultSubstitutions: input.DefaultSubstitutions + }), + ...(input.HtmlPart !== undefined && { HtmlPart: input.HtmlPart }), + ...(input.Subject !== undefined && { Subject: input.Subject }), + ...(input.TemplateDescription !== undefined && { + TemplateDescription: input.TemplateDescription + }), + ...(input.TextPart !== undefined && { TextPart: input.TextPart }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1EndpointBatchItem = ( input: EndpointBatchItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1MapOfListOf__string( - input.Attributes, - context - ); - } - if (input.ChannelType !== undefined) { - bodyParams["ChannelType"] = input.ChannelType; - } - if (input.Demographic !== undefined) { - bodyParams["Demographic"] = serializeAws_restJson1_1EndpointDemographic( - input.Demographic, - context - ); - } - if (input.EffectiveDate !== undefined) { - bodyParams["EffectiveDate"] = input.EffectiveDate; - } - if (input.EndpointStatus !== undefined) { - bodyParams["EndpointStatus"] = input.EndpointStatus; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Location !== undefined) { - bodyParams["Location"] = serializeAws_restJson1_1EndpointLocation( - input.Location, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_restJson1_1MapOf__double( - input.Metrics, - context - ); - } - if (input.OptOut !== undefined) { - bodyParams["OptOut"] = input.OptOut; - } - if (input.RequestId !== undefined) { - bodyParams["RequestId"] = input.RequestId; - } - if (input.User !== undefined) { - bodyParams["User"] = serializeAws_restJson1_1EndpointUser( - input.User, - context - ); - } - return bodyParams; + return { + ...(input.Address !== undefined && { Address: input.Address }), + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1MapOfListOf__string( + input.Attributes, + context + ) + }), + ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), + ...(input.Demographic !== undefined && { + Demographic: serializeAws_restJson1_1EndpointDemographic( + 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_restJson1_1EndpointLocation( + input.Location, + context + ) + }), + ...(input.Metrics !== undefined && { + Metrics: serializeAws_restJson1_1MapOf__double(input.Metrics, context) + }), + ...(input.OptOut !== undefined && { OptOut: input.OptOut }), + ...(input.RequestId !== undefined && { RequestId: input.RequestId }), + ...(input.User !== undefined && { + User: serializeAws_restJson1_1EndpointUser(input.User, context) + }) + }; }; const serializeAws_restJson1_1EndpointBatchRequest = ( input: EndpointBatchRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Item !== undefined) { - bodyParams["Item"] = serializeAws_restJson1_1ListOfEndpointBatchItem( - input.Item, - context - ); - } - return bodyParams; + return { + ...(input.Item !== undefined && { + Item: serializeAws_restJson1_1ListOfEndpointBatchItem(input.Item, context) + }) + }; }; const serializeAws_restJson1_1EndpointDemographic = ( input: EndpointDemographic, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppVersion !== undefined) { - bodyParams["AppVersion"] = input.AppVersion; - } - if (input.Locale !== undefined) { - bodyParams["Locale"] = input.Locale; - } - if (input.Make !== undefined) { - bodyParams["Make"] = input.Make; - } - if (input.Model !== undefined) { - bodyParams["Model"] = input.Model; - } - if (input.ModelVersion !== undefined) { - bodyParams["ModelVersion"] = input.ModelVersion; - } - if (input.Platform !== undefined) { - bodyParams["Platform"] = input.Platform; - } - if (input.PlatformVersion !== undefined) { - bodyParams["PlatformVersion"] = input.PlatformVersion; - } - if (input.Timezone !== undefined) { - bodyParams["Timezone"] = input.Timezone; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1EndpointLocation = ( input: EndpointLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.City !== undefined) { - bodyParams["City"] = input.City; - } - if (input.Country !== undefined) { - bodyParams["Country"] = input.Country; - } - if (input.Latitude !== undefined) { - bodyParams["Latitude"] = input.Latitude; - } - if (input.Longitude !== undefined) { - bodyParams["Longitude"] = input.Longitude; - } - if (input.PostalCode !== undefined) { - bodyParams["PostalCode"] = input.PostalCode; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1EndpointRequest = ( input: EndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1MapOfListOf__string( - input.Attributes, - context - ); - } - if (input.ChannelType !== undefined) { - bodyParams["ChannelType"] = input.ChannelType; - } - if (input.Demographic !== undefined) { - bodyParams["Demographic"] = serializeAws_restJson1_1EndpointDemographic( - input.Demographic, - context - ); - } - if (input.EffectiveDate !== undefined) { - bodyParams["EffectiveDate"] = input.EffectiveDate; - } - if (input.EndpointStatus !== undefined) { - bodyParams["EndpointStatus"] = input.EndpointStatus; - } - if (input.Location !== undefined) { - bodyParams["Location"] = serializeAws_restJson1_1EndpointLocation( - input.Location, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_restJson1_1MapOf__double( - input.Metrics, - context - ); - } - if (input.OptOut !== undefined) { - bodyParams["OptOut"] = input.OptOut; - } - if (input.RequestId !== undefined) { - bodyParams["RequestId"] = input.RequestId; - } - if (input.User !== undefined) { - bodyParams["User"] = serializeAws_restJson1_1EndpointUser( - input.User, - context - ); - } - return bodyParams; + return { + ...(input.Address !== undefined && { Address: input.Address }), + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1MapOfListOf__string( + input.Attributes, + context + ) + }), + ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), + ...(input.Demographic !== undefined && { + Demographic: serializeAws_restJson1_1EndpointDemographic( + input.Demographic, + context + ) + }), + ...(input.EffectiveDate !== undefined && { + EffectiveDate: input.EffectiveDate + }), + ...(input.EndpointStatus !== undefined && { + EndpointStatus: input.EndpointStatus + }), + ...(input.Location !== undefined && { + Location: serializeAws_restJson1_1EndpointLocation( + input.Location, + context + ) + }), + ...(input.Metrics !== undefined && { + Metrics: serializeAws_restJson1_1MapOf__double(input.Metrics, context) + }), + ...(input.OptOut !== undefined && { OptOut: input.OptOut }), + ...(input.RequestId !== undefined && { RequestId: input.RequestId }), + ...(input.User !== undefined && { + User: serializeAws_restJson1_1EndpointUser(input.User, context) + }) + }; }; const serializeAws_restJson1_1EndpointSendConfiguration = ( input: EndpointSendConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BodyOverride !== undefined) { - bodyParams["BodyOverride"] = input.BodyOverride; - } - if (input.Context !== undefined) { - bodyParams["Context"] = serializeAws_restJson1_1MapOf__string( - input.Context, - context - ); - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.TitleOverride !== undefined) { - bodyParams["TitleOverride"] = input.TitleOverride; - } - return bodyParams; + return { + ...(input.BodyOverride !== undefined && { + BodyOverride: input.BodyOverride + }), + ...(input.Context !== undefined && { + Context: serializeAws_restJson1_1MapOf__string(input.Context, context) + }), + ...(input.RawContent !== undefined && { RawContent: input.RawContent }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.TitleOverride !== undefined && { + TitleOverride: input.TitleOverride + }) + }; }; const serializeAws_restJson1_1EndpointUser = ( input: EndpointUser, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UserAttributes !== undefined) { - bodyParams["UserAttributes"] = serializeAws_restJson1_1MapOfListOf__string( - input.UserAttributes, - context - ); - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.UserAttributes !== undefined && { + UserAttributes: serializeAws_restJson1_1MapOfListOf__string( + input.UserAttributes, + context + ) + }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_restJson1_1Event = ( input: Event, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppPackageName !== undefined) { - bodyParams["AppPackageName"] = input.AppPackageName; - } - if (input.AppTitle !== undefined) { - bodyParams["AppTitle"] = input.AppTitle; - } - if (input.AppVersionCode !== undefined) { - bodyParams["AppVersionCode"] = input.AppVersionCode; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1MapOf__string( - input.Attributes, - context - ); - } - if (input.ClientSdkVersion !== undefined) { - bodyParams["ClientSdkVersion"] = input.ClientSdkVersion; - } - if (input.EventType !== undefined) { - bodyParams["EventType"] = input.EventType; - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_restJson1_1MapOf__double( - input.Metrics, - context - ); - } - if (input.SdkName !== undefined) { - bodyParams["SdkName"] = input.SdkName; - } - if (input.Session !== undefined) { - bodyParams["Session"] = serializeAws_restJson1_1Session( - input.Session, - context - ); - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = input.Timestamp; - } - return bodyParams; + return { + ...(input.AppPackageName !== undefined && { + AppPackageName: input.AppPackageName + }), + ...(input.AppTitle !== undefined && { AppTitle: input.AppTitle }), + ...(input.AppVersionCode !== undefined && { + AppVersionCode: input.AppVersionCode + }), + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1MapOf__string( + input.Attributes, + context + ) + }), + ...(input.ClientSdkVersion !== undefined && { + ClientSdkVersion: input.ClientSdkVersion + }), + ...(input.EventType !== undefined && { EventType: input.EventType }), + ...(input.Metrics !== undefined && { + Metrics: serializeAws_restJson1_1MapOf__double(input.Metrics, context) + }), + ...(input.SdkName !== undefined && { SdkName: input.SdkName }), + ...(input.Session !== undefined && { + Session: serializeAws_restJson1_1Session(input.Session, context) + }), + ...(input.Timestamp !== undefined && { Timestamp: input.Timestamp }) + }; }; const serializeAws_restJson1_1EventCondition = ( input: EventCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_restJson1_1EventDimensions( - input.Dimensions, - context - ); - } - if (input.MessageActivity !== undefined) { - bodyParams["MessageActivity"] = input.MessageActivity; - } - return bodyParams; + return { + ...(input.Dimensions !== undefined && { + Dimensions: serializeAws_restJson1_1EventDimensions( + input.Dimensions, + context + ) + }), + ...(input.MessageActivity !== undefined && { + MessageActivity: input.MessageActivity + }) + }; }; const serializeAws_restJson1_1EventDimensions = ( input: EventDimensions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1MapOfAttributeDimension( - input.Attributes, - context - ); - } - if (input.EventType !== undefined) { - bodyParams["EventType"] = serializeAws_restJson1_1SetDimension( - input.EventType, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_restJson1_1MapOfMetricDimension( - input.Metrics, - context - ); - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1MapOfAttributeDimension( + input.Attributes, + context + ) + }), + ...(input.EventType !== undefined && { + EventType: serializeAws_restJson1_1SetDimension(input.EventType, context) + }), + ...(input.Metrics !== undefined && { + Metrics: serializeAws_restJson1_1MapOfMetricDimension( + input.Metrics, + context + ) + }) + }; }; const serializeAws_restJson1_1EventsBatch = ( input: EventsBatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Endpoint !== undefined) { - bodyParams["Endpoint"] = serializeAws_restJson1_1PublicEndpoint( - input.Endpoint, - context - ); - } - if (input.Events !== undefined) { - bodyParams["Events"] = serializeAws_restJson1_1MapOfEvent( - input.Events, - context - ); - } - return bodyParams; + return { + ...(input.Endpoint !== undefined && { + Endpoint: serializeAws_restJson1_1PublicEndpoint(input.Endpoint, context) + }), + ...(input.Events !== undefined && { + Events: serializeAws_restJson1_1MapOfEvent(input.Events, context) + }) + }; }; const serializeAws_restJson1_1EventsRequest = ( input: EventsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchItem !== undefined) { - bodyParams["BatchItem"] = serializeAws_restJson1_1MapOfEventsBatch( - input.BatchItem, - context - ); - } - return bodyParams; + return { + ...(input.BatchItem !== undefined && { + BatchItem: serializeAws_restJson1_1MapOfEventsBatch( + input.BatchItem, + context + ) + }) + }; }; const serializeAws_restJson1_1ExportJobRequest = ( input: ExportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.S3UrlPrefix !== undefined) { - bodyParams["S3UrlPrefix"] = input.S3UrlPrefix; - } - if (input.SegmentId !== undefined) { - bodyParams["SegmentId"] = input.SegmentId; - } - if (input.SegmentVersion !== undefined) { - bodyParams["SegmentVersion"] = input.SegmentVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1GCMChannelRequest = ( input: GCMChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApiKey !== undefined) { - bodyParams["ApiKey"] = input.ApiKey; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.ApiKey !== undefined && { ApiKey: input.ApiKey }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_restJson1_1GCMMessage = ( input: GCMMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.CollapseKey !== undefined) { - bodyParams["CollapseKey"] = input.CollapseKey; - } - if (input.Data !== undefined) { - bodyParams["Data"] = serializeAws_restJson1_1MapOf__string( - input.Data, - context - ); - } - if (input.IconReference !== undefined) { - bodyParams["IconReference"] = input.IconReference; - } - if (input.ImageIconUrl !== undefined) { - bodyParams["ImageIconUrl"] = input.ImageIconUrl; - } - if (input.ImageUrl !== undefined) { - bodyParams["ImageUrl"] = input.ImageUrl; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.RestrictedPackageName !== undefined) { - bodyParams["RestrictedPackageName"] = input.RestrictedPackageName; - } - if (input.SilentPush !== undefined) { - bodyParams["SilentPush"] = input.SilentPush; - } - if (input.SmallImageIconUrl !== undefined) { - bodyParams["SmallImageIconUrl"] = input.SmallImageIconUrl; - } - if (input.Sound !== undefined) { - bodyParams["Sound"] = input.Sound; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.TimeToLive !== undefined) { - bodyParams["TimeToLive"] = input.TimeToLive; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.CollapseKey !== undefined && { CollapseKey: input.CollapseKey }), + ...(input.Data !== undefined && { + Data: serializeAws_restJson1_1MapOf__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_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.TimeToLive !== undefined && { TimeToLive: input.TimeToLive }), + ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Url !== undefined && { Url: input.Url }) + }; }; const serializeAws_restJson1_1GPSCoordinates = ( input: GPSCoordinates, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Latitude !== undefined) { - bodyParams["Latitude"] = input.Latitude; - } - if (input.Longitude !== undefined) { - bodyParams["Longitude"] = input.Longitude; - } - return bodyParams; + return { + ...(input.Latitude !== undefined && { Latitude: input.Latitude }), + ...(input.Longitude !== undefined && { Longitude: input.Longitude }) + }; }; const serializeAws_restJson1_1GPSPointDimension = ( input: GPSPointDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Coordinates !== undefined) { - bodyParams["Coordinates"] = serializeAws_restJson1_1GPSCoordinates( - input.Coordinates, - context - ); - } - if (input.RangeInKilometers !== undefined) { - bodyParams["RangeInKilometers"] = input.RangeInKilometers; - } - return bodyParams; + return { + ...(input.Coordinates !== undefined && { + Coordinates: serializeAws_restJson1_1GPSCoordinates( + input.Coordinates, + context + ) + }), + ...(input.RangeInKilometers !== undefined && { + RangeInKilometers: input.RangeInKilometers + }) + }; }; const serializeAws_restJson1_1HoldoutActivity = ( input: HoldoutActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextActivity !== undefined) { - bodyParams["NextActivity"] = input.NextActivity; - } - if (input.Percentage !== undefined) { - bodyParams["Percentage"] = input.Percentage; - } - return bodyParams; + return { + ...(input.NextActivity !== undefined && { + NextActivity: input.NextActivity + }), + ...(input.Percentage !== undefined && { Percentage: input.Percentage }) + }; }; const serializeAws_restJson1_1ImportJobRequest = ( input: ImportJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefineSegment !== undefined) { - bodyParams["DefineSegment"] = input.DefineSegment; - } - if (input.ExternalId !== undefined) { - bodyParams["ExternalId"] = input.ExternalId; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.RegisterEndpoints !== undefined) { - bodyParams["RegisterEndpoints"] = input.RegisterEndpoints; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.S3Url !== undefined) { - bodyParams["S3Url"] = input.S3Url; - } - if (input.SegmentId !== undefined) { - bodyParams["SegmentId"] = input.SegmentId; - } - if (input.SegmentName !== undefined) { - bodyParams["SegmentName"] = input.SegmentName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1JourneyEmailMessage = ( input: JourneyEmailMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FromAddress !== undefined) { - bodyParams["FromAddress"] = input.FromAddress; - } - return bodyParams; + return { + ...(input.FromAddress !== undefined && { FromAddress: input.FromAddress }) + }; }; const serializeAws_restJson1_1JourneyLimits = ( input: JourneyLimits, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DailyCap !== undefined) { - bodyParams["DailyCap"] = input.DailyCap; - } - if (input.EndpointReentryCap !== undefined) { - bodyParams["EndpointReentryCap"] = input.EndpointReentryCap; - } - if (input.MessagesPerSecond !== undefined) { - bodyParams["MessagesPerSecond"] = input.MessagesPerSecond; - } - return bodyParams; + return { + ...(input.DailyCap !== undefined && { DailyCap: input.DailyCap }), + ...(input.EndpointReentryCap !== undefined && { + EndpointReentryCap: input.EndpointReentryCap + }), + ...(input.MessagesPerSecond !== undefined && { + MessagesPerSecond: input.MessagesPerSecond + }) + }; }; const serializeAws_restJson1_1JourneySchedule = ( input: JourneySchedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = input.EndTime.toISOString().split(".")[0] + "Z"; - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = input.StartTime.toISOString().split(".")[0] + "Z"; - } - if (input.Timezone !== undefined) { - bodyParams["Timezone"] = input.Timezone; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1JourneyStateRequest = ( input: JourneyStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - return bodyParams; + return { + ...(input.State !== undefined && { State: input.State }) + }; }; const serializeAws_restJson1_1ListOfEndpointBatchItem = ( @@ -19388,1281 +18949,997 @@ const serializeAws_restJson1_1Message = ( input: Message, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.ImageIconUrl !== undefined) { - bodyParams["ImageIconUrl"] = input.ImageIconUrl; - } - if (input.ImageSmallIconUrl !== undefined) { - bodyParams["ImageSmallIconUrl"] = input.ImageSmallIconUrl; - } - if (input.ImageUrl !== undefined) { - bodyParams["ImageUrl"] = input.ImageUrl; - } - if (input.JsonBody !== undefined) { - bodyParams["JsonBody"] = input.JsonBody; - } - if (input.MediaUrl !== undefined) { - bodyParams["MediaUrl"] = input.MediaUrl; - } - if (input.RawContent !== undefined) { - bodyParams["RawContent"] = input.RawContent; - } - if (input.SilentPush !== undefined) { - bodyParams["SilentPush"] = input.SilentPush; - } - if (input.TimeToLive !== undefined) { - bodyParams["TimeToLive"] = input.TimeToLive; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1MessageConfiguration = ( input: MessageConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ADMMessage !== undefined) { - bodyParams["ADMMessage"] = serializeAws_restJson1_1Message( - input.ADMMessage, - context - ); - } - if (input.APNSMessage !== undefined) { - bodyParams["APNSMessage"] = serializeAws_restJson1_1Message( - input.APNSMessage, - context - ); - } - if (input.BaiduMessage !== undefined) { - bodyParams["BaiduMessage"] = serializeAws_restJson1_1Message( - input.BaiduMessage, - context - ); - } - if (input.DefaultMessage !== undefined) { - bodyParams["DefaultMessage"] = serializeAws_restJson1_1Message( - input.DefaultMessage, - context - ); - } - if (input.EmailMessage !== undefined) { - bodyParams["EmailMessage"] = serializeAws_restJson1_1CampaignEmailMessage( - input.EmailMessage, - context - ); - } - if (input.GCMMessage !== undefined) { - bodyParams["GCMMessage"] = serializeAws_restJson1_1Message( - input.GCMMessage, - context - ); - } - if (input.SMSMessage !== undefined) { - bodyParams["SMSMessage"] = serializeAws_restJson1_1CampaignSmsMessage( - input.SMSMessage, - context - ); - } - return bodyParams; + return { + ...(input.ADMMessage !== undefined && { + ADMMessage: serializeAws_restJson1_1Message(input.ADMMessage, context) + }), + ...(input.APNSMessage !== undefined && { + APNSMessage: serializeAws_restJson1_1Message(input.APNSMessage, context) + }), + ...(input.BaiduMessage !== undefined && { + BaiduMessage: serializeAws_restJson1_1Message(input.BaiduMessage, context) + }), + ...(input.DefaultMessage !== undefined && { + DefaultMessage: serializeAws_restJson1_1Message( + input.DefaultMessage, + context + ) + }), + ...(input.EmailMessage !== undefined && { + EmailMessage: serializeAws_restJson1_1CampaignEmailMessage( + input.EmailMessage, + context + ) + }), + ...(input.GCMMessage !== undefined && { + GCMMessage: serializeAws_restJson1_1Message(input.GCMMessage, context) + }), + ...(input.SMSMessage !== undefined && { + SMSMessage: serializeAws_restJson1_1CampaignSmsMessage( + input.SMSMessage, + context + ) + }) + }; }; const serializeAws_restJson1_1MessageRequest = ( - input: MessageRequest, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Addresses !== undefined) { - bodyParams["Addresses"] = serializeAws_restJson1_1MapOfAddressConfiguration( - input.Addresses, - context - ); - } - if (input.Context !== undefined) { - bodyParams["Context"] = serializeAws_restJson1_1MapOf__string( - input.Context, - context - ); - } - if (input.Endpoints !== undefined) { - bodyParams[ - "Endpoints" - ] = serializeAws_restJson1_1MapOfEndpointSendConfiguration( - input.Endpoints, - context - ); - } - if (input.MessageConfiguration !== undefined) { - bodyParams[ - "MessageConfiguration" - ] = serializeAws_restJson1_1DirectMessageConfiguration( - input.MessageConfiguration, - context - ); - } - if (input.TemplateConfiguration !== undefined) { - bodyParams[ - "TemplateConfiguration" - ] = serializeAws_restJson1_1TemplateConfiguration( - input.TemplateConfiguration, - context - ); - } - if (input.TraceId !== undefined) { - bodyParams["TraceId"] = input.TraceId; - } - return bodyParams; + input: MessageRequest, + context: __SerdeContext +): any => { + return { + ...(input.Addresses !== undefined && { + Addresses: serializeAws_restJson1_1MapOfAddressConfiguration( + input.Addresses, + context + ) + }), + ...(input.Context !== undefined && { + Context: serializeAws_restJson1_1MapOf__string(input.Context, context) + }), + ...(input.Endpoints !== undefined && { + Endpoints: serializeAws_restJson1_1MapOfEndpointSendConfiguration( + input.Endpoints, + context + ) + }), + ...(input.MessageConfiguration !== undefined && { + MessageConfiguration: serializeAws_restJson1_1DirectMessageConfiguration( + input.MessageConfiguration, + context + ) + }), + ...(input.TemplateConfiguration !== undefined && { + TemplateConfiguration: serializeAws_restJson1_1TemplateConfiguration( + input.TemplateConfiguration, + context + ) + }), + ...(input.TraceId !== undefined && { TraceId: input.TraceId }) + }; }; const serializeAws_restJson1_1MetricDimension = ( input: MetricDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.ComparisonOperator !== undefined && { + ComparisonOperator: input.ComparisonOperator + }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1MultiConditionalBranch = ( input: MultiConditionalBranch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = serializeAws_restJson1_1SimpleCondition( - input.Condition, - context - ); - } - if (input.NextActivity !== undefined) { - bodyParams["NextActivity"] = input.NextActivity; - } - return bodyParams; + return { + ...(input.Condition !== undefined && { + Condition: serializeAws_restJson1_1SimpleCondition( + input.Condition, + context + ) + }), + ...(input.NextActivity !== undefined && { + NextActivity: input.NextActivity + }) + }; }; const serializeAws_restJson1_1MultiConditionalSplitActivity = ( input: MultiConditionalSplitActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Branches !== undefined) { - bodyParams[ - "Branches" - ] = serializeAws_restJson1_1ListOfMultiConditionalBranch( - input.Branches, - context - ); - } - if (input.DefaultActivity !== undefined) { - bodyParams["DefaultActivity"] = input.DefaultActivity; - } - if (input.EvaluationWaitTime !== undefined) { - bodyParams["EvaluationWaitTime"] = serializeAws_restJson1_1WaitTime( - input.EvaluationWaitTime, - context - ); - } - return bodyParams; + return { + ...(input.Branches !== undefined && { + Branches: serializeAws_restJson1_1ListOfMultiConditionalBranch( + input.Branches, + context + ) + }), + ...(input.DefaultActivity !== undefined && { + DefaultActivity: input.DefaultActivity + }), + ...(input.EvaluationWaitTime !== undefined && { + EvaluationWaitTime: serializeAws_restJson1_1WaitTime( + input.EvaluationWaitTime, + context + ) + }) + }; }; const serializeAws_restJson1_1NumberValidateRequest = ( input: NumberValidateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IsoCountryCode !== undefined) { - bodyParams["IsoCountryCode"] = input.IsoCountryCode; - } - if (input.PhoneNumber !== undefined) { - bodyParams["PhoneNumber"] = input.PhoneNumber; - } - return bodyParams; + return { + ...(input.IsoCountryCode !== undefined && { + IsoCountryCode: input.IsoCountryCode + }), + ...(input.PhoneNumber !== undefined && { PhoneNumber: input.PhoneNumber }) + }; }; const serializeAws_restJson1_1PublicEndpoint = ( input: PublicEndpoint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = input.Address; - } - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1MapOfListOf__string( - input.Attributes, - context - ); - } - if (input.ChannelType !== undefined) { - bodyParams["ChannelType"] = input.ChannelType; - } - if (input.Demographic !== undefined) { - bodyParams["Demographic"] = serializeAws_restJson1_1EndpointDemographic( - input.Demographic, - context - ); - } - if (input.EffectiveDate !== undefined) { - bodyParams["EffectiveDate"] = input.EffectiveDate; - } - if (input.EndpointStatus !== undefined) { - bodyParams["EndpointStatus"] = input.EndpointStatus; - } - if (input.Location !== undefined) { - bodyParams["Location"] = serializeAws_restJson1_1EndpointLocation( - input.Location, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_restJson1_1MapOf__double( - input.Metrics, - context - ); - } - if (input.OptOut !== undefined) { - bodyParams["OptOut"] = input.OptOut; - } - if (input.RequestId !== undefined) { - bodyParams["RequestId"] = input.RequestId; - } - if (input.User !== undefined) { - bodyParams["User"] = serializeAws_restJson1_1EndpointUser( - input.User, - context - ); - } - return bodyParams; + return { + ...(input.Address !== undefined && { Address: input.Address }), + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1MapOfListOf__string( + input.Attributes, + context + ) + }), + ...(input.ChannelType !== undefined && { ChannelType: input.ChannelType }), + ...(input.Demographic !== undefined && { + Demographic: serializeAws_restJson1_1EndpointDemographic( + input.Demographic, + context + ) + }), + ...(input.EffectiveDate !== undefined && { + EffectiveDate: input.EffectiveDate + }), + ...(input.EndpointStatus !== undefined && { + EndpointStatus: input.EndpointStatus + }), + ...(input.Location !== undefined && { + Location: serializeAws_restJson1_1EndpointLocation( + input.Location, + context + ) + }), + ...(input.Metrics !== undefined && { + Metrics: serializeAws_restJson1_1MapOf__double(input.Metrics, context) + }), + ...(input.OptOut !== undefined && { OptOut: input.OptOut }), + ...(input.RequestId !== undefined && { RequestId: input.RequestId }), + ...(input.User !== undefined && { + User: serializeAws_restJson1_1EndpointUser(input.User, context) + }) + }; }; const serializeAws_restJson1_1PushNotificationTemplateRequest = ( input: PushNotificationTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ADM !== undefined) { - bodyParams["ADM"] = serializeAws_restJson1_1AndroidPushNotificationTemplate( - input.ADM, - context - ); - } - if (input.APNS !== undefined) { - bodyParams["APNS"] = serializeAws_restJson1_1APNSPushNotificationTemplate( - input.APNS, - context - ); - } - if (input.Baidu !== undefined) { - bodyParams[ - "Baidu" - ] = serializeAws_restJson1_1AndroidPushNotificationTemplate( - input.Baidu, - context - ); - } - if (input.Default !== undefined) { - bodyParams[ - "Default" - ] = serializeAws_restJson1_1DefaultPushNotificationTemplate( - input.Default, - context - ); - } - if (input.DefaultSubstitutions !== undefined) { - bodyParams["DefaultSubstitutions"] = input.DefaultSubstitutions; - } - if (input.GCM !== undefined) { - bodyParams["GCM"] = serializeAws_restJson1_1AndroidPushNotificationTemplate( - input.GCM, - context - ); - } - if (input.TemplateDescription !== undefined) { - bodyParams["TemplateDescription"] = input.TemplateDescription; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.ADM !== undefined && { + ADM: serializeAws_restJson1_1AndroidPushNotificationTemplate( + input.ADM, + context + ) + }), + ...(input.APNS !== undefined && { + APNS: serializeAws_restJson1_1APNSPushNotificationTemplate( + input.APNS, + context + ) + }), + ...(input.Baidu !== undefined && { + Baidu: serializeAws_restJson1_1AndroidPushNotificationTemplate( + input.Baidu, + context + ) + }), + ...(input.Default !== undefined && { + Default: serializeAws_restJson1_1DefaultPushNotificationTemplate( + input.Default, + context + ) + }), + ...(input.DefaultSubstitutions !== undefined && { + DefaultSubstitutions: input.DefaultSubstitutions + }), + ...(input.GCM !== undefined && { + GCM: serializeAws_restJson1_1AndroidPushNotificationTemplate( + input.GCM, + context + ) + }), + ...(input.TemplateDescription !== undefined && { + TemplateDescription: input.TemplateDescription + }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1QuietTime = ( input: QuietTime, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.End !== undefined) { - bodyParams["End"] = input.End; - } - if (input.Start !== undefined) { - bodyParams["Start"] = input.Start; - } - return bodyParams; + return { + ...(input.End !== undefined && { End: input.End }), + ...(input.Start !== undefined && { Start: input.Start }) + }; }; const serializeAws_restJson1_1RandomSplitActivity = ( input: RandomSplitActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Branches !== undefined) { - bodyParams["Branches"] = serializeAws_restJson1_1ListOfRandomSplitEntry( - input.Branches, - context - ); - } - return bodyParams; + return { + ...(input.Branches !== undefined && { + Branches: serializeAws_restJson1_1ListOfRandomSplitEntry( + input.Branches, + context + ) + }) + }; }; const serializeAws_restJson1_1RandomSplitEntry = ( input: RandomSplitEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextActivity !== undefined) { - bodyParams["NextActivity"] = input.NextActivity; - } - if (input.Percentage !== undefined) { - bodyParams["Percentage"] = input.Percentage; - } - return bodyParams; + return { + ...(input.NextActivity !== undefined && { + NextActivity: input.NextActivity + }), + ...(input.Percentage !== undefined && { Percentage: input.Percentage }) + }; }; const serializeAws_restJson1_1RawEmail = ( input: RawEmail, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = context.base64Encoder(input.Data); - } - return bodyParams; + return { + ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }) + }; }; const serializeAws_restJson1_1RecencyDimension = ( input: RecencyDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.RecencyType !== undefined) { - bodyParams["RecencyType"] = input.RecencyType; - } - return bodyParams; + return { + ...(input.Duration !== undefined && { Duration: input.Duration }), + ...(input.RecencyType !== undefined && { RecencyType: input.RecencyType }) + }; }; const serializeAws_restJson1_1SMSChannelRequest = ( input: SMSChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.SenderId !== undefined) { - bodyParams["SenderId"] = input.SenderId; - } - if (input.ShortCode !== undefined) { - bodyParams["ShortCode"] = input.ShortCode; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.SenderId !== undefined && { SenderId: input.SenderId }), + ...(input.ShortCode !== undefined && { ShortCode: input.ShortCode }) + }; }; const serializeAws_restJson1_1SMSMessage = ( input: SMSMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.Keyword !== undefined) { - bodyParams["Keyword"] = input.Keyword; - } - if (input.MessageType !== undefined) { - bodyParams["MessageType"] = input.MessageType; - } - if (input.OriginationNumber !== undefined) { - bodyParams["OriginationNumber"] = input.OriginationNumber; - } - if (input.SenderId !== undefined) { - bodyParams["SenderId"] = input.SenderId; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - return bodyParams; + return { + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.Keyword !== undefined && { Keyword: input.Keyword }), + ...(input.MessageType !== undefined && { MessageType: input.MessageType }), + ...(input.OriginationNumber !== undefined && { + OriginationNumber: input.OriginationNumber + }), + ...(input.SenderId !== undefined && { SenderId: input.SenderId }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }) + }; }; const serializeAws_restJson1_1SMSTemplateRequest = ( input: SMSTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.DefaultSubstitutions !== undefined) { - bodyParams["DefaultSubstitutions"] = input.DefaultSubstitutions; - } - if (input.TemplateDescription !== undefined) { - bodyParams["TemplateDescription"] = input.TemplateDescription; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.DefaultSubstitutions !== undefined && { + DefaultSubstitutions: input.DefaultSubstitutions + }), + ...(input.TemplateDescription !== undefined && { + TemplateDescription: input.TemplateDescription + }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1Schedule = ( input: Schedule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = input.EndTime; - } - if (input.EventFilter !== undefined) { - bodyParams["EventFilter"] = serializeAws_restJson1_1CampaignEventFilter( - input.EventFilter, - context - ); - } - if (input.Frequency !== undefined) { - bodyParams["Frequency"] = input.Frequency; - } - if (input.IsLocalTime !== undefined) { - bodyParams["IsLocalTime"] = input.IsLocalTime; - } - if (input.QuietTime !== undefined) { - bodyParams["QuietTime"] = serializeAws_restJson1_1QuietTime( - input.QuietTime, - context - ); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = input.StartTime; - } - if (input.Timezone !== undefined) { - bodyParams["Timezone"] = input.Timezone; - } - return bodyParams; + return { + ...(input.EndTime !== undefined && { EndTime: input.EndTime }), + ...(input.EventFilter !== undefined && { + EventFilter: serializeAws_restJson1_1CampaignEventFilter( + input.EventFilter, + context + ) + }), + ...(input.Frequency !== undefined && { Frequency: input.Frequency }), + ...(input.IsLocalTime !== undefined && { IsLocalTime: input.IsLocalTime }), + ...(input.QuietTime !== undefined && { + QuietTime: serializeAws_restJson1_1QuietTime(input.QuietTime, context) + }), + ...(input.StartTime !== undefined && { StartTime: input.StartTime }), + ...(input.Timezone !== undefined && { Timezone: input.Timezone }) + }; }; const serializeAws_restJson1_1SegmentBehaviors = ( input: SegmentBehaviors, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Recency !== undefined) { - bodyParams["Recency"] = serializeAws_restJson1_1RecencyDimension( - input.Recency, - context - ); - } - return bodyParams; + return { + ...(input.Recency !== undefined && { + Recency: serializeAws_restJson1_1RecencyDimension(input.Recency, context) + }) + }; }; const serializeAws_restJson1_1SegmentCondition = ( input: SegmentCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SegmentId !== undefined) { - bodyParams["SegmentId"] = input.SegmentId; - } - return bodyParams; + return { + ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }) + }; }; const serializeAws_restJson1_1SegmentDemographics = ( input: SegmentDemographics, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppVersion !== undefined) { - bodyParams["AppVersion"] = serializeAws_restJson1_1SetDimension( - input.AppVersion, - context - ); - } - if (input.Channel !== undefined) { - bodyParams["Channel"] = serializeAws_restJson1_1SetDimension( - input.Channel, - context - ); - } - if (input.DeviceType !== undefined) { - bodyParams["DeviceType"] = serializeAws_restJson1_1SetDimension( - input.DeviceType, - context - ); - } - if (input.Make !== undefined) { - bodyParams["Make"] = serializeAws_restJson1_1SetDimension( - input.Make, - context - ); - } - if (input.Model !== undefined) { - bodyParams["Model"] = serializeAws_restJson1_1SetDimension( - input.Model, - context - ); - } - if (input.Platform !== undefined) { - bodyParams["Platform"] = serializeAws_restJson1_1SetDimension( - input.Platform, - context - ); - } - return bodyParams; + return { + ...(input.AppVersion !== undefined && { + AppVersion: serializeAws_restJson1_1SetDimension( + input.AppVersion, + context + ) + }), + ...(input.Channel !== undefined && { + Channel: serializeAws_restJson1_1SetDimension(input.Channel, context) + }), + ...(input.DeviceType !== undefined && { + DeviceType: serializeAws_restJson1_1SetDimension( + input.DeviceType, + context + ) + }), + ...(input.Make !== undefined && { + Make: serializeAws_restJson1_1SetDimension(input.Make, context) + }), + ...(input.Model !== undefined && { + Model: serializeAws_restJson1_1SetDimension(input.Model, context) + }), + ...(input.Platform !== undefined && { + Platform: serializeAws_restJson1_1SetDimension(input.Platform, context) + }) + }; }; const serializeAws_restJson1_1SegmentDimensions = ( input: SegmentDimensions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1MapOfAttributeDimension( - input.Attributes, - context - ); - } - if (input.Behavior !== undefined) { - bodyParams["Behavior"] = serializeAws_restJson1_1SegmentBehaviors( - input.Behavior, - context - ); - } - if (input.Demographic !== undefined) { - bodyParams["Demographic"] = serializeAws_restJson1_1SegmentDemographics( - input.Demographic, - context - ); - } - if (input.Location !== undefined) { - bodyParams["Location"] = serializeAws_restJson1_1SegmentLocation( - input.Location, - context - ); - } - if (input.Metrics !== undefined) { - bodyParams["Metrics"] = serializeAws_restJson1_1MapOfMetricDimension( - input.Metrics, - context - ); - } - if (input.UserAttributes !== undefined) { - bodyParams[ - "UserAttributes" - ] = serializeAws_restJson1_1MapOfAttributeDimension( - input.UserAttributes, - context - ); - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1MapOfAttributeDimension( + input.Attributes, + context + ) + }), + ...(input.Behavior !== undefined && { + Behavior: serializeAws_restJson1_1SegmentBehaviors( + input.Behavior, + context + ) + }), + ...(input.Demographic !== undefined && { + Demographic: serializeAws_restJson1_1SegmentDemographics( + input.Demographic, + context + ) + }), + ...(input.Location !== undefined && { + Location: serializeAws_restJson1_1SegmentLocation(input.Location, context) + }), + ...(input.Metrics !== undefined && { + Metrics: serializeAws_restJson1_1MapOfMetricDimension( + input.Metrics, + context + ) + }), + ...(input.UserAttributes !== undefined && { + UserAttributes: serializeAws_restJson1_1MapOfAttributeDimension( + input.UserAttributes, + context + ) + }) + }; }; const serializeAws_restJson1_1SegmentGroup = ( input: SegmentGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_restJson1_1ListOfSegmentDimensions( - input.Dimensions, - context - ); - } - if (input.SourceSegments !== undefined) { - bodyParams[ - "SourceSegments" - ] = serializeAws_restJson1_1ListOfSegmentReference( - input.SourceSegments, - context - ); - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Dimensions !== undefined && { + Dimensions: serializeAws_restJson1_1ListOfSegmentDimensions( + input.Dimensions, + context + ) + }), + ...(input.SourceSegments !== undefined && { + SourceSegments: serializeAws_restJson1_1ListOfSegmentReference( + input.SourceSegments, + context + ) + }), + ...(input.SourceType !== undefined && { SourceType: input.SourceType }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1SegmentGroupList = ( input: SegmentGroupList, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Groups !== undefined) { - bodyParams["Groups"] = serializeAws_restJson1_1ListOfSegmentGroup( - input.Groups, - context - ); - } - if (input.Include !== undefined) { - bodyParams["Include"] = input.Include; - } - return bodyParams; + return { + ...(input.Groups !== undefined && { + Groups: serializeAws_restJson1_1ListOfSegmentGroup(input.Groups, context) + }), + ...(input.Include !== undefined && { Include: input.Include }) + }; }; const serializeAws_restJson1_1SegmentLocation = ( input: SegmentLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Country !== undefined) { - bodyParams["Country"] = serializeAws_restJson1_1SetDimension( - input.Country, - context - ); - } - if (input.GPSPoint !== undefined) { - bodyParams["GPSPoint"] = serializeAws_restJson1_1GPSPointDimension( - input.GPSPoint, - context - ); - } - return bodyParams; + return { + ...(input.Country !== undefined && { + Country: serializeAws_restJson1_1SetDimension(input.Country, context) + }), + ...(input.GPSPoint !== undefined && { + GPSPoint: serializeAws_restJson1_1GPSPointDimension( + input.GPSPoint, + context + ) + }) + }; }; const serializeAws_restJson1_1SegmentReference = ( input: SegmentReference, context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; -}; - -const serializeAws_restJson1_1SendUsersMessageRequest = ( - input: SendUsersMessageRequest, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.Context !== undefined) { - bodyParams["Context"] = serializeAws_restJson1_1MapOf__string( - input.Context, - context - ); - } - if (input.MessageConfiguration !== undefined) { - bodyParams[ - "MessageConfiguration" - ] = serializeAws_restJson1_1DirectMessageConfiguration( - input.MessageConfiguration, - context - ); - } - if (input.TemplateConfiguration !== undefined) { - bodyParams[ - "TemplateConfiguration" - ] = serializeAws_restJson1_1TemplateConfiguration( - input.TemplateConfiguration, - context - ); - } - if (input.TraceId !== undefined) { - bodyParams["TraceId"] = input.TraceId; - } - if (input.Users !== undefined) { - bodyParams[ - "Users" - ] = serializeAws_restJson1_1MapOfEndpointSendConfiguration( - input.Users, - context - ); - } - return bodyParams; +): any => { + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Version !== undefined && { Version: input.Version }) + }; +}; + +const serializeAws_restJson1_1SendUsersMessageRequest = ( + input: SendUsersMessageRequest, + context: __SerdeContext +): any => { + return { + ...(input.Context !== undefined && { + Context: serializeAws_restJson1_1MapOf__string(input.Context, context) + }), + ...(input.MessageConfiguration !== undefined && { + MessageConfiguration: serializeAws_restJson1_1DirectMessageConfiguration( + input.MessageConfiguration, + context + ) + }), + ...(input.TemplateConfiguration !== undefined && { + TemplateConfiguration: serializeAws_restJson1_1TemplateConfiguration( + input.TemplateConfiguration, + context + ) + }), + ...(input.TraceId !== undefined && { TraceId: input.TraceId }), + ...(input.Users !== undefined && { + Users: serializeAws_restJson1_1MapOfEndpointSendConfiguration( + input.Users, + context + ) + }) + }; }; const serializeAws_restJson1_1Session = ( input: Session, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.StartTimestamp !== undefined) { - bodyParams["StartTimestamp"] = input.StartTimestamp; - } - if (input.StopTimestamp !== undefined) { - bodyParams["StopTimestamp"] = input.StopTimestamp; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1SetDimension = ( input: SetDimension, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DimensionType !== undefined) { - bodyParams["DimensionType"] = input.DimensionType; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1ListOf__string( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.DimensionType !== undefined && { + DimensionType: input.DimensionType + }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1ListOf__string(input.Values, context) + }) + }; }; const serializeAws_restJson1_1SimpleCondition = ( input: SimpleCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventCondition !== undefined) { - bodyParams["EventCondition"] = serializeAws_restJson1_1EventCondition( - input.EventCondition, - context - ); - } - if (input.SegmentCondition !== undefined) { - bodyParams["SegmentCondition"] = serializeAws_restJson1_1SegmentCondition( - input.SegmentCondition, - context - ); - } - if (input.SegmentDimensions !== undefined) { - bodyParams["segmentDimensions"] = serializeAws_restJson1_1SegmentDimensions( - input.SegmentDimensions, - context - ); - } - return bodyParams; + return { + ...(input.EventCondition !== undefined && { + EventCondition: serializeAws_restJson1_1EventCondition( + input.EventCondition, + context + ) + }), + ...(input.SegmentCondition !== undefined && { + SegmentCondition: serializeAws_restJson1_1SegmentCondition( + input.SegmentCondition, + context + ) + }), + ...(input.SegmentDimensions !== undefined && { + segmentDimensions: serializeAws_restJson1_1SegmentDimensions( + input.SegmentDimensions, + context + ) + }) + }; }; const serializeAws_restJson1_1SimpleEmail = ( input: SimpleEmail, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HtmlPart !== undefined) { - bodyParams["HtmlPart"] = serializeAws_restJson1_1SimpleEmailPart( - input.HtmlPart, - context - ); - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = serializeAws_restJson1_1SimpleEmailPart( - input.Subject, - context - ); - } - if (input.TextPart !== undefined) { - bodyParams["TextPart"] = serializeAws_restJson1_1SimpleEmailPart( - input.TextPart, - context - ); - } - return bodyParams; + return { + ...(input.HtmlPart !== undefined && { + HtmlPart: serializeAws_restJson1_1SimpleEmailPart(input.HtmlPart, context) + }), + ...(input.Subject !== undefined && { + Subject: serializeAws_restJson1_1SimpleEmailPart(input.Subject, context) + }), + ...(input.TextPart !== undefined && { + TextPart: serializeAws_restJson1_1SimpleEmailPart(input.TextPart, context) + }) + }; }; const serializeAws_restJson1_1SimpleEmailPart = ( input: SimpleEmailPart, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Charset !== undefined) { - bodyParams["Charset"] = input.Charset; - } - if (input.Data !== undefined) { - bodyParams["Data"] = input.Data; - } - return bodyParams; + return { + ...(input.Charset !== undefined && { Charset: input.Charset }), + ...(input.Data !== undefined && { Data: input.Data }) + }; }; const serializeAws_restJson1_1StartCondition = ( input: StartCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.SegmentStartCondition !== undefined) { - bodyParams[ - "SegmentStartCondition" - ] = serializeAws_restJson1_1SegmentCondition( - input.SegmentStartCondition, - context - ); - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.SegmentStartCondition !== undefined && { + SegmentStartCondition: serializeAws_restJson1_1SegmentCondition( + input.SegmentStartCondition, + context + ) + }) + }; }; const serializeAws_restJson1_1TagsModel = ( input: TagsModel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1Template = ( input: Template, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_restJson1_1TemplateActiveVersionRequest = ( input: TemplateActiveVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_restJson1_1TemplateConfiguration = ( input: TemplateConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EmailTemplate !== undefined) { - bodyParams["EmailTemplate"] = serializeAws_restJson1_1Template( - input.EmailTemplate, - context - ); - } - if (input.PushTemplate !== undefined) { - bodyParams["PushTemplate"] = serializeAws_restJson1_1Template( - input.PushTemplate, - context - ); - } - if (input.SMSTemplate !== undefined) { - bodyParams["SMSTemplate"] = serializeAws_restJson1_1Template( - input.SMSTemplate, - context - ); - } - if (input.VoiceTemplate !== undefined) { - bodyParams["VoiceTemplate"] = serializeAws_restJson1_1Template( - input.VoiceTemplate, - context - ); - } - return bodyParams; + return { + ...(input.EmailTemplate !== undefined && { + EmailTemplate: serializeAws_restJson1_1Template( + input.EmailTemplate, + context + ) + }), + ...(input.PushTemplate !== undefined && { + PushTemplate: serializeAws_restJson1_1Template( + input.PushTemplate, + context + ) + }), + ...(input.SMSTemplate !== undefined && { + SMSTemplate: serializeAws_restJson1_1Template(input.SMSTemplate, context) + }), + ...(input.VoiceTemplate !== undefined && { + VoiceTemplate: serializeAws_restJson1_1Template( + input.VoiceTemplate, + context + ) + }) + }; }; const serializeAws_restJson1_1UpdateAttributesRequest = ( input: UpdateAttributesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Blacklist !== undefined) { - bodyParams["Blacklist"] = serializeAws_restJson1_1ListOf__string( - input.Blacklist, - context - ); - } - return bodyParams; + return { + ...(input.Blacklist !== undefined && { + Blacklist: serializeAws_restJson1_1ListOf__string( + input.Blacklist, + context + ) + }) + }; }; const serializeAws_restJson1_1VoiceChannelRequest = ( input: VoiceChannelRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - return bodyParams; + return { + ...(input.Enabled !== undefined && { Enabled: input.Enabled }) + }; }; const serializeAws_restJson1_1VoiceMessage = ( input: VoiceMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.OriginationNumber !== undefined) { - bodyParams["OriginationNumber"] = input.OriginationNumber; - } - if (input.Substitutions !== undefined) { - bodyParams["Substitutions"] = serializeAws_restJson1_1MapOfListOf__string( - input.Substitutions, - context - ); - } - if (input.VoiceId !== undefined) { - bodyParams["VoiceId"] = input.VoiceId; - } - return bodyParams; + return { + ...(input.Body !== undefined && { Body: input.Body }), + ...(input.LanguageCode !== undefined && { + LanguageCode: input.LanguageCode + }), + ...(input.OriginationNumber !== undefined && { + OriginationNumber: input.OriginationNumber + }), + ...(input.Substitutions !== undefined && { + Substitutions: serializeAws_restJson1_1MapOfListOf__string( + input.Substitutions, + context + ) + }), + ...(input.VoiceId !== undefined && { VoiceId: input.VoiceId }) + }; }; const serializeAws_restJson1_1VoiceTemplateRequest = ( input: VoiceTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = input.Body; - } - if (input.DefaultSubstitutions !== undefined) { - bodyParams["DefaultSubstitutions"] = input.DefaultSubstitutions; - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.TemplateDescription !== undefined) { - bodyParams["TemplateDescription"] = input.TemplateDescription; - } - if (input.VoiceId !== undefined) { - bodyParams["VoiceId"] = input.VoiceId; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + 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_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1WaitActivity = ( input: WaitActivity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextActivity !== undefined) { - bodyParams["NextActivity"] = input.NextActivity; - } - if (input.WaitTime !== undefined) { - bodyParams["WaitTime"] = serializeAws_restJson1_1WaitTime( - input.WaitTime, - context - ); - } - return bodyParams; + return { + ...(input.NextActivity !== undefined && { + NextActivity: input.NextActivity + }), + ...(input.WaitTime !== undefined && { + WaitTime: serializeAws_restJson1_1WaitTime(input.WaitTime, context) + }) + }; }; const serializeAws_restJson1_1WaitTime = ( input: WaitTime, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WaitFor !== undefined) { - bodyParams["WaitFor"] = input.WaitFor; - } - if (input.WaitUntil !== undefined) { - bodyParams["WaitUntil"] = input.WaitUntil; - } - return bodyParams; + return { + ...(input.WaitFor !== undefined && { WaitFor: input.WaitFor }), + ...(input.WaitUntil !== undefined && { WaitUntil: input.WaitUntil }) + }; }; const serializeAws_restJson1_1WriteApplicationSettingsRequest = ( input: WriteApplicationSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CampaignHook !== undefined) { - bodyParams["CampaignHook"] = serializeAws_restJson1_1CampaignHook( - input.CampaignHook, - context - ); - } - if (input.CloudWatchMetricsEnabled !== undefined) { - bodyParams["CloudWatchMetricsEnabled"] = input.CloudWatchMetricsEnabled; - } - if (input.Limits !== undefined) { - bodyParams["Limits"] = serializeAws_restJson1_1CampaignLimits( - input.Limits, - context - ); - } - if (input.QuietTime !== undefined) { - bodyParams["QuietTime"] = serializeAws_restJson1_1QuietTime( - input.QuietTime, - context - ); - } - return bodyParams; + return { + ...(input.CampaignHook !== undefined && { + CampaignHook: serializeAws_restJson1_1CampaignHook( + input.CampaignHook, + context + ) + }), + ...(input.CloudWatchMetricsEnabled !== undefined && { + CloudWatchMetricsEnabled: input.CloudWatchMetricsEnabled + }), + ...(input.Limits !== undefined && { + Limits: serializeAws_restJson1_1CampaignLimits(input.Limits, context) + }), + ...(input.QuietTime !== undefined && { + QuietTime: serializeAws_restJson1_1QuietTime(input.QuietTime, context) + }) + }; }; const serializeAws_restJson1_1WriteCampaignRequest = ( input: WriteCampaignRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalTreatments !== undefined) { - bodyParams[ - "AdditionalTreatments" - ] = serializeAws_restJson1_1ListOfWriteTreatmentResource( - input.AdditionalTreatments, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.HoldoutPercent !== undefined) { - bodyParams["HoldoutPercent"] = input.HoldoutPercent; - } - if (input.Hook !== undefined) { - bodyParams["Hook"] = serializeAws_restJson1_1CampaignHook( - input.Hook, - context - ); - } - if (input.IsPaused !== undefined) { - bodyParams["IsPaused"] = input.IsPaused; - } - if (input.Limits !== undefined) { - bodyParams["Limits"] = serializeAws_restJson1_1CampaignLimits( - input.Limits, - context - ); - } - if (input.MessageConfiguration !== undefined) { - bodyParams[ - "MessageConfiguration" - ] = serializeAws_restJson1_1MessageConfiguration( - input.MessageConfiguration, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = serializeAws_restJson1_1Schedule( - input.Schedule, - context - ); - } - if (input.SegmentId !== undefined) { - bodyParams["SegmentId"] = input.SegmentId; - } - if (input.SegmentVersion !== undefined) { - bodyParams["SegmentVersion"] = input.SegmentVersion; - } - if (input.TemplateConfiguration !== undefined) { - bodyParams[ - "TemplateConfiguration" - ] = serializeAws_restJson1_1TemplateConfiguration( - input.TemplateConfiguration, - context - ); - } - if (input.TreatmentDescription !== undefined) { - bodyParams["TreatmentDescription"] = input.TreatmentDescription; - } - if (input.TreatmentName !== undefined) { - bodyParams["TreatmentName"] = input.TreatmentName; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.AdditionalTreatments !== undefined && { + AdditionalTreatments: serializeAws_restJson1_1ListOfWriteTreatmentResource( + input.AdditionalTreatments, + context + ) + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.HoldoutPercent !== undefined && { + HoldoutPercent: input.HoldoutPercent + }), + ...(input.Hook !== undefined && { + Hook: serializeAws_restJson1_1CampaignHook(input.Hook, context) + }), + ...(input.IsPaused !== undefined && { IsPaused: input.IsPaused }), + ...(input.Limits !== undefined && { + Limits: serializeAws_restJson1_1CampaignLimits(input.Limits, context) + }), + ...(input.MessageConfiguration !== undefined && { + MessageConfiguration: serializeAws_restJson1_1MessageConfiguration( + input.MessageConfiguration, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Schedule !== undefined && { + Schedule: serializeAws_restJson1_1Schedule(input.Schedule, context) + }), + ...(input.SegmentId !== undefined && { SegmentId: input.SegmentId }), + ...(input.SegmentVersion !== undefined && { + SegmentVersion: input.SegmentVersion + }), + ...(input.TemplateConfiguration !== undefined && { + TemplateConfiguration: serializeAws_restJson1_1TemplateConfiguration( + input.TemplateConfiguration, + context + ) + }), + ...(input.TreatmentDescription !== undefined && { + TreatmentDescription: input.TreatmentDescription + }), + ...(input.TreatmentName !== undefined && { + TreatmentName: input.TreatmentName + }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1WriteEventStream = ( input: WriteEventStream, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationStreamArn !== undefined) { - bodyParams["DestinationStreamArn"] = input.DestinationStreamArn; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.DestinationStreamArn !== undefined && { + DestinationStreamArn: input.DestinationStreamArn + }), + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_restJson1_1WriteJourneyRequest = ( input: WriteJourneyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Activities !== undefined) { - bodyParams["Activities"] = serializeAws_restJson1_1MapOfActivity( - input.Activities, - context - ); - } - if (input.CreationDate !== undefined) { - bodyParams["CreationDate"] = input.CreationDate; - } - if (input.LastModifiedDate !== undefined) { - bodyParams["LastModifiedDate"] = input.LastModifiedDate; - } - if (input.Limits !== undefined) { - bodyParams["Limits"] = serializeAws_restJson1_1JourneyLimits( - input.Limits, - context - ); - } - if (input.LocalTime !== undefined) { - bodyParams["LocalTime"] = input.LocalTime; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.QuietTime !== undefined) { - bodyParams["QuietTime"] = serializeAws_restJson1_1QuietTime( - input.QuietTime, - context - ); - } - if (input.RefreshFrequency !== undefined) { - bodyParams["RefreshFrequency"] = input.RefreshFrequency; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = serializeAws_restJson1_1JourneySchedule( - input.Schedule, - context - ); - } - if (input.StartActivity !== undefined) { - bodyParams["StartActivity"] = input.StartActivity; - } - if (input.StartCondition !== undefined) { - bodyParams["StartCondition"] = serializeAws_restJson1_1StartCondition( - input.StartCondition, - context - ); - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - return bodyParams; + return { + ...(input.Activities !== undefined && { + Activities: serializeAws_restJson1_1MapOfActivity( + input.Activities, + context + ) + }), + ...(input.CreationDate !== undefined && { + CreationDate: input.CreationDate + }), + ...(input.LastModifiedDate !== undefined && { + LastModifiedDate: input.LastModifiedDate + }), + ...(input.Limits !== undefined && { + Limits: serializeAws_restJson1_1JourneyLimits(input.Limits, context) + }), + ...(input.LocalTime !== undefined && { LocalTime: input.LocalTime }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.QuietTime !== undefined && { + QuietTime: serializeAws_restJson1_1QuietTime(input.QuietTime, context) + }), + ...(input.RefreshFrequency !== undefined && { + RefreshFrequency: input.RefreshFrequency + }), + ...(input.Schedule !== undefined && { + Schedule: serializeAws_restJson1_1JourneySchedule(input.Schedule, context) + }), + ...(input.StartActivity !== undefined && { + StartActivity: input.StartActivity + }), + ...(input.StartCondition !== undefined && { + StartCondition: serializeAws_restJson1_1StartCondition( + input.StartCondition, + context + ) + }), + ...(input.State !== undefined && { State: input.State }) + }; }; const serializeAws_restJson1_1WriteSegmentRequest = ( input: WriteSegmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Dimensions !== undefined) { - bodyParams["Dimensions"] = serializeAws_restJson1_1SegmentDimensions( - input.Dimensions, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SegmentGroups !== undefined) { - bodyParams["SegmentGroups"] = serializeAws_restJson1_1SegmentGroupList( - input.SegmentGroups, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_restJson1_1MapOf__string( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.Dimensions !== undefined && { + Dimensions: serializeAws_restJson1_1SegmentDimensions( + input.Dimensions, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SegmentGroups !== undefined && { + SegmentGroups: serializeAws_restJson1_1SegmentGroupList( + input.SegmentGroups, + context + ) + }), + ...(input.tags !== undefined && { + tags: serializeAws_restJson1_1MapOf__string(input.tags, context) + }) + }; }; const serializeAws_restJson1_1WriteTreatmentResource = ( input: WriteTreatmentResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MessageConfiguration !== undefined) { - bodyParams[ - "MessageConfiguration" - ] = serializeAws_restJson1_1MessageConfiguration( - input.MessageConfiguration, - context - ); - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = serializeAws_restJson1_1Schedule( - input.Schedule, - context - ); - } - if (input.SizePercent !== undefined) { - bodyParams["SizePercent"] = input.SizePercent; - } - if (input.TemplateConfiguration !== undefined) { - bodyParams[ - "TemplateConfiguration" - ] = serializeAws_restJson1_1TemplateConfiguration( - input.TemplateConfiguration, - context - ); - } - if (input.TreatmentDescription !== undefined) { - bodyParams["TreatmentDescription"] = input.TreatmentDescription; - } - if (input.TreatmentName !== undefined) { - bodyParams["TreatmentName"] = input.TreatmentName; - } - return bodyParams; + return { + ...(input.MessageConfiguration !== undefined && { + MessageConfiguration: serializeAws_restJson1_1MessageConfiguration( + input.MessageConfiguration, + context + ) + }), + ...(input.Schedule !== undefined && { + Schedule: serializeAws_restJson1_1Schedule(input.Schedule, context) + }), + ...(input.SizePercent !== undefined && { SizePercent: input.SizePercent }), + ...(input.TemplateConfiguration !== undefined && { + TemplateConfiguration: serializeAws_restJson1_1TemplateConfiguration( + input.TemplateConfiguration, + context + ) + }), + ...(input.TreatmentDescription !== undefined && { + TreatmentDescription: input.TreatmentDescription + }), + ...(input.TreatmentName !== undefined && { + TreatmentName: input.TreatmentName + }) + }; }; const deserializeAws_restJson1_1ADMChannelResponse = ( diff --git a/clients/client-pricing/protocols/Aws_json1_1.ts b/clients/client-pricing/protocols/Aws_json1_1.ts index 5630871fe133..62b30281a033 100644 --- a/clients/client-pricing/protocols/Aws_json1_1.ts +++ b/clients/client-pricing/protocols/Aws_json1_1.ts @@ -494,37 +494,25 @@ const serializeAws_json1_1DescribeServicesRequest = ( input: DescribeServicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FormatVersion !== undefined) { - bodyParams["FormatVersion"] = input.FormatVersion; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Field !== undefined) { - bodyParams["Field"] = input.Field; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Field !== undefined && { Field: input.Field }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1Filters = ( @@ -538,43 +526,31 @@ const serializeAws_json1_1GetAttributeValuesRequest = ( input: GetAttributeValuesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetProductsRequest = ( input: GetProductsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.FormatVersion !== undefined) { - bodyParams["FormatVersion"] = input.FormatVersion; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AttributeNameList = ( diff --git a/clients/client-qldb-session/protocols/Aws_json1_0.ts b/clients/client-qldb-session/protocols/Aws_json1_0.ts index 9e274b48cacd..b7f72b9202d3 100644 --- a/clients/client-qldb-session/protocols/Aws_json1_0.ts +++ b/clients/client-qldb-session/protocols/Aws_json1_0.ts @@ -251,144 +251,126 @@ const serializeAws_json1_0AbortTransactionRequest = ( input: AbortTransactionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_0CommitTransactionRequest = ( input: CommitTransactionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommitDigest !== undefined) { - bodyParams["CommitDigest"] = context.base64Encoder(input.CommitDigest); - } - if (input.TransactionId !== undefined) { - bodyParams["TransactionId"] = input.TransactionId; - } - return bodyParams; + return { + ...(input.CommitDigest !== undefined && { + CommitDigest: context.base64Encoder(input.CommitDigest) + }), + ...(input.TransactionId !== undefined && { + TransactionId: input.TransactionId + }) + }; }; const serializeAws_json1_0EndSessionRequest = ( input: EndSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_0ExecuteStatementRequest = ( input: ExecuteStatementRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_0StatementParameters( - input.Parameters, - context - ); - } - if (input.Statement !== undefined) { - bodyParams["Statement"] = input.Statement; - } - if (input.TransactionId !== undefined) { - bodyParams["TransactionId"] = input.TransactionId; - } - return bodyParams; + return { + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_0StatementParameters( + input.Parameters, + context + ) + }), + ...(input.Statement !== undefined && { Statement: input.Statement }), + ...(input.TransactionId !== undefined && { + TransactionId: input.TransactionId + }) + }; }; const serializeAws_json1_0FetchPageRequest = ( input: FetchPageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextPageToken !== undefined) { - bodyParams["NextPageToken"] = input.NextPageToken; - } - if (input.TransactionId !== undefined) { - bodyParams["TransactionId"] = input.TransactionId; - } - return bodyParams; + return { + ...(input.NextPageToken !== undefined && { + NextPageToken: input.NextPageToken + }), + ...(input.TransactionId !== undefined && { + TransactionId: input.TransactionId + }) + }; }; const serializeAws_json1_0SendCommandRequest = ( input: SendCommandRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AbortTransaction !== undefined) { - bodyParams[ - "AbortTransaction" - ] = serializeAws_json1_0AbortTransactionRequest( - input.AbortTransaction, - context - ); - } - if (input.CommitTransaction !== undefined) { - bodyParams[ - "CommitTransaction" - ] = serializeAws_json1_0CommitTransactionRequest( - input.CommitTransaction, - context - ); - } - if (input.EndSession !== undefined) { - bodyParams["EndSession"] = serializeAws_json1_0EndSessionRequest( - input.EndSession, - context - ); - } - if (input.ExecuteStatement !== undefined) { - bodyParams[ - "ExecuteStatement" - ] = serializeAws_json1_0ExecuteStatementRequest( - input.ExecuteStatement, - context - ); - } - if (input.FetchPage !== undefined) { - bodyParams["FetchPage"] = serializeAws_json1_0FetchPageRequest( - input.FetchPage, - context - ); - } - if (input.SessionToken !== undefined) { - bodyParams["SessionToken"] = input.SessionToken; - } - if (input.StartSession !== undefined) { - bodyParams["StartSession"] = serializeAws_json1_0StartSessionRequest( - input.StartSession, - context - ); - } - if (input.StartTransaction !== undefined) { - bodyParams[ - "StartTransaction" - ] = serializeAws_json1_0StartTransactionRequest( - input.StartTransaction, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0StartSessionRequest = ( input: StartSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LedgerName !== undefined) { - bodyParams["LedgerName"] = input.LedgerName; - } - return bodyParams; + return { + ...(input.LedgerName !== undefined && { LedgerName: input.LedgerName }) + }; }; const serializeAws_json1_0StartTransactionRequest = ( input: StartTransactionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_0StatementParameters = ( @@ -402,14 +384,12 @@ const serializeAws_json1_0ValueHolder = ( input: ValueHolder, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IonBinary !== undefined) { - bodyParams["IonBinary"] = context.base64Encoder(input.IonBinary); - } - if (input.IonText !== undefined) { - bodyParams["IonText"] = input.IonText; - } - return bodyParams; + return { + ...(input.IonBinary !== undefined && { + IonBinary: context.base64Encoder(input.IonBinary) + }), + ...(input.IonText !== undefined && { IonText: input.IonText }) + }; }; const deserializeAws_json1_0AbortTransactionResult = ( diff --git a/clients/client-qldb/protocols/Aws_restJson1_1.ts b/clients/client-qldb/protocols/Aws_restJson1_1.ts index 9475622df27e..b6fa504ed20c 100644 --- a/clients/client-qldb/protocols/Aws_restJson1_1.ts +++ b/clients/client-qldb/protocols/Aws_restJson1_1.ts @@ -1974,36 +1974,28 @@ const serializeAws_restJson1_1S3EncryptionConfiguration = ( input: S3EncryptionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyArn !== undefined) { - bodyParams["KmsKeyArn"] = input.KmsKeyArn; - } - if (input.ObjectEncryptionType !== undefined) { - bodyParams["ObjectEncryptionType"] = input.ObjectEncryptionType; - } - return bodyParams; + return { + ...(input.KmsKeyArn !== undefined && { KmsKeyArn: input.KmsKeyArn }), + ...(input.ObjectEncryptionType !== undefined && { + ObjectEncryptionType: input.ObjectEncryptionType + }) + }; }; const serializeAws_restJson1_1S3ExportConfiguration = ( input: S3ExportConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.EncryptionConfiguration !== undefined) { - bodyParams[ - "EncryptionConfiguration" - ] = serializeAws_restJson1_1S3EncryptionConfiguration( - input.EncryptionConfiguration, - context - ); - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.EncryptionConfiguration !== undefined && { + EncryptionConfiguration: serializeAws_restJson1_1S3EncryptionConfiguration( + input.EncryptionConfiguration, + context + ) + }), + ...(input.Prefix !== undefined && { Prefix: input.Prefix }) + }; }; const serializeAws_restJson1_1Tags = ( @@ -2020,11 +2012,9 @@ const serializeAws_restJson1_1ValueHolder = ( input: ValueHolder, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IonText !== undefined) { - bodyParams["IonText"] = input.IonText; - } - return bodyParams; + return { + ...(input.IonText !== undefined && { IonText: input.IonText }) + }; }; const deserializeAws_restJson1_1JournalS3ExportDescription = ( diff --git a/clients/client-quicksight/protocols/Aws_restJson1_1.ts b/clients/client-quicksight/protocols/Aws_restJson1_1.ts index 34e4e859c718..6ba6a267add3 100644 --- a/clients/client-quicksight/protocols/Aws_restJson1_1.ts +++ b/clients/client-quicksight/protocols/Aws_restJson1_1.ts @@ -13104,95 +13104,71 @@ const serializeAws_restJson1_1AdHocFilteringOption = ( input: AdHocFilteringOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityStatus !== undefined) { - bodyParams["AvailabilityStatus"] = input.AvailabilityStatus; - } - return bodyParams; + return { + ...(input.AvailabilityStatus !== undefined && { + AvailabilityStatus: input.AvailabilityStatus + }) + }; }; const serializeAws_restJson1_1AmazonElasticsearchParameters = ( input: AmazonElasticsearchParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - return bodyParams; + return { + ...(input.Domain !== undefined && { Domain: input.Domain }) + }; }; const serializeAws_restJson1_1AthenaParameters = ( input: AthenaParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkGroup !== undefined) { - bodyParams["WorkGroup"] = input.WorkGroup; - } - return bodyParams; + return { + ...(input.WorkGroup !== undefined && { WorkGroup: input.WorkGroup }) + }; }; const serializeAws_restJson1_1AuroraParameters = ( input: AuroraParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1AuroraPostgreSqlParameters = ( input: AuroraPostgreSqlParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1AwsIotAnalyticsParameters = ( input: AwsIotAnalyticsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSetName !== undefined) { - bodyParams["DataSetName"] = input.DataSetName; - } - return bodyParams; + return { + ...(input.DataSetName !== undefined && { DataSetName: input.DataSetName }) + }; }; const serializeAws_restJson1_1CalculatedColumn = ( input: CalculatedColumn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnId !== undefined) { - bodyParams["ColumnId"] = input.ColumnId; - } - if (input.ColumnName !== undefined) { - bodyParams["ColumnName"] = input.ColumnName; - } - if (input.Expression !== undefined) { - bodyParams["Expression"] = input.Expression; - } - return bodyParams; + return { + ...(input.ColumnId !== undefined && { ColumnId: input.ColumnId }), + ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), + ...(input.Expression !== undefined && { Expression: input.Expression }) + }; }; const serializeAws_restJson1_1CalculatedColumnList = ( @@ -13208,33 +13184,27 @@ const serializeAws_restJson1_1CastColumnTypeOperation = ( input: CastColumnTypeOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnName !== undefined) { - bodyParams["ColumnName"] = input.ColumnName; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.NewColumnType !== undefined) { - bodyParams["NewColumnType"] = input.NewColumnType; - } - return bodyParams; + return { + ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), + ...(input.Format !== undefined && { Format: input.Format }), + ...(input.NewColumnType !== undefined && { + NewColumnType: input.NewColumnType + }) + }; }; const serializeAws_restJson1_1ColumnGroup = ( input: ColumnGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GeoSpatialColumnGroup !== undefined) { - bodyParams[ - "GeoSpatialColumnGroup" - ] = serializeAws_restJson1_1GeoSpatialColumnGroup( - input.GeoSpatialColumnGroup, - context - ); - } - return bodyParams; + return { + ...(input.GeoSpatialColumnGroup !== undefined && { + GeoSpatialColumnGroup: serializeAws_restJson1_1GeoSpatialColumnGroup( + input.GeoSpatialColumnGroup, + context + ) + }) + }; }; const serializeAws_restJson1_1ColumnGroupList = ( @@ -13257,11 +13227,11 @@ const serializeAws_restJson1_1ColumnTag = ( input: ColumnTag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnGeographicRole !== undefined) { - bodyParams["ColumnGeographicRole"] = input.ColumnGeographicRole; - } - return bodyParams; + return { + ...(input.ColumnGeographicRole !== undefined && { + ColumnGeographicRole: input.ColumnGeographicRole + }) + }; }; const serializeAws_restJson1_1ColumnTagList = ( @@ -13275,130 +13245,107 @@ const serializeAws_restJson1_1CreateColumnsOperation = ( input: CreateColumnsOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Columns !== undefined) { - bodyParams["Columns"] = serializeAws_restJson1_1CalculatedColumnList( - input.Columns, - context - ); - } - return bodyParams; + return { + ...(input.Columns !== undefined && { + Columns: serializeAws_restJson1_1CalculatedColumnList( + input.Columns, + context + ) + }) + }; }; const serializeAws_restJson1_1CredentialPair = ( input: CredentialPair, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.Username !== undefined) { - bodyParams["Username"] = input.Username; - } - return bodyParams; + return { + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.Username !== undefined && { Username: input.Username }) + }; }; const serializeAws_restJson1_1CustomSql = ( input: CustomSql, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Columns !== undefined) { - bodyParams["Columns"] = serializeAws_restJson1_1InputColumnList( - input.Columns, - context - ); - } - if (input.DataSourceArn !== undefined) { - bodyParams["DataSourceArn"] = input.DataSourceArn; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SqlQuery !== undefined) { - bodyParams["SqlQuery"] = input.SqlQuery; - } - return bodyParams; + return { + ...(input.Columns !== undefined && { + Columns: serializeAws_restJson1_1InputColumnList(input.Columns, context) + }), + ...(input.DataSourceArn !== undefined && { + DataSourceArn: input.DataSourceArn + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.SqlQuery !== undefined && { SqlQuery: input.SqlQuery }) + }; }; const serializeAws_restJson1_1DashboardPublishOptions = ( input: DashboardPublishOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdHocFilteringOption !== undefined) { - bodyParams[ - "AdHocFilteringOption" - ] = serializeAws_restJson1_1AdHocFilteringOption( - input.AdHocFilteringOption, - context - ); - } - if (input.ExportToCSVOption !== undefined) { - bodyParams["ExportToCSVOption"] = serializeAws_restJson1_1ExportToCSVOption( - input.ExportToCSVOption, - context - ); - } - if (input.SheetControlsOption !== undefined) { - bodyParams[ - "SheetControlsOption" - ] = serializeAws_restJson1_1SheetControlsOption( - input.SheetControlsOption, - context - ); - } - return bodyParams; + return { + ...(input.AdHocFilteringOption !== undefined && { + AdHocFilteringOption: serializeAws_restJson1_1AdHocFilteringOption( + input.AdHocFilteringOption, + context + ) + }), + ...(input.ExportToCSVOption !== undefined && { + ExportToCSVOption: serializeAws_restJson1_1ExportToCSVOption( + input.ExportToCSVOption, + context + ) + }), + ...(input.SheetControlsOption !== undefined && { + SheetControlsOption: serializeAws_restJson1_1SheetControlsOption( + input.SheetControlsOption, + context + ) + }) + }; }; const serializeAws_restJson1_1DashboardSourceEntity = ( input: DashboardSourceEntity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SourceTemplate !== undefined) { - bodyParams[ - "SourceTemplate" - ] = serializeAws_restJson1_1DashboardSourceTemplate( - input.SourceTemplate, - context - ); - } - return bodyParams; + return { + ...(input.SourceTemplate !== undefined && { + SourceTemplate: serializeAws_restJson1_1DashboardSourceTemplate( + input.SourceTemplate, + context + ) + }) + }; }; const serializeAws_restJson1_1DashboardSourceTemplate = ( input: DashboardSourceTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.DataSetReferences !== undefined) { - bodyParams[ - "DataSetReferences" - ] = serializeAws_restJson1_1DataSetReferenceList( - input.DataSetReferences, - context - ); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.DataSetReferences !== undefined && { + DataSetReferences: serializeAws_restJson1_1DataSetReferenceList( + input.DataSetReferences, + context + ) + }) + }; }; const serializeAws_restJson1_1DataSetReference = ( input: DataSetReference, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSetArn !== undefined) { - bodyParams["DataSetArn"] = input.DataSetArn; - } - if (input.DataSetPlaceholder !== undefined) { - bodyParams["DataSetPlaceholder"] = input.DataSetPlaceholder; - } - return bodyParams; + return { + ...(input.DataSetArn !== undefined && { DataSetArn: input.DataSetArn }), + ...(input.DataSetPlaceholder !== undefined && { + DataSetPlaceholder: input.DataSetPlaceholder + }) + }; }; const serializeAws_restJson1_1DataSetReferenceList = ( @@ -13414,171 +13361,148 @@ const serializeAws_restJson1_1DataSourceCredentials = ( input: DataSourceCredentials, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CredentialPair !== undefined) { - bodyParams["CredentialPair"] = serializeAws_restJson1_1CredentialPair( - input.CredentialPair, - context - ); - } - return bodyParams; + return { + ...(input.CredentialPair !== undefined && { + CredentialPair: serializeAws_restJson1_1CredentialPair( + input.CredentialPair, + context + ) + }) + }; }; const serializeAws_restJson1_1DataSourceParameters = ( input: DataSourceParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AmazonElasticsearchParameters !== undefined) { - bodyParams[ - "AmazonElasticsearchParameters" - ] = serializeAws_restJson1_1AmazonElasticsearchParameters( - input.AmazonElasticsearchParameters, - context - ); - } - if (input.AthenaParameters !== undefined) { - bodyParams["AthenaParameters"] = serializeAws_restJson1_1AthenaParameters( - input.AthenaParameters, - context - ); - } - if (input.AuroraParameters !== undefined) { - bodyParams["AuroraParameters"] = serializeAws_restJson1_1AuroraParameters( - input.AuroraParameters, - context - ); - } - if (input.AuroraPostgreSqlParameters !== undefined) { - bodyParams[ - "AuroraPostgreSqlParameters" - ] = serializeAws_restJson1_1AuroraPostgreSqlParameters( - input.AuroraPostgreSqlParameters, - context - ); - } - if (input.AwsIotAnalyticsParameters !== undefined) { - bodyParams[ - "AwsIotAnalyticsParameters" - ] = serializeAws_restJson1_1AwsIotAnalyticsParameters( - input.AwsIotAnalyticsParameters, - context - ); - } - if (input.JiraParameters !== undefined) { - bodyParams["JiraParameters"] = serializeAws_restJson1_1JiraParameters( - input.JiraParameters, - context - ); - } - if (input.MariaDbParameters !== undefined) { - bodyParams["MariaDbParameters"] = serializeAws_restJson1_1MariaDbParameters( - input.MariaDbParameters, - context - ); - } - if (input.MySqlParameters !== undefined) { - bodyParams["MySqlParameters"] = serializeAws_restJson1_1MySqlParameters( - input.MySqlParameters, - context - ); - } - if (input.PostgreSqlParameters !== undefined) { - bodyParams[ - "PostgreSqlParameters" - ] = serializeAws_restJson1_1PostgreSqlParameters( - input.PostgreSqlParameters, - context - ); - } - if (input.PrestoParameters !== undefined) { - bodyParams["PrestoParameters"] = serializeAws_restJson1_1PrestoParameters( - input.PrestoParameters, - context - ); - } - if (input.RdsParameters !== undefined) { - bodyParams["RdsParameters"] = serializeAws_restJson1_1RdsParameters( - input.RdsParameters, - context - ); - } - if (input.RedshiftParameters !== undefined) { - bodyParams[ - "RedshiftParameters" - ] = serializeAws_restJson1_1RedshiftParameters( - input.RedshiftParameters, - context - ); - } - if (input.S3Parameters !== undefined) { - bodyParams["S3Parameters"] = serializeAws_restJson1_1S3Parameters( - input.S3Parameters, - context - ); - } - if (input.ServiceNowParameters !== undefined) { - bodyParams[ - "ServiceNowParameters" - ] = serializeAws_restJson1_1ServiceNowParameters( - input.ServiceNowParameters, - context - ); - } - if (input.SnowflakeParameters !== undefined) { - bodyParams[ - "SnowflakeParameters" - ] = serializeAws_restJson1_1SnowflakeParameters( - input.SnowflakeParameters, - context - ); - } - if (input.SparkParameters !== undefined) { - bodyParams["SparkParameters"] = serializeAws_restJson1_1SparkParameters( - input.SparkParameters, - context - ); - } - if (input.SqlServerParameters !== undefined) { - bodyParams[ - "SqlServerParameters" - ] = serializeAws_restJson1_1SqlServerParameters( - input.SqlServerParameters, - context - ); - } - if (input.TeradataParameters !== undefined) { - bodyParams[ - "TeradataParameters" - ] = serializeAws_restJson1_1TeradataParameters( - input.TeradataParameters, - context - ); - } - if (input.TwitterParameters !== undefined) { - bodyParams["TwitterParameters"] = serializeAws_restJson1_1TwitterParameters( - input.TwitterParameters, - context - ); - } - return bodyParams; + return { + ...(input.AmazonElasticsearchParameters !== undefined && { + AmazonElasticsearchParameters: serializeAws_restJson1_1AmazonElasticsearchParameters( + input.AmazonElasticsearchParameters, + context + ) + }), + ...(input.AthenaParameters !== undefined && { + AthenaParameters: serializeAws_restJson1_1AthenaParameters( + input.AthenaParameters, + context + ) + }), + ...(input.AuroraParameters !== undefined && { + AuroraParameters: serializeAws_restJson1_1AuroraParameters( + input.AuroraParameters, + context + ) + }), + ...(input.AuroraPostgreSqlParameters !== undefined && { + AuroraPostgreSqlParameters: serializeAws_restJson1_1AuroraPostgreSqlParameters( + input.AuroraPostgreSqlParameters, + context + ) + }), + ...(input.AwsIotAnalyticsParameters !== undefined && { + AwsIotAnalyticsParameters: serializeAws_restJson1_1AwsIotAnalyticsParameters( + input.AwsIotAnalyticsParameters, + context + ) + }), + ...(input.JiraParameters !== undefined && { + JiraParameters: serializeAws_restJson1_1JiraParameters( + input.JiraParameters, + context + ) + }), + ...(input.MariaDbParameters !== undefined && { + MariaDbParameters: serializeAws_restJson1_1MariaDbParameters( + input.MariaDbParameters, + context + ) + }), + ...(input.MySqlParameters !== undefined && { + MySqlParameters: serializeAws_restJson1_1MySqlParameters( + input.MySqlParameters, + context + ) + }), + ...(input.PostgreSqlParameters !== undefined && { + PostgreSqlParameters: serializeAws_restJson1_1PostgreSqlParameters( + input.PostgreSqlParameters, + context + ) + }), + ...(input.PrestoParameters !== undefined && { + PrestoParameters: serializeAws_restJson1_1PrestoParameters( + input.PrestoParameters, + context + ) + }), + ...(input.RdsParameters !== undefined && { + RdsParameters: serializeAws_restJson1_1RdsParameters( + input.RdsParameters, + context + ) + }), + ...(input.RedshiftParameters !== undefined && { + RedshiftParameters: serializeAws_restJson1_1RedshiftParameters( + input.RedshiftParameters, + context + ) + }), + ...(input.S3Parameters !== undefined && { + S3Parameters: serializeAws_restJson1_1S3Parameters( + input.S3Parameters, + context + ) + }), + ...(input.ServiceNowParameters !== undefined && { + ServiceNowParameters: serializeAws_restJson1_1ServiceNowParameters( + input.ServiceNowParameters, + context + ) + }), + ...(input.SnowflakeParameters !== undefined && { + SnowflakeParameters: serializeAws_restJson1_1SnowflakeParameters( + input.SnowflakeParameters, + context + ) + }), + ...(input.SparkParameters !== undefined && { + SparkParameters: serializeAws_restJson1_1SparkParameters( + input.SparkParameters, + context + ) + }), + ...(input.SqlServerParameters !== undefined && { + SqlServerParameters: serializeAws_restJson1_1SqlServerParameters( + input.SqlServerParameters, + context + ) + }), + ...(input.TeradataParameters !== undefined && { + TeradataParameters: serializeAws_restJson1_1TeradataParameters( + input.TeradataParameters, + context + ) + }), + ...(input.TwitterParameters !== undefined && { + TwitterParameters: serializeAws_restJson1_1TwitterParameters( + input.TwitterParameters, + context + ) + }) + }; }; const serializeAws_restJson1_1DateTimeParameter = ( input: DateTimeParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1TimestampList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1TimestampList(input.Values, context) + }) + }; }; const serializeAws_restJson1_1DateTimeParameterList = ( @@ -13594,17 +13518,12 @@ const serializeAws_restJson1_1DecimalParameter = ( input: DecimalParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1DoubleList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1DoubleList(input.Values, context) + }) + }; }; const serializeAws_restJson1_1DecimalParameterList = ( @@ -13620,42 +13539,35 @@ const serializeAws_restJson1_1ExportToCSVOption = ( input: ExportToCSVOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityStatus !== undefined) { - bodyParams["AvailabilityStatus"] = input.AvailabilityStatus; - } - return bodyParams; + return { + ...(input.AvailabilityStatus !== undefined && { + AvailabilityStatus: input.AvailabilityStatus + }) + }; }; const serializeAws_restJson1_1FilterOperation = ( input: FilterOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConditionExpression !== undefined) { - bodyParams["ConditionExpression"] = input.ConditionExpression; - } - return bodyParams; + return { + ...(input.ConditionExpression !== undefined && { + ConditionExpression: input.ConditionExpression + }) + }; }; const serializeAws_restJson1_1GeoSpatialColumnGroup = ( input: GeoSpatialColumnGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Columns !== undefined) { - bodyParams["Columns"] = serializeAws_restJson1_1ColumnList( - input.Columns, - context - ); - } - if (input.CountryCode !== undefined) { - bodyParams["CountryCode"] = input.CountryCode; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Columns !== undefined && { + Columns: serializeAws_restJson1_1ColumnList(input.Columns, context) + }), + ...(input.CountryCode !== undefined && { CountryCode: input.CountryCode }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_restJson1_1IdentityMap = ( @@ -13679,14 +13591,10 @@ const serializeAws_restJson1_1InputColumn = ( input: InputColumn, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1InputColumnList = ( @@ -13702,17 +13610,12 @@ const serializeAws_restJson1_1IntegerParameter = ( input: IntegerParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1LongList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1LongList(input.Values, context) + }) + }; }; const serializeAws_restJson1_1IntegerParameterList = ( @@ -13728,56 +13631,41 @@ const serializeAws_restJson1_1JiraParameters = ( input: JiraParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SiteBaseUrl !== undefined) { - bodyParams["SiteBaseUrl"] = input.SiteBaseUrl; - } - return bodyParams; + return { + ...(input.SiteBaseUrl !== undefined && { SiteBaseUrl: input.SiteBaseUrl }) + }; }; const serializeAws_restJson1_1JoinInstruction = ( input: JoinInstruction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LeftOperand !== undefined) { - bodyParams["LeftOperand"] = input.LeftOperand; - } - if (input.OnClause !== undefined) { - bodyParams["OnClause"] = input.OnClause; - } - if (input.RightOperand !== undefined) { - bodyParams["RightOperand"] = input.RightOperand; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.LeftOperand !== undefined && { LeftOperand: input.LeftOperand }), + ...(input.OnClause !== undefined && { OnClause: input.OnClause }), + ...(input.RightOperand !== undefined && { + RightOperand: input.RightOperand + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1LogicalTable = ( input: LogicalTable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alias !== undefined) { - bodyParams["Alias"] = input.Alias; - } - if (input.DataTransforms !== undefined) { - bodyParams[ - "DataTransforms" - ] = serializeAws_restJson1_1TransformOperationList( - input.DataTransforms, - context - ); - } - if (input.Source !== undefined) { - bodyParams["Source"] = serializeAws_restJson1_1LogicalTableSource( - input.Source, - context - ); - } - return bodyParams; + return { + ...(input.Alias !== undefined && { Alias: input.Alias }), + ...(input.DataTransforms !== undefined && { + DataTransforms: serializeAws_restJson1_1TransformOperationList( + input.DataTransforms, + context + ) + }), + ...(input.Source !== undefined && { + Source: serializeAws_restJson1_1LogicalTableSource(input.Source, context) + }) + }; }; const serializeAws_restJson1_1LogicalTableMap = ( @@ -13794,131 +13682,101 @@ const serializeAws_restJson1_1LogicalTableSource = ( input: LogicalTableSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JoinInstruction !== undefined) { - bodyParams["JoinInstruction"] = serializeAws_restJson1_1JoinInstruction( - input.JoinInstruction, - context - ); - } - if (input.PhysicalTableId !== undefined) { - bodyParams["PhysicalTableId"] = input.PhysicalTableId; - } - return bodyParams; + return { + ...(input.JoinInstruction !== undefined && { + JoinInstruction: serializeAws_restJson1_1JoinInstruction( + input.JoinInstruction, + context + ) + }), + ...(input.PhysicalTableId !== undefined && { + PhysicalTableId: input.PhysicalTableId + }) + }; }; const serializeAws_restJson1_1ManifestFileLocation = ( input: ManifestFileLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Key !== undefined && { Key: input.Key }) + }; }; const serializeAws_restJson1_1MariaDbParameters = ( input: MariaDbParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1MySqlParameters = ( input: MySqlParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1_Parameters = ( input: _Parameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DateTimeParameters !== undefined) { - bodyParams[ - "DateTimeParameters" - ] = serializeAws_restJson1_1DateTimeParameterList( - input.DateTimeParameters, - context - ); - } - if (input.DecimalParameters !== undefined) { - bodyParams[ - "DecimalParameters" - ] = serializeAws_restJson1_1DecimalParameterList( - input.DecimalParameters, - context - ); - } - if (input.IntegerParameters !== undefined) { - bodyParams[ - "IntegerParameters" - ] = serializeAws_restJson1_1IntegerParameterList( - input.IntegerParameters, - context - ); - } - if (input.StringParameters !== undefined) { - bodyParams[ - "StringParameters" - ] = serializeAws_restJson1_1StringParameterList( - input.StringParameters, - context - ); - } - return bodyParams; + return { + ...(input.DateTimeParameters !== undefined && { + DateTimeParameters: serializeAws_restJson1_1DateTimeParameterList( + input.DateTimeParameters, + context + ) + }), + ...(input.DecimalParameters !== undefined && { + DecimalParameters: serializeAws_restJson1_1DecimalParameterList( + input.DecimalParameters, + context + ) + }), + ...(input.IntegerParameters !== undefined && { + IntegerParameters: serializeAws_restJson1_1IntegerParameterList( + input.IntegerParameters, + context + ) + }), + ...(input.StringParameters !== undefined && { + StringParameters: serializeAws_restJson1_1StringParameterList( + input.StringParameters, + context + ) + }) + }; }; const serializeAws_restJson1_1PhysicalTable = ( input: PhysicalTable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomSql !== undefined) { - bodyParams["CustomSql"] = serializeAws_restJson1_1CustomSql( - input.CustomSql, - context - ); - } - if (input.RelationalTable !== undefined) { - bodyParams["RelationalTable"] = serializeAws_restJson1_1RelationalTable( - input.RelationalTable, - context - ); - } - if (input.S3Source !== undefined) { - bodyParams["S3Source"] = serializeAws_restJson1_1S3Source( - input.S3Source, - context - ); - } - return bodyParams; + return { + ...(input.CustomSql !== undefined && { + CustomSql: serializeAws_restJson1_1CustomSql(input.CustomSql, context) + }), + ...(input.RelationalTable !== undefined && { + RelationalTable: serializeAws_restJson1_1RelationalTable( + input.RelationalTable, + context + ) + }), + ...(input.S3Source !== undefined && { + S3Source: serializeAws_restJson1_1S3Source(input.S3Source, context) + }) + }; }; const serializeAws_restJson1_1PhysicalTableMap = ( @@ -13935,50 +13793,36 @@ const serializeAws_restJson1_1PostgreSqlParameters = ( input: PostgreSqlParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1PrestoParameters = ( input: PrestoParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Catalog !== undefined) { - bodyParams["Catalog"] = input.Catalog; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Catalog !== undefined && { Catalog: input.Catalog }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1ProjectOperation = ( input: ProjectOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProjectedColumns !== undefined) { - bodyParams[ - "ProjectedColumns" - ] = serializeAws_restJson1_1ProjectedColumnList( - input.ProjectedColumns, - context - ); - } - return bodyParams; + return { + ...(input.ProjectedColumns !== undefined && { + ProjectedColumns: serializeAws_restJson1_1ProjectedColumnList( + input.ProjectedColumns, + context + ) + }) + }; }; const serializeAws_restJson1_1ProjectedColumnList = ( @@ -13992,222 +13836,175 @@ const serializeAws_restJson1_1RdsParameters = ( input: RdsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_restJson1_1RedshiftParameters = ( input: RedshiftParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1RelationalTable = ( input: RelationalTable, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSourceArn !== undefined) { - bodyParams["DataSourceArn"] = input.DataSourceArn; - } - if (input.InputColumns !== undefined) { - bodyParams["InputColumns"] = serializeAws_restJson1_1InputColumnList( - input.InputColumns, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Schema !== undefined) { - bodyParams["Schema"] = input.Schema; - } - return bodyParams; + return { + ...(input.DataSourceArn !== undefined && { + DataSourceArn: input.DataSourceArn + }), + ...(input.InputColumns !== undefined && { + InputColumns: serializeAws_restJson1_1InputColumnList( + input.InputColumns, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Schema !== undefined && { Schema: input.Schema }) + }; }; const serializeAws_restJson1_1RenameColumnOperation = ( input: RenameColumnOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnName !== undefined) { - bodyParams["ColumnName"] = input.ColumnName; - } - if (input.NewColumnName !== undefined) { - bodyParams["NewColumnName"] = input.NewColumnName; - } - return bodyParams; + return { + ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), + ...(input.NewColumnName !== undefined && { + NewColumnName: input.NewColumnName + }) + }; }; const serializeAws_restJson1_1RowLevelPermissionDataSet = ( input: RowLevelPermissionDataSet, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.PermissionPolicy !== undefined) { - bodyParams["PermissionPolicy"] = input.PermissionPolicy; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.PermissionPolicy !== undefined && { + PermissionPolicy: input.PermissionPolicy + }) + }; }; const serializeAws_restJson1_1S3Parameters = ( input: S3Parameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestFileLocation !== undefined) { - bodyParams[ - "ManifestFileLocation" - ] = serializeAws_restJson1_1ManifestFileLocation( - input.ManifestFileLocation, - context - ); - } - return bodyParams; + return { + ...(input.ManifestFileLocation !== undefined && { + ManifestFileLocation: serializeAws_restJson1_1ManifestFileLocation( + input.ManifestFileLocation, + context + ) + }) + }; }; const serializeAws_restJson1_1S3Source = ( input: S3Source, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataSourceArn !== undefined) { - bodyParams["DataSourceArn"] = input.DataSourceArn; - } - if (input.InputColumns !== undefined) { - bodyParams["InputColumns"] = serializeAws_restJson1_1InputColumnList( - input.InputColumns, - context - ); - } - if (input.UploadSettings !== undefined) { - bodyParams["UploadSettings"] = serializeAws_restJson1_1UploadSettings( - input.UploadSettings, - context - ); - } - return bodyParams; + return { + ...(input.DataSourceArn !== undefined && { + DataSourceArn: input.DataSourceArn + }), + ...(input.InputColumns !== undefined && { + InputColumns: serializeAws_restJson1_1InputColumnList( + input.InputColumns, + context + ) + }), + ...(input.UploadSettings !== undefined && { + UploadSettings: serializeAws_restJson1_1UploadSettings( + input.UploadSettings, + context + ) + }) + }; }; const serializeAws_restJson1_1ServiceNowParameters = ( input: ServiceNowParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SiteBaseUrl !== undefined) { - bodyParams["SiteBaseUrl"] = input.SiteBaseUrl; - } - return bodyParams; + return { + ...(input.SiteBaseUrl !== undefined && { SiteBaseUrl: input.SiteBaseUrl }) + }; }; const serializeAws_restJson1_1SheetControlsOption = ( input: SheetControlsOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VisibilityState !== undefined) { - bodyParams["VisibilityState"] = input.VisibilityState; - } - return bodyParams; + return { + ...(input.VisibilityState !== undefined && { + VisibilityState: input.VisibilityState + }) + }; }; const serializeAws_restJson1_1SnowflakeParameters = ( input: SnowflakeParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Warehouse !== undefined) { - bodyParams["Warehouse"] = input.Warehouse; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Warehouse !== undefined && { Warehouse: input.Warehouse }) + }; }; const serializeAws_restJson1_1SparkParameters = ( input: SparkParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1SqlServerParameters = ( input: SqlServerParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1SslProperties = ( input: SslProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisableSsl !== undefined) { - bodyParams["DisableSsl"] = input.DisableSsl; - } - return bodyParams; + return { + ...(input.DisableSsl !== undefined && { DisableSsl: input.DisableSsl }) + }; }; const serializeAws_restJson1_1StringParameter = ( input: StringParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1StringList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1StringList(input.Values, context) + }) + }; }; const serializeAws_restJson1_1StringParameterList = ( @@ -14223,140 +14020,111 @@ const serializeAws_restJson1_1TagColumnOperation = ( input: TagColumnOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ColumnName !== undefined) { - bodyParams["ColumnName"] = input.ColumnName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_restJson1_1ColumnTagList( - input.Tags, - context - ); - } - return bodyParams; + return { + ...(input.ColumnName !== undefined && { ColumnName: input.ColumnName }), + ...(input.Tags !== undefined && { + Tags: serializeAws_restJson1_1ColumnTagList(input.Tags, context) + }) + }; }; const serializeAws_restJson1_1TemplateSourceAnalysis = ( input: TemplateSourceAnalysis, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.DataSetReferences !== undefined) { - bodyParams[ - "DataSetReferences" - ] = serializeAws_restJson1_1DataSetReferenceList( - input.DataSetReferences, - context - ); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.DataSetReferences !== undefined && { + DataSetReferences: serializeAws_restJson1_1DataSetReferenceList( + input.DataSetReferences, + context + ) + }) + }; }; const serializeAws_restJson1_1TemplateSourceEntity = ( input: TemplateSourceEntity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SourceAnalysis !== undefined) { - bodyParams[ - "SourceAnalysis" - ] = serializeAws_restJson1_1TemplateSourceAnalysis( - input.SourceAnalysis, - context - ); - } - if (input.SourceTemplate !== undefined) { - bodyParams[ - "SourceTemplate" - ] = serializeAws_restJson1_1TemplateSourceTemplate( - input.SourceTemplate, - context - ); - } - return bodyParams; + return { + ...(input.SourceAnalysis !== undefined && { + SourceAnalysis: serializeAws_restJson1_1TemplateSourceAnalysis( + input.SourceAnalysis, + context + ) + }), + ...(input.SourceTemplate !== undefined && { + SourceTemplate: serializeAws_restJson1_1TemplateSourceTemplate( + input.SourceTemplate, + context + ) + }) + }; }; const serializeAws_restJson1_1TemplateSourceTemplate = ( input: TemplateSourceTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }) + }; }; const serializeAws_restJson1_1TeradataParameters = ( input: TeradataParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Database !== undefined) { - bodyParams["Database"] = input.Database; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Database !== undefined && { Database: input.Database }), + ...(input.Host !== undefined && { Host: input.Host }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_restJson1_1TransformOperation = ( input: TransformOperation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CastColumnTypeOperation !== undefined) { - bodyParams[ - "CastColumnTypeOperation" - ] = serializeAws_restJson1_1CastColumnTypeOperation( - input.CastColumnTypeOperation, - context - ); - } - if (input.CreateColumnsOperation !== undefined) { - bodyParams[ - "CreateColumnsOperation" - ] = serializeAws_restJson1_1CreateColumnsOperation( - input.CreateColumnsOperation, - context - ); - } - if (input.FilterOperation !== undefined) { - bodyParams["FilterOperation"] = serializeAws_restJson1_1FilterOperation( - input.FilterOperation, - context - ); - } - if (input.ProjectOperation !== undefined) { - bodyParams["ProjectOperation"] = serializeAws_restJson1_1ProjectOperation( - input.ProjectOperation, - context - ); - } - if (input.RenameColumnOperation !== undefined) { - bodyParams[ - "RenameColumnOperation" - ] = serializeAws_restJson1_1RenameColumnOperation( - input.RenameColumnOperation, - context - ); - } - if (input.TagColumnOperation !== undefined) { - bodyParams[ - "TagColumnOperation" - ] = serializeAws_restJson1_1TagColumnOperation( - input.TagColumnOperation, - context - ); - } - return bodyParams; + return { + ...(input.CastColumnTypeOperation !== undefined && { + CastColumnTypeOperation: serializeAws_restJson1_1CastColumnTypeOperation( + input.CastColumnTypeOperation, + context + ) + }), + ...(input.CreateColumnsOperation !== undefined && { + CreateColumnsOperation: serializeAws_restJson1_1CreateColumnsOperation( + input.CreateColumnsOperation, + context + ) + }), + ...(input.FilterOperation !== undefined && { + FilterOperation: serializeAws_restJson1_1FilterOperation( + input.FilterOperation, + context + ) + }), + ...(input.ProjectOperation !== undefined && { + ProjectOperation: serializeAws_restJson1_1ProjectOperation( + input.ProjectOperation, + context + ) + }), + ...(input.RenameColumnOperation !== undefined && { + RenameColumnOperation: serializeAws_restJson1_1RenameColumnOperation( + input.RenameColumnOperation, + context + ) + }), + ...(input.TagColumnOperation !== undefined && { + TagColumnOperation: serializeAws_restJson1_1TagColumnOperation( + input.TagColumnOperation, + context + ) + }) + }; }; const serializeAws_restJson1_1TransformOperationList = ( @@ -14372,14 +14140,10 @@ const serializeAws_restJson1_1TwitterParameters = ( input: TwitterParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxRows !== undefined) { - bodyParams["MaxRows"] = input.MaxRows; - } - if (input.Query !== undefined) { - bodyParams["Query"] = input.Query; - } - return bodyParams; + return { + ...(input.MaxRows !== undefined && { MaxRows: input.MaxRows }), + ...(input.Query !== undefined && { Query: input.Query }) + }; }; const serializeAws_restJson1_1UpdateResourcePermissionList = ( @@ -14395,34 +14159,30 @@ const serializeAws_restJson1_1UploadSettings = ( input: UploadSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainsHeader !== undefined) { - bodyParams["ContainsHeader"] = input.ContainsHeader; - } - if (input.Delimiter !== undefined) { - bodyParams["Delimiter"] = input.Delimiter; - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - if (input.StartFromRow !== undefined) { - bodyParams["StartFromRow"] = input.StartFromRow; - } - if (input.TextQualifier !== undefined) { - bodyParams["TextQualifier"] = input.TextQualifier; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1VpcConnectionProperties = ( input: VpcConnectionProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VpcConnectionArn !== undefined) { - bodyParams["VpcConnectionArn"] = input.VpcConnectionArn; - } - return bodyParams; + return { + ...(input.VpcConnectionArn !== undefined && { + VpcConnectionArn: input.VpcConnectionArn + }) + }; }; const serializeAws_restJson1_1ActionList = ( @@ -14450,17 +14210,12 @@ const serializeAws_restJson1_1ResourcePermission = ( input: ResourcePermission, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["Actions"] = serializeAws_restJson1_1ActionList( - input.Actions, - context - ); - } - if (input.Principal !== undefined) { - bodyParams["Principal"] = input.Principal; - } - return bodyParams; + return { + ...(input.Actions !== undefined && { + Actions: serializeAws_restJson1_1ActionList(input.Actions, context) + }), + ...(input.Principal !== undefined && { Principal: input.Principal }) + }; }; const serializeAws_restJson1_1ResourcePermissionList = ( @@ -14483,14 +14238,10 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagList = ( diff --git a/clients/client-ram/protocols/Aws_restJson1_1.ts b/clients/client-ram/protocols/Aws_restJson1_1.ts index ab9f7e594bcc..304f21ca99b1 100644 --- a/clients/client-ram/protocols/Aws_restJson1_1.ts +++ b/clients/client-ram/protocols/Aws_restJson1_1.ts @@ -4507,31 +4507,22 @@ const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_restJson1_1TagFilter = ( input: TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tagKey !== undefined) { - bodyParams["tagKey"] = input.tagKey; - } - if (input.tagValues !== undefined) { - bodyParams["tagValues"] = serializeAws_restJson1_1TagValueList( - input.tagValues, - context - ); - } - return bodyParams; + return { + ...(input.tagKey !== undefined && { tagKey: input.tagKey }), + ...(input.tagValues !== undefined && { + tagValues: serializeAws_restJson1_1TagValueList(input.tagValues, context) + }) + }; }; const serializeAws_restJson1_1TagFilters = ( diff --git a/clients/client-rds-data/protocols/Aws_restJson1_1.ts b/clients/client-rds-data/protocols/Aws_restJson1_1.ts index 9526fd87b47e..1addbefabfad 100644 --- a/clients/client-rds-data/protocols/Aws_restJson1_1.ts +++ b/clients/client-rds-data/protocols/Aws_restJson1_1.ts @@ -1106,14 +1106,12 @@ const serializeAws_restJson1_1SqlParameter = ( input: SqlParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.value !== undefined) { - bodyParams["value"] = serializeAws_restJson1_1Field(input.value, context); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.value !== undefined && { + value: serializeAws_restJson1_1Field(input.value, context) + }) + }; }; const serializeAws_restJson1_1SqlParameterSets = ( diff --git a/clients/client-rekognition/protocols/Aws_json1_1.ts b/clients/client-rekognition/protocols/Aws_json1_1.ts index c47e6dba05bc..f776e1137e81 100644 --- a/clients/client-rekognition/protocols/Aws_json1_1.ts +++ b/clients/client-rekognition/protocols/Aws_json1_1.ts @@ -6741,14 +6741,14 @@ const serializeAws_json1_1Asset = ( input: Asset, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroundTruthManifest !== undefined) { - bodyParams["GroundTruthManifest"] = serializeAws_json1_1GroundTruthManifest( - input.GroundTruthManifest, - context - ); - } - return bodyParams; + return { + ...(input.GroundTruthManifest !== undefined && { + GroundTruthManifest: serializeAws_json1_1GroundTruthManifest( + input.GroundTruthManifest, + context + ) + }) + }; }; const serializeAws_json1_1Assets = ( @@ -6769,26 +6769,20 @@ const serializeAws_json1_1CompareFacesRequest = ( input: CompareFacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QualityFilter !== undefined) { - bodyParams["QualityFilter"] = input.QualityFilter; - } - if (input.SimilarityThreshold !== undefined) { - bodyParams["SimilarityThreshold"] = input.SimilarityThreshold; - } - if (input.SourceImage !== undefined) { - bodyParams["SourceImage"] = serializeAws_json1_1Image( - input.SourceImage, - context - ); - } - if (input.TargetImage !== undefined) { - bodyParams["TargetImage"] = serializeAws_json1_1Image( - input.TargetImage, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ContentClassifiers = ( @@ -6802,269 +6796,226 @@ const serializeAws_json1_1CreateCollectionRequest = ( input: CreateCollectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - return bodyParams; + return { + ...(input.CollectionId !== undefined && { + CollectionId: input.CollectionId + }) + }; }; const serializeAws_json1_1CreateProjectRequest = ( input: CreateProjectRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProjectName !== undefined) { - bodyParams["ProjectName"] = input.ProjectName; - } - return bodyParams; + return { + ...(input.ProjectName !== undefined && { ProjectName: input.ProjectName }) + }; }; const serializeAws_json1_1CreateProjectVersionRequest = ( input: CreateProjectVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputConfig !== undefined) { - bodyParams["OutputConfig"] = serializeAws_json1_1OutputConfig( - input.OutputConfig, - context - ); - } - if (input.ProjectArn !== undefined) { - bodyParams["ProjectArn"] = input.ProjectArn; - } - if (input.TestingData !== undefined) { - bodyParams["TestingData"] = serializeAws_json1_1TestingData( - input.TestingData, - context - ); - } - if (input.TrainingData !== undefined) { - bodyParams["TrainingData"] = serializeAws_json1_1TrainingData( - input.TrainingData, - context - ); - } - if (input.VersionName !== undefined) { - bodyParams["VersionName"] = input.VersionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateStreamProcessorRequest = ( input: CreateStreamProcessorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Input !== undefined) { - bodyParams["Input"] = serializeAws_json1_1StreamProcessorInput( - input.Input, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Output !== undefined) { - bodyParams["Output"] = serializeAws_json1_1StreamProcessorOutput( - input.Output, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.Settings !== undefined) { - bodyParams["Settings"] = serializeAws_json1_1StreamProcessorSettings( - input.Settings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DeleteCollectionRequest = ( input: DeleteCollectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - return bodyParams; + return { + ...(input.CollectionId !== undefined && { + CollectionId: input.CollectionId + }) + }; }; const serializeAws_json1_1DeleteFacesRequest = ( input: DeleteFacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.FaceIds !== undefined) { - bodyParams["FaceIds"] = serializeAws_json1_1FaceIdList( - input.FaceIds, - context - ); - } - return bodyParams; + return { + ...(input.CollectionId !== undefined && { + CollectionId: input.CollectionId + }), + ...(input.FaceIds !== undefined && { + FaceIds: serializeAws_json1_1FaceIdList(input.FaceIds, context) + }) + }; }; const serializeAws_json1_1DeleteStreamProcessorRequest = ( input: DeleteStreamProcessorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeCollectionRequest = ( input: DescribeCollectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - return bodyParams; + return { + ...(input.CollectionId !== undefined && { + CollectionId: input.CollectionId + }) + }; }; const serializeAws_json1_1DescribeProjectVersionsRequest = ( input: DescribeProjectVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ProjectArn !== undefined) { - bodyParams["ProjectArn"] = input.ProjectArn; - } - if (input.VersionNames !== undefined) { - bodyParams["VersionNames"] = serializeAws_json1_1VersionNames( - input.VersionNames, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribeProjectsRequest = ( input: DescribeProjectsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeStreamProcessorRequest = ( input: DescribeStreamProcessorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DetectCustomLabelsRequest = ( input: DetectCustomLabelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MinConfidence !== undefined) { - bodyParams["MinConfidence"] = input.MinConfidence; - } - if (input.ProjectVersionArn !== undefined) { - bodyParams["ProjectVersionArn"] = input.ProjectVersionArn; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DetectFacesRequest = ( input: DetectFacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1Attributes( - input.Attributes, - context - ); - } - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_json1_1Attributes(input.Attributes, context) + }), + ...(input.Image !== undefined && { + Image: serializeAws_json1_1Image(input.Image, context) + }) + }; }; const serializeAws_json1_1DetectLabelsRequest = ( input: DetectLabelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - if (input.MaxLabels !== undefined) { - bodyParams["MaxLabels"] = input.MaxLabels; - } - if (input.MinConfidence !== undefined) { - bodyParams["MinConfidence"] = input.MinConfidence; - } - return bodyParams; + return { + ...(input.Image !== undefined && { + Image: serializeAws_json1_1Image(input.Image, context) + }), + ...(input.MaxLabels !== undefined && { MaxLabels: input.MaxLabels }), + ...(input.MinConfidence !== undefined && { + MinConfidence: input.MinConfidence + }) + }; }; const serializeAws_json1_1DetectModerationLabelsRequest = ( input: DetectModerationLabelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanLoopConfig !== undefined) { - bodyParams["HumanLoopConfig"] = serializeAws_json1_1HumanLoopConfig( - input.HumanLoopConfig, - context - ); - } - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - if (input.MinConfidence !== undefined) { - bodyParams["MinConfidence"] = input.MinConfidence; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DetectTextRequest = ( input: DetectTextRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - return bodyParams; + return { + ...(input.Image !== undefined && { + Image: serializeAws_json1_1Image(input.Image, context) + }) + }; }; const serializeAws_json1_1FaceIdList = ( @@ -7078,669 +7029,559 @@ const serializeAws_json1_1FaceSearchSettings = ( input: FaceSearchSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.FaceMatchThreshold !== undefined) { - bodyParams["FaceMatchThreshold"] = input.FaceMatchThreshold; - } - return bodyParams; + return { + ...(input.CollectionId !== undefined && { + CollectionId: input.CollectionId + }), + ...(input.FaceMatchThreshold !== undefined && { + FaceMatchThreshold: input.FaceMatchThreshold + }) + }; }; const serializeAws_json1_1GetCelebrityInfoRequest = ( input: GetCelebrityInfoRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1GetCelebrityRecognitionRequest = ( input: GetCelebrityRecognitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetContentModerationRequest = ( input: GetContentModerationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetFaceDetectionRequest = ( input: GetFaceDetectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetFaceSearchRequest = ( input: GetFaceSearchRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetLabelDetectionRequest = ( input: GetLabelDetectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetPersonTrackingRequest = ( input: GetPersonTrackingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GroundTruthManifest = ( input: GroundTruthManifest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Object !== undefined) { - bodyParams["S3Object"] = serializeAws_json1_1S3Object( - input.S3Object, - context - ); - } - return bodyParams; + return { + ...(input.S3Object !== undefined && { + S3Object: serializeAws_json1_1S3Object(input.S3Object, context) + }) + }; }; const serializeAws_json1_1HumanLoopConfig = ( input: HumanLoopConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataAttributes !== undefined) { - bodyParams["DataAttributes"] = serializeAws_json1_1HumanLoopDataAttributes( - input.DataAttributes, - context - ); - } - if (input.FlowDefinitionArn !== undefined) { - bodyParams["FlowDefinitionArn"] = input.FlowDefinitionArn; - } - if (input.HumanLoopName !== undefined) { - bodyParams["HumanLoopName"] = input.HumanLoopName; - } - return bodyParams; + return { + ...(input.DataAttributes !== undefined && { + DataAttributes: serializeAws_json1_1HumanLoopDataAttributes( + input.DataAttributes, + context + ) + }), + ...(input.FlowDefinitionArn !== undefined && { + FlowDefinitionArn: input.FlowDefinitionArn + }), + ...(input.HumanLoopName !== undefined && { + HumanLoopName: input.HumanLoopName + }) + }; }; const serializeAws_json1_1HumanLoopDataAttributes = ( input: HumanLoopDataAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContentClassifiers !== undefined) { - bodyParams["ContentClassifiers"] = serializeAws_json1_1ContentClassifiers( - input.ContentClassifiers, - context - ); - } - return bodyParams; + return { + ...(input.ContentClassifiers !== undefined && { + ContentClassifiers: serializeAws_json1_1ContentClassifiers( + input.ContentClassifiers, + context + ) + }) + }; }; const serializeAws_json1_1Image = ( input: Image, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bytes !== undefined) { - bodyParams["Bytes"] = context.base64Encoder(input.Bytes); - } - if (input.S3Object !== undefined) { - bodyParams["S3Object"] = serializeAws_json1_1S3Object( - input.S3Object, - context - ); - } - return bodyParams; + return { + ...(input.Bytes !== undefined && { + Bytes: context.base64Encoder(input.Bytes) + }), + ...(input.S3Object !== undefined && { + S3Object: serializeAws_json1_1S3Object(input.S3Object, context) + }) + }; }; const serializeAws_json1_1IndexFacesRequest = ( input: IndexFacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.DetectionAttributes !== undefined) { - bodyParams["DetectionAttributes"] = serializeAws_json1_1Attributes( - input.DetectionAttributes, - context - ); - } - if (input.ExternalImageId !== undefined) { - bodyParams["ExternalImageId"] = input.ExternalImageId; - } - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - if (input.MaxFaces !== undefined) { - bodyParams["MaxFaces"] = input.MaxFaces; - } - if (input.QualityFilter !== undefined) { - bodyParams["QualityFilter"] = input.QualityFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1KinesisDataStream = ( input: KinesisDataStream, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }) + }; }; const serializeAws_json1_1KinesisVideoStream = ( input: KinesisVideoStream, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }) + }; }; const serializeAws_json1_1ListCollectionsRequest = ( input: ListCollectionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListFacesRequest = ( input: ListFacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.CollectionId !== undefined && { + CollectionId: input.CollectionId + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListStreamProcessorsRequest = ( input: ListStreamProcessorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1NotificationChannel = ( input: NotificationChannel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.SNSTopicArn !== undefined) { - bodyParams["SNSTopicArn"] = input.SNSTopicArn; - } - return bodyParams; + return { + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.SNSTopicArn !== undefined && { SNSTopicArn: input.SNSTopicArn }) + }; }; const serializeAws_json1_1OutputConfig = ( input: OutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3KeyPrefix !== undefined) { - bodyParams["S3KeyPrefix"] = input.S3KeyPrefix; - } - return bodyParams; + return { + ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }), + ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }) + }; }; const serializeAws_json1_1RecognizeCelebritiesRequest = ( input: RecognizeCelebritiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - return bodyParams; + return { + ...(input.Image !== undefined && { + Image: serializeAws_json1_1Image(input.Image, context) + }) + }; }; const serializeAws_json1_1S3Object = ( input: S3Object, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1SearchFacesByImageRequest = ( input: SearchFacesByImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.FaceMatchThreshold !== undefined) { - bodyParams["FaceMatchThreshold"] = input.FaceMatchThreshold; - } - if (input.Image !== undefined) { - bodyParams["Image"] = serializeAws_json1_1Image(input.Image, context); - } - if (input.MaxFaces !== undefined) { - bodyParams["MaxFaces"] = input.MaxFaces; - } - if (input.QualityFilter !== undefined) { - bodyParams["QualityFilter"] = input.QualityFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1SearchFacesRequest = ( input: SearchFacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.FaceId !== undefined) { - bodyParams["FaceId"] = input.FaceId; - } - if (input.FaceMatchThreshold !== undefined) { - bodyParams["FaceMatchThreshold"] = input.FaceMatchThreshold; - } - if (input.MaxFaces !== undefined) { - bodyParams["MaxFaces"] = input.MaxFaces; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1StartCelebrityRecognitionRequest = ( input: StartCelebrityRecognitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - if (input.Video !== undefined) { - bodyParams["Video"] = serializeAws_json1_1Video(input.Video, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartContentModerationRequest = ( input: StartContentModerationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.MinConfidence !== undefined) { - bodyParams["MinConfidence"] = input.MinConfidence; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - if (input.Video !== undefined) { - bodyParams["Video"] = serializeAws_json1_1Video(input.Video, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartFaceDetectionRequest = ( input: StartFaceDetectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.FaceAttributes !== undefined) { - bodyParams["FaceAttributes"] = input.FaceAttributes; - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - if (input.Video !== undefined) { - bodyParams["Video"] = serializeAws_json1_1Video(input.Video, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartFaceSearchRequest = ( input: StartFaceSearchRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.CollectionId !== undefined) { - bodyParams["CollectionId"] = input.CollectionId; - } - if (input.FaceMatchThreshold !== undefined) { - bodyParams["FaceMatchThreshold"] = input.FaceMatchThreshold; - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - if (input.Video !== undefined) { - bodyParams["Video"] = serializeAws_json1_1Video(input.Video, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartLabelDetectionRequest = ( input: StartLabelDetectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.MinConfidence !== undefined) { - bodyParams["MinConfidence"] = input.MinConfidence; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - if (input.Video !== undefined) { - bodyParams["Video"] = serializeAws_json1_1Video(input.Video, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartPersonTrackingRequest = ( input: StartPersonTrackingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - if (input.Video !== undefined) { - bodyParams["Video"] = serializeAws_json1_1Video(input.Video, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartProjectVersionRequest = ( input: StartProjectVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MinInferenceUnits !== undefined) { - bodyParams["MinInferenceUnits"] = input.MinInferenceUnits; - } - if (input.ProjectVersionArn !== undefined) { - bodyParams["ProjectVersionArn"] = input.ProjectVersionArn; - } - return bodyParams; + return { + ...(input.MinInferenceUnits !== undefined && { + MinInferenceUnits: input.MinInferenceUnits + }), + ...(input.ProjectVersionArn !== undefined && { + ProjectVersionArn: input.ProjectVersionArn + }) + }; }; const serializeAws_json1_1StartStreamProcessorRequest = ( input: StartStreamProcessorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StopProjectVersionRequest = ( input: StopProjectVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProjectVersionArn !== undefined) { - bodyParams["ProjectVersionArn"] = input.ProjectVersionArn; - } - return bodyParams; + return { + ...(input.ProjectVersionArn !== undefined && { + ProjectVersionArn: input.ProjectVersionArn + }) + }; }; const serializeAws_json1_1StopStreamProcessorRequest = ( input: StopStreamProcessorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1StreamProcessorInput = ( input: StreamProcessorInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KinesisVideoStream !== undefined) { - bodyParams["KinesisVideoStream"] = serializeAws_json1_1KinesisVideoStream( - input.KinesisVideoStream, - context - ); - } - return bodyParams; + return { + ...(input.KinesisVideoStream !== undefined && { + KinesisVideoStream: serializeAws_json1_1KinesisVideoStream( + input.KinesisVideoStream, + context + ) + }) + }; }; const serializeAws_json1_1StreamProcessorOutput = ( input: StreamProcessorOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KinesisDataStream !== undefined) { - bodyParams["KinesisDataStream"] = serializeAws_json1_1KinesisDataStream( - input.KinesisDataStream, - context - ); - } - return bodyParams; + return { + ...(input.KinesisDataStream !== undefined && { + KinesisDataStream: serializeAws_json1_1KinesisDataStream( + input.KinesisDataStream, + context + ) + }) + }; }; const serializeAws_json1_1StreamProcessorSettings = ( input: StreamProcessorSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FaceSearch !== undefined) { - bodyParams["FaceSearch"] = serializeAws_json1_1FaceSearchSettings( - input.FaceSearch, - context - ); - } - return bodyParams; + return { + ...(input.FaceSearch !== undefined && { + FaceSearch: serializeAws_json1_1FaceSearchSettings( + input.FaceSearch, + context + ) + }) + }; }; const serializeAws_json1_1TestingData = ( input: TestingData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Assets !== undefined) { - bodyParams["Assets"] = serializeAws_json1_1Assets(input.Assets, context); - } - if (input.AutoCreate !== undefined) { - bodyParams["AutoCreate"] = input.AutoCreate; - } - return bodyParams; + return { + ...(input.Assets !== undefined && { + Assets: serializeAws_json1_1Assets(input.Assets, context) + }), + ...(input.AutoCreate !== undefined && { AutoCreate: input.AutoCreate }) + }; }; const serializeAws_json1_1TrainingData = ( input: TrainingData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Assets !== undefined) { - bodyParams["Assets"] = serializeAws_json1_1Assets(input.Assets, context); - } - return bodyParams; + return { + ...(input.Assets !== undefined && { + Assets: serializeAws_json1_1Assets(input.Assets, context) + }) + }; }; const serializeAws_json1_1VersionNames = ( @@ -7754,14 +7595,11 @@ const serializeAws_json1_1Video = ( input: Video, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Object !== undefined) { - bodyParams["S3Object"] = serializeAws_json1_1S3Object( - input.S3Object, - context - ); - } - return bodyParams; + return { + ...(input.S3Object !== undefined && { + S3Object: serializeAws_json1_1S3Object(input.S3Object, context) + }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( 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 ac88120bd15d..66d0ebbc5e5b 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 @@ -1040,119 +1040,101 @@ const serializeAws_json1_1DescribeReportCreationInput = ( input: DescribeReportCreationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetComplianceSummaryInput = ( input: GetComplianceSummaryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupBy !== undefined) { - bodyParams["GroupBy"] = serializeAws_json1_1GroupBy(input.GroupBy, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - if (input.RegionFilters !== undefined) { - bodyParams["RegionFilters"] = serializeAws_json1_1RegionFilterList( - input.RegionFilters, - context - ); - } - if (input.ResourceTypeFilters !== undefined) { - bodyParams[ - "ResourceTypeFilters" - ] = serializeAws_json1_1ResourceTypeFilterList( - input.ResourceTypeFilters, - context - ); - } - if (input.TagKeyFilters !== undefined) { - bodyParams["TagKeyFilters"] = serializeAws_json1_1TagKeyFilterList( - input.TagKeyFilters, - context - ); - } - if (input.TargetIdFilters !== undefined) { - bodyParams["TargetIdFilters"] = serializeAws_json1_1TargetIdFilterList( - input.TargetIdFilters, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1GetResourcesInput = ( input: GetResourcesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludeCompliantResources !== undefined) { - bodyParams["ExcludeCompliantResources"] = input.ExcludeCompliantResources; - } - if (input.IncludeComplianceDetails !== undefined) { - bodyParams["IncludeComplianceDetails"] = input.IncludeComplianceDetails; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - if (input.ResourceTypeFilters !== undefined) { - bodyParams[ - "ResourceTypeFilters" - ] = serializeAws_json1_1ResourceTypeFilterList( - input.ResourceTypeFilters, - context - ); - } - if (input.ResourcesPerPage !== undefined) { - bodyParams["ResourcesPerPage"] = input.ResourcesPerPage; - } - if (input.TagFilters !== undefined) { - bodyParams["TagFilters"] = serializeAws_json1_1TagFilterList( - input.TagFilters, - context - ); - } - if (input.TagsPerPage !== undefined) { - bodyParams["TagsPerPage"] = input.TagsPerPage; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetTagKeysInput = ( input: GetTagKeysInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && { + PaginationToken: input.PaginationToken + }) + }; }; const serializeAws_json1_1GetTagValuesInput = ( input: GetTagValuesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.PaginationToken !== undefined) { - bodyParams["PaginationToken"] = input.PaginationToken; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.PaginationToken !== undefined && { + PaginationToken: input.PaginationToken + }) + }; }; const serializeAws_json1_1GroupBy = ( @@ -1187,28 +1169,21 @@ const serializeAws_json1_1StartReportCreationInput = ( input: StartReportCreationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - return bodyParams; + return { + ...(input.S3Bucket !== undefined && { S3Bucket: input.S3Bucket }) + }; }; const serializeAws_json1_1TagFilter = ( input: TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1TagValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1TagValueList(input.Values, context) + }) + }; }; const serializeAws_json1_1TagFilterList = ( @@ -1246,17 +1221,17 @@ const serializeAws_json1_1TagResourcesInput = ( input: TagResourcesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNList !== undefined) { - bodyParams["ResourceARNList"] = serializeAws_json1_1ResourceARNList( - input.ResourceARNList, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagMap(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARNList !== undefined && { + ResourceARNList: serializeAws_json1_1ResourceARNList( + input.ResourceARNList, + context + ) + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagMap(input.Tags, context) + }) + }; }; const serializeAws_json1_1TagValueList = ( @@ -1277,20 +1252,17 @@ const serializeAws_json1_1UntagResourcesInput = ( input: UntagResourcesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARNList !== undefined) { - bodyParams["ResourceARNList"] = serializeAws_json1_1ResourceARNList( - input.ResourceARNList, - context - ); - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyListForUntag( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARNList !== undefined && { + ResourceARNList: serializeAws_json1_1ResourceARNList( + input.ResourceARNList, + context + ) + }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyListForUntag(input.TagKeys, context) + }) + }; }; const deserializeAws_json1_1ComplianceDetails = ( diff --git a/clients/client-resource-groups/protocols/Aws_restJson1_1.ts b/clients/client-resource-groups/protocols/Aws_restJson1_1.ts index 82664b14157a..5e1715c78da9 100644 --- a/clients/client-resource-groups/protocols/Aws_restJson1_1.ts +++ b/clients/client-resource-groups/protocols/Aws_restJson1_1.ts @@ -2085,17 +2085,12 @@ const serializeAws_restJson1_1GroupFilter = ( input: GroupFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1GroupFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1GroupFilterValues(input.Values, context) + }) + }; }; const serializeAws_restJson1_1GroupFilterList = ( @@ -2118,17 +2113,15 @@ const serializeAws_restJson1_1ResourceFilter = ( input: ResourceFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_restJson1_1ResourceFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_restJson1_1ResourceFilterValues( + input.Values, + context + ) + }) + }; }; const serializeAws_restJson1_1ResourceFilterList = ( @@ -2151,14 +2144,10 @@ const serializeAws_restJson1_1ResourceQuery = ( input: ResourceQuery, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Query !== undefined) { - bodyParams["Query"] = input.Query; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Query !== undefined && { Query: input.Query }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1TagKeyList = ( diff --git a/clients/client-robomaker/protocols/Aws_restJson1_1.ts b/clients/client-robomaker/protocols/Aws_restJson1_1.ts index d99362c492ba..f16c89dcda7e 100644 --- a/clients/client-robomaker/protocols/Aws_restJson1_1.ts +++ b/clients/client-robomaker/protocols/Aws_restJson1_1.ts @@ -5940,20 +5940,13 @@ const serializeAws_restJson1_1DataSourceConfig = ( input: DataSourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.s3Bucket !== undefined) { - bodyParams["s3Bucket"] = input.s3Bucket; - } - if (input.s3Keys !== undefined) { - bodyParams["s3Keys"] = serializeAws_restJson1_1S3Keys( - input.s3Keys, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), + ...(input.s3Keys !== undefined && { + s3Keys: serializeAws_restJson1_1S3Keys(input.s3Keys, context) + }) + }; }; const serializeAws_restJson1_1DataSourceConfigs = ( @@ -5969,20 +5962,18 @@ const serializeAws_restJson1_1DeploymentApplicationConfig = ( input: DeploymentApplicationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.application !== undefined) { - bodyParams["application"] = input.application; - } - if (input.applicationVersion !== undefined) { - bodyParams["applicationVersion"] = input.applicationVersion; - } - if (input.launchConfig !== undefined) { - bodyParams["launchConfig"] = serializeAws_restJson1_1DeploymentLaunchConfig( - input.launchConfig, - context - ); - } - return bodyParams; + return { + ...(input.application !== undefined && { application: input.application }), + ...(input.applicationVersion !== undefined && { + applicationVersion: input.applicationVersion + }), + ...(input.launchConfig !== undefined && { + launchConfig: serializeAws_restJson1_1DeploymentLaunchConfig( + input.launchConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1DeploymentApplicationConfigs = ( @@ -5998,53 +5989,45 @@ const serializeAws_restJson1_1DeploymentConfig = ( input: DeploymentConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.concurrentDeploymentPercentage !== undefined) { - bodyParams["concurrentDeploymentPercentage"] = - input.concurrentDeploymentPercentage; - } - if (input.downloadConditionFile !== undefined) { - bodyParams["downloadConditionFile"] = serializeAws_restJson1_1S3Object( - input.downloadConditionFile, - context - ); - } - if (input.failureThresholdPercentage !== undefined) { - bodyParams["failureThresholdPercentage"] = input.failureThresholdPercentage; - } - if (input.robotDeploymentTimeoutInSeconds !== undefined) { - bodyParams["robotDeploymentTimeoutInSeconds"] = - input.robotDeploymentTimeoutInSeconds; - } - return bodyParams; + return { + ...(input.concurrentDeploymentPercentage !== undefined && { + concurrentDeploymentPercentage: input.concurrentDeploymentPercentage + }), + ...(input.downloadConditionFile !== undefined && { + downloadConditionFile: serializeAws_restJson1_1S3Object( + input.downloadConditionFile, + context + ) + }), + ...(input.failureThresholdPercentage !== undefined && { + failureThresholdPercentage: input.failureThresholdPercentage + }), + ...(input.robotDeploymentTimeoutInSeconds !== undefined && { + robotDeploymentTimeoutInSeconds: input.robotDeploymentTimeoutInSeconds + }) + }; }; const serializeAws_restJson1_1DeploymentLaunchConfig = ( input: DeploymentLaunchConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentVariables !== undefined) { - bodyParams[ - "environmentVariables" - ] = serializeAws_restJson1_1EnvironmentVariableMap( - input.environmentVariables, - context - ); - } - if (input.launchFile !== undefined) { - bodyParams["launchFile"] = input.launchFile; - } - if (input.packageName !== undefined) { - bodyParams["packageName"] = input.packageName; - } - if (input.postLaunchFile !== undefined) { - bodyParams["postLaunchFile"] = input.postLaunchFile; - } - if (input.preLaunchFile !== undefined) { - bodyParams["preLaunchFile"] = input.preLaunchFile; - } - return bodyParams; + return { + ...(input.environmentVariables !== undefined && { + environmentVariables: serializeAws_restJson1_1EnvironmentVariableMap( + 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 + }) + }; }; const serializeAws_restJson1_1EnvironmentVariableMap = ( @@ -6061,17 +6044,12 @@ const serializeAws_restJson1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_restJson1_1FilterValues( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_restJson1_1FilterValues(input.values, context) + }) + }; }; const serializeAws_restJson1_1FilterValues = ( @@ -6092,86 +6070,72 @@ const serializeAws_restJson1_1LaunchConfig = ( input: LaunchConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.environmentVariables !== undefined) { - bodyParams[ - "environmentVariables" - ] = serializeAws_restJson1_1EnvironmentVariableMap( - input.environmentVariables, - context - ); - } - if (input.launchFile !== undefined) { - bodyParams["launchFile"] = input.launchFile; - } - if (input.packageName !== undefined) { - bodyParams["packageName"] = input.packageName; - } - if (input.portForwardingConfig !== undefined) { - bodyParams[ - "portForwardingConfig" - ] = serializeAws_restJson1_1PortForwardingConfig( - input.portForwardingConfig, - context - ); - } - return bodyParams; + return { + ...(input.environmentVariables !== undefined && { + environmentVariables: serializeAws_restJson1_1EnvironmentVariableMap( + input.environmentVariables, + context + ) + }), + ...(input.launchFile !== undefined && { launchFile: input.launchFile }), + ...(input.packageName !== undefined && { packageName: input.packageName }), + ...(input.portForwardingConfig !== undefined && { + portForwardingConfig: serializeAws_restJson1_1PortForwardingConfig( + input.portForwardingConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1LoggingConfig = ( input: LoggingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.recordAllRosTopics !== undefined) { - bodyParams["recordAllRosTopics"] = input.recordAllRosTopics; - } - return bodyParams; + return { + ...(input.recordAllRosTopics !== undefined && { + recordAllRosTopics: input.recordAllRosTopics + }) + }; }; const serializeAws_restJson1_1OutputLocation = ( input: OutputLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3Bucket !== undefined) { - bodyParams["s3Bucket"] = input.s3Bucket; - } - if (input.s3Prefix !== undefined) { - bodyParams["s3Prefix"] = input.s3Prefix; - } - return bodyParams; + return { + ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), + ...(input.s3Prefix !== undefined && { s3Prefix: input.s3Prefix }) + }; }; const serializeAws_restJson1_1PortForwardingConfig = ( input: PortForwardingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.portMappings !== undefined) { - bodyParams["portMappings"] = serializeAws_restJson1_1PortMappingList( - input.portMappings, - context - ); - } - return bodyParams; + return { + ...(input.portMappings !== undefined && { + portMappings: serializeAws_restJson1_1PortMappingList( + input.portMappings, + context + ) + }) + }; }; const serializeAws_restJson1_1PortMapping = ( input: PortMapping, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.applicationPort !== undefined) { - bodyParams["applicationPort"] = input.applicationPort; - } - if (input.enableOnPublicIp !== undefined) { - bodyParams["enableOnPublicIp"] = input.enableOnPublicIp; - } - if (input.jobPort !== undefined) { - bodyParams["jobPort"] = input.jobPort; - } - return bodyParams; + return { + ...(input.applicationPort !== undefined && { + applicationPort: input.applicationPort + }), + ...(input.enableOnPublicIp !== undefined && { + enableOnPublicIp: input.enableOnPublicIp + }), + ...(input.jobPort !== undefined && { jobPort: input.jobPort }) + }; }; const serializeAws_restJson1_1PortMappingList = ( @@ -6187,34 +6151,28 @@ const serializeAws_restJson1_1RenderingEngine = ( input: RenderingEngine, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_restJson1_1RobotApplicationConfig = ( input: RobotApplicationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.application !== undefined) { - bodyParams["application"] = input.application; - } - if (input.applicationVersion !== undefined) { - bodyParams["applicationVersion"] = input.applicationVersion; - } - if (input.launchConfig !== undefined) { - bodyParams["launchConfig"] = serializeAws_restJson1_1LaunchConfig( - input.launchConfig, - context - ); - } - return bodyParams; + return { + ...(input.application !== undefined && { application: input.application }), + ...(input.applicationVersion !== undefined && { + applicationVersion: input.applicationVersion + }), + ...(input.launchConfig !== undefined && { + launchConfig: serializeAws_restJson1_1LaunchConfig( + input.launchConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1RobotApplicationConfigs = ( @@ -6230,14 +6188,10 @@ const serializeAws_restJson1_1RobotSoftwareSuite = ( input: RobotSoftwareSuite, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_restJson1_1S3Keys = ( @@ -6251,17 +6205,11 @@ const serializeAws_restJson1_1S3Object = ( input: S3Object, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.etag !== undefined) { - bodyParams["etag"] = input.etag; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.etag !== undefined && { etag: input.etag }), + ...(input.key !== undefined && { key: input.key }) + }; }; const serializeAws_restJson1_1SecurityGroups = ( @@ -6275,20 +6223,18 @@ const serializeAws_restJson1_1SimulationApplicationConfig = ( input: SimulationApplicationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.application !== undefined) { - bodyParams["application"] = input.application; - } - if (input.applicationVersion !== undefined) { - bodyParams["applicationVersion"] = input.applicationVersion; - } - if (input.launchConfig !== undefined) { - bodyParams["launchConfig"] = serializeAws_restJson1_1LaunchConfig( - input.launchConfig, - context - ); - } - return bodyParams; + return { + ...(input.application !== undefined && { application: input.application }), + ...(input.applicationVersion !== undefined && { + applicationVersion: input.applicationVersion + }), + ...(input.launchConfig !== undefined && { + launchConfig: serializeAws_restJson1_1LaunchConfig( + input.launchConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1SimulationApplicationConfigs = ( @@ -6304,31 +6250,23 @@ const serializeAws_restJson1_1SimulationSoftwareSuite = ( input: SimulationSoftwareSuite, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_restJson1_1SourceConfig = ( input: SourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.architecture !== undefined) { - bodyParams["architecture"] = input.architecture; - } - if (input.s3Bucket !== undefined) { - bodyParams["s3Bucket"] = input.s3Bucket; - } - if (input.s3Key !== undefined) { - bodyParams["s3Key"] = input.s3Key; - } - return bodyParams; + return { + ...(input.architecture !== undefined && { + architecture: input.architecture + }), + ...(input.s3Bucket !== undefined && { s3Bucket: input.s3Bucket }), + ...(input.s3Key !== undefined && { s3Key: input.s3Key }) + }; }; const serializeAws_restJson1_1SourceConfigs = ( @@ -6361,23 +6299,20 @@ const serializeAws_restJson1_1VPCConfig = ( input: VPCConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.assignPublicIp !== undefined) { - bodyParams["assignPublicIp"] = input.assignPublicIp; - } - if (input.securityGroups !== undefined) { - bodyParams["securityGroups"] = serializeAws_restJson1_1SecurityGroups( - input.securityGroups, - context - ); - } - if (input.subnets !== undefined) { - bodyParams["subnets"] = serializeAws_restJson1_1Subnets( - input.subnets, - context - ); - } - return bodyParams; + return { + ...(input.assignPublicIp !== undefined && { + assignPublicIp: input.assignPublicIp + }), + ...(input.securityGroups !== undefined && { + securityGroups: serializeAws_restJson1_1SecurityGroups( + input.securityGroups, + context + ) + }), + ...(input.subnets !== undefined && { + subnets: serializeAws_restJson1_1Subnets(input.subnets, context) + }) + }; }; const deserializeAws_restJson1_1Arns = ( 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 628c23b6cd58..38d35e00bca5 100644 --- a/clients/client-route-53-domains/protocols/Aws_json1_1.ts +++ b/clients/client-route-53-domains/protocols/Aws_json1_1.ts @@ -2722,156 +2722,111 @@ const serializeAws_json1_1CheckDomainAvailabilityRequest = ( input: CheckDomainAvailabilityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.IdnLangCode !== undefined) { - bodyParams["IdnLangCode"] = input.IdnLangCode; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.IdnLangCode !== undefined && { IdnLangCode: input.IdnLangCode }) + }; }; const serializeAws_json1_1CheckDomainTransferabilityRequest = ( input: CheckDomainTransferabilityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthCode !== undefined) { - bodyParams["AuthCode"] = input.AuthCode; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.AuthCode !== undefined && { AuthCode: input.AuthCode }), + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1ContactDetail = ( input: ContactDetail, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressLine1 !== undefined) { - bodyParams["AddressLine1"] = input.AddressLine1; - } - if (input.AddressLine2 !== undefined) { - bodyParams["AddressLine2"] = input.AddressLine2; - } - if (input.City !== undefined) { - bodyParams["City"] = input.City; - } - if (input.ContactType !== undefined) { - bodyParams["ContactType"] = input.ContactType; - } - if (input.CountryCode !== undefined) { - bodyParams["CountryCode"] = input.CountryCode; - } - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.ExtraParams !== undefined) { - bodyParams["ExtraParams"] = serializeAws_json1_1ExtraParamList( - input.ExtraParams, - context - ); - } - if (input.Fax !== undefined) { - bodyParams["Fax"] = input.Fax; - } - if (input.FirstName !== undefined) { - bodyParams["FirstName"] = input.FirstName; - } - if (input.LastName !== undefined) { - bodyParams["LastName"] = input.LastName; - } - if (input.OrganizationName !== undefined) { - bodyParams["OrganizationName"] = input.OrganizationName; - } - if (input.PhoneNumber !== undefined) { - bodyParams["PhoneNumber"] = input.PhoneNumber; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - if (input.ZipCode !== undefined) { - bodyParams["ZipCode"] = input.ZipCode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteTagsForDomainRequest = ( input: DeleteTagsForDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.TagsToDelete !== undefined) { - bodyParams["TagsToDelete"] = serializeAws_json1_1TagKeyList( - input.TagsToDelete, - context - ); - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.TagsToDelete !== undefined && { + TagsToDelete: serializeAws_json1_1TagKeyList(input.TagsToDelete, context) + }) + }; }; const serializeAws_json1_1DisableDomainAutoRenewRequest = ( input: DisableDomainAutoRenewRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1DisableDomainTransferLockRequest = ( input: DisableDomainTransferLockRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1EnableDomainAutoRenewRequest = ( input: EnableDomainAutoRenewRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1EnableDomainTransferLockRequest = ( input: EnableDomainTransferLockRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1ExtraParam = ( input: ExtraParam, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ExtraParamList = ( @@ -2885,50 +2840,42 @@ const serializeAws_json1_1GetContactReachabilityStatusRequest = ( input: GetContactReachabilityStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1GetDomainDetailRequest = ( input: GetDomainDetailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1GetDomainSuggestionsRequest = ( input: GetDomainSuggestionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.OnlyAvailable !== undefined) { - bodyParams["OnlyAvailable"] = input.OnlyAvailable; - } - if (input.SuggestionCount !== undefined) { - bodyParams["SuggestionCount"] = input.SuggestionCount; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.OnlyAvailable !== undefined && { + OnlyAvailable: input.OnlyAvailable + }), + ...(input.SuggestionCount !== undefined && { + SuggestionCount: input.SuggestionCount + }) + }; }; const serializeAws_json1_1GetOperationDetailRequest = ( input: GetOperationDetailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OperationId !== undefined) { - bodyParams["OperationId"] = input.OperationId; - } - return bodyParams; + return { + ...(input.OperationId !== undefined && { OperationId: input.OperationId }) + }; }; const serializeAws_json1_1GlueIpList = ( @@ -2942,61 +2889,44 @@ const serializeAws_json1_1ListDomainsRequest = ( input: ListDomainsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - return bodyParams; + return { + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }) + }; }; const serializeAws_json1_1ListOperationsRequest = ( input: ListOperationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - if (input.SubmittedSince !== undefined) { - bodyParams["SubmittedSince"] = Math.round( - input.SubmittedSince.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.MaxItems !== undefined && { MaxItems: input.MaxItems }), + ...(input.SubmittedSince !== undefined && { + SubmittedSince: Math.round(input.SubmittedSince.getTime() / 1000) + }) + }; }; const serializeAws_json1_1ListTagsForDomainRequest = ( input: ListTagsForDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1Nameserver = ( input: Nameserver, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GlueIps !== undefined) { - bodyParams["GlueIps"] = serializeAws_json1_1GlueIpList( - input.GlueIps, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.GlueIps !== undefined && { + GlueIps: serializeAws_json1_1GlueIpList(input.GlueIps, context) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1NameserverList = ( @@ -3010,98 +2940,78 @@ const serializeAws_json1_1RegisterDomainRequest = ( input: RegisterDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminContact !== undefined) { - bodyParams["AdminContact"] = serializeAws_json1_1ContactDetail( - input.AdminContact, - context - ); - } - if (input.AutoRenew !== undefined) { - bodyParams["AutoRenew"] = input.AutoRenew; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.DurationInYears !== undefined) { - bodyParams["DurationInYears"] = input.DurationInYears; - } - if (input.IdnLangCode !== undefined) { - bodyParams["IdnLangCode"] = input.IdnLangCode; - } - if (input.PrivacyProtectAdminContact !== undefined) { - bodyParams["PrivacyProtectAdminContact"] = input.PrivacyProtectAdminContact; - } - if (input.PrivacyProtectRegistrantContact !== undefined) { - bodyParams["PrivacyProtectRegistrantContact"] = - input.PrivacyProtectRegistrantContact; - } - if (input.PrivacyProtectTechContact !== undefined) { - bodyParams["PrivacyProtectTechContact"] = input.PrivacyProtectTechContact; - } - if (input.RegistrantContact !== undefined) { - bodyParams["RegistrantContact"] = serializeAws_json1_1ContactDetail( - input.RegistrantContact, - context - ); - } - if (input.TechContact !== undefined) { - bodyParams["TechContact"] = serializeAws_json1_1ContactDetail( - input.TechContact, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RenewDomainRequest = ( input: RenewDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CurrentExpiryYear !== undefined) { - bodyParams["CurrentExpiryYear"] = input.CurrentExpiryYear; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.DurationInYears !== undefined) { - bodyParams["DurationInYears"] = input.DurationInYears; - } - return bodyParams; + return { + ...(input.CurrentExpiryYear !== undefined && { + CurrentExpiryYear: input.CurrentExpiryYear + }), + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.DurationInYears !== undefined && { + DurationInYears: input.DurationInYears + }) + }; }; const serializeAws_json1_1ResendContactReachabilityEmailRequest = ( input: ResendContactReachabilityEmailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domainName !== undefined) { - bodyParams["domainName"] = input.domainName; - } - return bodyParams; + return { + ...(input.domainName !== undefined && { domainName: input.domainName }) + }; }; const serializeAws_json1_1RetrieveDomainAuthCodeRequest = ( input: RetrieveDomainAuthCodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -3122,163 +3032,129 @@ const serializeAws_json1_1TransferDomainRequest = ( input: TransferDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminContact !== undefined) { - bodyParams["AdminContact"] = serializeAws_json1_1ContactDetail( - input.AdminContact, - context - ); - } - if (input.AuthCode !== undefined) { - bodyParams["AuthCode"] = input.AuthCode; - } - if (input.AutoRenew !== undefined) { - bodyParams["AutoRenew"] = input.AutoRenew; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.DurationInYears !== undefined) { - bodyParams["DurationInYears"] = input.DurationInYears; - } - if (input.IdnLangCode !== undefined) { - bodyParams["IdnLangCode"] = input.IdnLangCode; - } - if (input.Nameservers !== undefined) { - bodyParams["Nameservers"] = serializeAws_json1_1NameserverList( - input.Nameservers, - context - ); - } - if (input.PrivacyProtectAdminContact !== undefined) { - bodyParams["PrivacyProtectAdminContact"] = input.PrivacyProtectAdminContact; - } - if (input.PrivacyProtectRegistrantContact !== undefined) { - bodyParams["PrivacyProtectRegistrantContact"] = - input.PrivacyProtectRegistrantContact; - } - if (input.PrivacyProtectTechContact !== undefined) { - bodyParams["PrivacyProtectTechContact"] = input.PrivacyProtectTechContact; - } - if (input.RegistrantContact !== undefined) { - bodyParams["RegistrantContact"] = serializeAws_json1_1ContactDetail( - input.RegistrantContact, - context - ); - } - if (input.TechContact !== undefined) { - bodyParams["TechContact"] = serializeAws_json1_1ContactDetail( - input.TechContact, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateDomainContactPrivacyRequest = ( input: UpdateDomainContactPrivacyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminPrivacy !== undefined) { - bodyParams["AdminPrivacy"] = input.AdminPrivacy; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.RegistrantPrivacy !== undefined) { - bodyParams["RegistrantPrivacy"] = input.RegistrantPrivacy; - } - if (input.TechPrivacy !== undefined) { - bodyParams["TechPrivacy"] = input.TechPrivacy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateDomainContactRequest = ( input: UpdateDomainContactRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminContact !== undefined) { - bodyParams["AdminContact"] = serializeAws_json1_1ContactDetail( - input.AdminContact, - context - ); - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.RegistrantContact !== undefined) { - bodyParams["RegistrantContact"] = serializeAws_json1_1ContactDetail( - input.RegistrantContact, - context - ); - } - if (input.TechContact !== undefined) { - bodyParams["TechContact"] = serializeAws_json1_1ContactDetail( - input.TechContact, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateDomainNameserversRequest = ( input: UpdateDomainNameserversRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.FIAuthKey !== undefined) { - bodyParams["FIAuthKey"] = input.FIAuthKey; - } - if (input.Nameservers !== undefined) { - bodyParams["Nameservers"] = serializeAws_json1_1NameserverList( - input.Nameservers, - context - ); - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.FIAuthKey !== undefined && { FIAuthKey: input.FIAuthKey }), + ...(input.Nameservers !== undefined && { + Nameservers: serializeAws_json1_1NameserverList( + input.Nameservers, + context + ) + }) + }; }; const serializeAws_json1_1UpdateTagsForDomainRequest = ( input: UpdateTagsForDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.TagsToUpdate !== undefined) { - bodyParams["TagsToUpdate"] = serializeAws_json1_1TagList( - input.TagsToUpdate, - context - ); - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.TagsToUpdate !== undefined && { + TagsToUpdate: serializeAws_json1_1TagList(input.TagsToUpdate, context) + }) + }; }; const serializeAws_json1_1ViewBillingRequest = ( input: ViewBillingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.End !== undefined) { - bodyParams["End"] = Math.round(input.End.getTime() / 1000); - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - if (input.Start !== undefined) { - bodyParams["Start"] = Math.round(input.Start.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const deserializeAws_json1_1BillingRecord = ( diff --git a/clients/client-route53resolver/protocols/Aws_json1_1.ts b/clients/client-route53resolver/protocols/Aws_json1_1.ts index d77b71aad89f..7de63a19f6a5 100644 --- a/clients/client-route53resolver/protocols/Aws_json1_1.ts +++ b/clients/client-route53resolver/protocols/Aws_json1_1.ts @@ -3175,168 +3175,138 @@ const serializeAws_json1_1AssociateResolverEndpointIpAddressRequest = ( input: AssociateResolverEndpointIpAddressRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IpAddress !== undefined) { - bodyParams["IpAddress"] = serializeAws_json1_1IpAddressUpdate( - input.IpAddress, - context - ); - } - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - return bodyParams; + return { + ...(input.IpAddress !== undefined && { + IpAddress: serializeAws_json1_1IpAddressUpdate(input.IpAddress, context) + }), + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }) + }; }; const serializeAws_json1_1AssociateResolverRuleRequest = ( input: AssociateResolverRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ResolverRuleId !== undefined) { - bodyParams["ResolverRuleId"] = input.ResolverRuleId; - } - if (input.VPCId !== undefined) { - bodyParams["VPCId"] = input.VPCId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ResolverRuleId !== undefined && { + ResolverRuleId: input.ResolverRuleId + }), + ...(input.VPCId !== undefined && { VPCId: input.VPCId }) + }; }; const serializeAws_json1_1CreateResolverEndpointRequest = ( input: CreateResolverEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.Direction !== undefined) { - bodyParams["Direction"] = input.Direction; - } - if (input.IpAddresses !== undefined) { - bodyParams["IpAddresses"] = serializeAws_json1_1IpAddressesRequest( - input.IpAddresses, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateResolverRuleRequest = ( input: CreateResolverRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - if (input.RuleType !== undefined) { - bodyParams["RuleType"] = input.RuleType; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TargetIps !== undefined) { - bodyParams["TargetIps"] = serializeAws_json1_1TargetList( - input.TargetIps, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteResolverEndpointRequest = ( input: DeleteResolverEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - return bodyParams; + return { + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }) + }; }; const serializeAws_json1_1DeleteResolverRuleRequest = ( input: DeleteResolverRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResolverRuleId !== undefined) { - bodyParams["ResolverRuleId"] = input.ResolverRuleId; - } - return bodyParams; + return { + ...(input.ResolverRuleId !== undefined && { + ResolverRuleId: input.ResolverRuleId + }) + }; }; const serializeAws_json1_1DisassociateResolverEndpointIpAddressRequest = ( input: DisassociateResolverEndpointIpAddressRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IpAddress !== undefined) { - bodyParams["IpAddress"] = serializeAws_json1_1IpAddressUpdate( - input.IpAddress, - context - ); - } - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - return bodyParams; + return { + ...(input.IpAddress !== undefined && { + IpAddress: serializeAws_json1_1IpAddressUpdate(input.IpAddress, context) + }), + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }) + }; }; const serializeAws_json1_1DisassociateResolverRuleRequest = ( input: DisassociateResolverRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResolverRuleId !== undefined) { - bodyParams["ResolverRuleId"] = input.ResolverRuleId; - } - if (input.VPCId !== undefined) { - bodyParams["VPCId"] = input.VPCId; - } - return bodyParams; + return { + ...(input.ResolverRuleId !== undefined && { + ResolverRuleId: input.ResolverRuleId + }), + ...(input.VPCId !== undefined && { VPCId: input.VPCId }) + }; }; const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1FilterValues = ( @@ -3357,75 +3327,63 @@ const serializeAws_json1_1GetResolverEndpointRequest = ( input: GetResolverEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - return bodyParams; + return { + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }) + }; }; const serializeAws_json1_1GetResolverRuleAssociationRequest = ( input: GetResolverRuleAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResolverRuleAssociationId !== undefined) { - bodyParams["ResolverRuleAssociationId"] = input.ResolverRuleAssociationId; - } - return bodyParams; + return { + ...(input.ResolverRuleAssociationId !== undefined && { + ResolverRuleAssociationId: input.ResolverRuleAssociationId + }) + }; }; const serializeAws_json1_1GetResolverRulePolicyRequest = ( input: GetResolverRulePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }) + }; }; const serializeAws_json1_1GetResolverRuleRequest = ( input: GetResolverRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResolverRuleId !== undefined) { - bodyParams["ResolverRuleId"] = input.ResolverRuleId; - } - return bodyParams; + return { + ...(input.ResolverRuleId !== undefined && { + ResolverRuleId: input.ResolverRuleId + }) + }; }; const serializeAws_json1_1IpAddressRequest = ( input: IpAddressRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ip !== undefined) { - bodyParams["Ip"] = input.Ip; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - return bodyParams; + return { + ...(input.Ip !== undefined && { Ip: input.Ip }), + ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }) + }; }; const serializeAws_json1_1IpAddressUpdate = ( input: IpAddressUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ip !== undefined) { - bodyParams["Ip"] = input.Ip; - } - if (input.IpId !== undefined) { - bodyParams["IpId"] = input.IpId; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - return bodyParams; + return { + ...(input.Ip !== undefined && { Ip: input.Ip }), + ...(input.IpId !== undefined && { IpId: input.IpId }), + ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }) + }; }; const serializeAws_json1_1IpAddressesRequest = ( @@ -3441,119 +3399,90 @@ const serializeAws_json1_1ListResolverEndpointIpAddressesRequest = ( input: ListResolverEndpointIpAddressesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }) + }; }; const serializeAws_json1_1ListResolverEndpointsRequest = ( input: ListResolverEndpointsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListResolverRuleAssociationsRequest = ( input: ListResolverRuleAssociationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListResolverRulesRequest = ( input: ListResolverRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1Filters(input.Filters, context); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1Filters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1PutResolverRulePolicyRequest = ( input: PutResolverRulePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.ResolverRulePolicy !== undefined) { - bodyParams["ResolverRulePolicy"] = input.ResolverRulePolicy; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.ResolverRulePolicy !== undefined && { + ResolverRulePolicy: input.ResolverRulePolicy + }) + }; }; const serializeAws_json1_1ResolverRuleConfig = ( input: ResolverRuleConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - if (input.TargetIps !== undefined) { - bodyParams["TargetIps"] = serializeAws_json1_1TargetList( - input.TargetIps, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }), + ...(input.TargetIps !== undefined && { + TargetIps: serializeAws_json1_1TargetList(input.TargetIps, context) + }) + }; }; const serializeAws_json1_1SecurityGroupIds = ( @@ -3564,14 +3493,10 @@ const serializeAws_json1_1SecurityGroupIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -3592,28 +3517,22 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TargetAddress = ( input: TargetAddress, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ip !== undefined) { - bodyParams["Ip"] = input.Ip; - } - if (input.Port !== undefined) { - bodyParams["Port"] = input.Port; - } - return bodyParams; + return { + ...(input.Ip !== undefined && { Ip: input.Ip }), + ...(input.Port !== undefined && { Port: input.Port }) + }; }; const serializeAws_json1_1TargetList = ( @@ -3627,48 +3546,38 @@ const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateResolverEndpointRequest = ( input: UpdateResolverEndpointRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ResolverEndpointId !== undefined) { - bodyParams["ResolverEndpointId"] = input.ResolverEndpointId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ResolverEndpointId !== undefined && { + ResolverEndpointId: input.ResolverEndpointId + }) + }; }; const serializeAws_json1_1UpdateResolverRuleRequest = ( input: UpdateResolverRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Config !== undefined) { - bodyParams["Config"] = serializeAws_json1_1ResolverRuleConfig( - input.Config, - context - ); - } - if (input.ResolverRuleId !== undefined) { - bodyParams["ResolverRuleId"] = input.ResolverRuleId; - } - return bodyParams; + return { + ...(input.Config !== undefined && { + Config: serializeAws_json1_1ResolverRuleConfig(input.Config, context) + }), + ...(input.ResolverRuleId !== undefined && { + ResolverRuleId: input.ResolverRuleId + }) + }; }; const deserializeAws_json1_1AssociateResolverEndpointIpAddressResponse = ( diff --git a/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1_1.ts b/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1_1.ts index 1618f3777ae5..40ba98f1f304 100644 --- a/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1_1.ts +++ b/clients/client-sagemaker-a2i-runtime/protocols/Aws_restJson1_1.ts @@ -836,27 +836,25 @@ const serializeAws_restJson1_1HumanLoopInputContent = ( input: HumanLoopInputContent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputContent !== undefined) { - bodyParams["InputContent"] = input.InputContent; - } - return bodyParams; + return { + ...(input.InputContent !== undefined && { + InputContent: input.InputContent + }) + }; }; const serializeAws_restJson1_1HumanReviewDataAttributes = ( input: HumanReviewDataAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContentClassifiers !== undefined) { - bodyParams[ - "ContentClassifiers" - ] = serializeAws_restJson1_1ContentClassifiers( - input.ContentClassifiers, - context - ); - } - return bodyParams; + return { + ...(input.ContentClassifiers !== undefined && { + ContentClassifiers: serializeAws_restJson1_1ContentClassifiers( + input.ContentClassifiers, + context + ) + }) + }; }; const deserializeAws_restJson1_1HumanLoopActivationReason = ( diff --git a/clients/client-sagemaker/protocols/Aws_json1_1.ts b/clients/client-sagemaker/protocols/Aws_json1_1.ts index 862e4f9984fa..b3348280ae12 100644 --- a/clients/client-sagemaker/protocols/Aws_json1_1.ts +++ b/clients/client-sagemaker/protocols/Aws_json1_1.ts @@ -10936,14 +10936,12 @@ const serializeAws_json1_1AddTagsInput = ( input: AddTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls = ( @@ -10957,54 +10955,47 @@ const serializeAws_json1_1AlgorithmSpecification = ( input: AlgorithmSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmName !== undefined) { - bodyParams["AlgorithmName"] = input.AlgorithmName; - } - if (input.EnableSageMakerMetricsTimeSeries !== undefined) { - bodyParams["EnableSageMakerMetricsTimeSeries"] = - input.EnableSageMakerMetricsTimeSeries; - } - if (input.MetricDefinitions !== undefined) { - bodyParams["MetricDefinitions"] = serializeAws_json1_1MetricDefinitionList( - input.MetricDefinitions, - context - ); - } - if (input.TrainingImage !== undefined) { - bodyParams["TrainingImage"] = input.TrainingImage; - } - if (input.TrainingInputMode !== undefined) { - bodyParams["TrainingInputMode"] = input.TrainingInputMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1AlgorithmValidationProfile = ( input: AlgorithmValidationProfile, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProfileName !== undefined) { - bodyParams["ProfileName"] = input.ProfileName; - } - if (input.TrainingJobDefinition !== undefined) { - bodyParams[ - "TrainingJobDefinition" - ] = serializeAws_json1_1TrainingJobDefinition( - input.TrainingJobDefinition, - context - ); - } - if (input.TransformJobDefinition !== undefined) { - bodyParams[ - "TransformJobDefinition" - ] = serializeAws_json1_1TransformJobDefinition( - input.TransformJobDefinition, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1AlgorithmValidationProfiles = ( @@ -11020,68 +11011,61 @@ const serializeAws_json1_1AlgorithmValidationSpecification = ( input: AlgorithmValidationSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ValidationProfiles !== undefined) { - bodyParams[ - "ValidationProfiles" - ] = serializeAws_json1_1AlgorithmValidationProfiles( - input.ValidationProfiles, - context - ); - } - if (input.ValidationRole !== undefined) { - bodyParams["ValidationRole"] = input.ValidationRole; - } - return bodyParams; + return { + ...(input.ValidationProfiles !== undefined && { + ValidationProfiles: serializeAws_json1_1AlgorithmValidationProfiles( + input.ValidationProfiles, + context + ) + }), + ...(input.ValidationRole !== undefined && { + ValidationRole: input.ValidationRole + }) + }; }; const serializeAws_json1_1AnnotationConsolidationConfig = ( input: AnnotationConsolidationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AnnotationConsolidationLambdaArn !== undefined) { - bodyParams["AnnotationConsolidationLambdaArn"] = - input.AnnotationConsolidationLambdaArn; - } - return bodyParams; + return { + ...(input.AnnotationConsolidationLambdaArn !== undefined && { + AnnotationConsolidationLambdaArn: input.AnnotationConsolidationLambdaArn + }) + }; }; const serializeAws_json1_1AppSpecification = ( input: AppSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerArguments !== undefined) { - bodyParams["ContainerArguments"] = serializeAws_json1_1ContainerArguments( - input.ContainerArguments, - context - ); - } - if (input.ContainerEntrypoint !== undefined) { - bodyParams["ContainerEntrypoint"] = serializeAws_json1_1ContainerEntrypoint( - input.ContainerEntrypoint, - context - ); - } - if (input.ImageUri !== undefined) { - bodyParams["ImageUri"] = input.ImageUri; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AssociateTrialComponentRequest = ( input: AssociateTrialComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrialComponentName !== undefined) { - bodyParams["TrialComponentName"] = input.TrialComponentName; - } - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.TrialComponentName !== undefined && { + TrialComponentName: input.TrialComponentName + }), + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1AttributeNames = ( @@ -11095,34 +11079,34 @@ const serializeAws_json1_1AutoMLChannel = ( input: AutoMLChannel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompressionType !== undefined) { - bodyParams["CompressionType"] = input.CompressionType; - } - if (input.DataSource !== undefined) { - bodyParams["DataSource"] = serializeAws_json1_1AutoMLDataSource( - input.DataSource, - context - ); - } - if (input.TargetAttributeName !== undefined) { - bodyParams["TargetAttributeName"] = input.TargetAttributeName; - } - return bodyParams; + return { + ...(input.CompressionType !== undefined && { + CompressionType: input.CompressionType + }), + ...(input.DataSource !== undefined && { + DataSource: serializeAws_json1_1AutoMLDataSource( + input.DataSource, + context + ) + }), + ...(input.TargetAttributeName !== undefined && { + TargetAttributeName: input.TargetAttributeName + }) + }; }; const serializeAws_json1_1AutoMLDataSource = ( input: AutoMLDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3DataSource !== undefined) { - bodyParams["S3DataSource"] = serializeAws_json1_1AutoMLS3DataSource( - input.S3DataSource, - context - ); - } - return bodyParams; + return { + ...(input.S3DataSource !== undefined && { + S3DataSource: serializeAws_json1_1AutoMLS3DataSource( + input.S3DataSource, + context + ) + }) + }; }; const serializeAws_json1_1AutoMLInputDataConfig = ( @@ -11136,132 +11120,115 @@ const serializeAws_json1_1AutoMLJobCompletionCriteria = ( input: AutoMLJobCompletionCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxAutoMLJobRuntimeInSeconds !== undefined) { - bodyParams["MaxAutoMLJobRuntimeInSeconds"] = - input.MaxAutoMLJobRuntimeInSeconds; - } - if (input.MaxCandidates !== undefined) { - bodyParams["MaxCandidates"] = input.MaxCandidates; - } - if (input.MaxRuntimePerTrainingJobInSeconds !== undefined) { - bodyParams["MaxRuntimePerTrainingJobInSeconds"] = - input.MaxRuntimePerTrainingJobInSeconds; - } - return bodyParams; + return { + ...(input.MaxAutoMLJobRuntimeInSeconds !== undefined && { + MaxAutoMLJobRuntimeInSeconds: input.MaxAutoMLJobRuntimeInSeconds + }), + ...(input.MaxCandidates !== undefined && { + MaxCandidates: input.MaxCandidates + }), + ...(input.MaxRuntimePerTrainingJobInSeconds !== undefined && { + MaxRuntimePerTrainingJobInSeconds: input.MaxRuntimePerTrainingJobInSeconds + }) + }; }; const serializeAws_json1_1AutoMLJobConfig = ( input: AutoMLJobConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompletionCriteria !== undefined) { - bodyParams[ - "CompletionCriteria" - ] = serializeAws_json1_1AutoMLJobCompletionCriteria( - input.CompletionCriteria, - context - ); - } - if (input.SecurityConfig !== undefined) { - bodyParams["SecurityConfig"] = serializeAws_json1_1AutoMLSecurityConfig( - input.SecurityConfig, - context - ); - } - return bodyParams; + return { + ...(input.CompletionCriteria !== undefined && { + CompletionCriteria: serializeAws_json1_1AutoMLJobCompletionCriteria( + input.CompletionCriteria, + context + ) + }), + ...(input.SecurityConfig !== undefined && { + SecurityConfig: serializeAws_json1_1AutoMLSecurityConfig( + input.SecurityConfig, + context + ) + }) + }; }; const serializeAws_json1_1AutoMLJobObjective = ( input: AutoMLJobObjective, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - return bodyParams; + return { + ...(input.MetricName !== undefined && { MetricName: input.MetricName }) + }; }; const serializeAws_json1_1AutoMLOutputDataConfig = ( input: AutoMLOutputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && { + S3OutputPath: input.S3OutputPath + }) + }; }; const serializeAws_json1_1AutoMLS3DataSource = ( input: AutoMLS3DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3DataType !== undefined) { - bodyParams["S3DataType"] = input.S3DataType; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3DataType !== undefined && { S3DataType: input.S3DataType }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1AutoMLSecurityConfig = ( input: AutoMLSecurityConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnableInterContainerTrafficEncryption !== undefined) { - bodyParams["EnableInterContainerTrafficEncryption"] = - input.EnableInterContainerTrafficEncryption; - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + return { + ...(input.EnableInterContainerTrafficEncryption !== undefined && { + EnableInterContainerTrafficEncryption: + input.EnableInterContainerTrafficEncryption + }), + ...(input.VolumeKmsKeyId !== undefined && { + VolumeKmsKeyId: input.VolumeKmsKeyId + }), + ...(input.VpcConfig !== undefined && { + VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) + }) + }; }; const serializeAws_json1_1CaptureContentTypeHeader = ( input: CaptureContentTypeHeader, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CsvContentTypes !== undefined) { - bodyParams["CsvContentTypes"] = serializeAws_json1_1CsvContentTypes( - input.CsvContentTypes, - context - ); - } - if (input.JsonContentTypes !== undefined) { - bodyParams["JsonContentTypes"] = serializeAws_json1_1JsonContentTypes( - input.JsonContentTypes, - context - ); - } - return bodyParams; + return { + ...(input.CsvContentTypes !== undefined && { + CsvContentTypes: serializeAws_json1_1CsvContentTypes( + input.CsvContentTypes, + context + ) + }), + ...(input.JsonContentTypes !== undefined && { + JsonContentTypes: serializeAws_json1_1JsonContentTypes( + input.JsonContentTypes, + context + ) + }) + }; }; const serializeAws_json1_1CaptureOption = ( input: CaptureOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptureMode !== undefined) { - bodyParams["CaptureMode"] = input.CaptureMode; - } - return bodyParams; + return { + ...(input.CaptureMode !== undefined && { CaptureMode: input.CaptureMode }) + }; }; const serializeAws_json1_1CaptureOptionList = ( @@ -11275,31 +11242,23 @@ const serializeAws_json1_1CategoricalParameterRange = ( input: CategoricalParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ParameterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1ParameterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1CategoricalParameterRangeSpecification = ( input: CategoricalParameterRangeSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ParameterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Values !== undefined && { + Values: serializeAws_json1_1ParameterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1CategoricalParameterRanges = ( @@ -11315,72 +11274,55 @@ const serializeAws_json1_1Channel = ( input: Channel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChannelName !== undefined) { - bodyParams["ChannelName"] = input.ChannelName; - } - if (input.CompressionType !== undefined) { - bodyParams["CompressionType"] = input.CompressionType; - } - if (input.ContentType !== undefined) { - bodyParams["ContentType"] = input.ContentType; - } - if (input.DataSource !== undefined) { - bodyParams["DataSource"] = serializeAws_json1_1DataSource( - input.DataSource, - context - ); - } - if (input.InputMode !== undefined) { - bodyParams["InputMode"] = input.InputMode; - } - if (input.RecordWrapperType !== undefined) { - bodyParams["RecordWrapperType"] = input.RecordWrapperType; - } - if (input.ShuffleConfig !== undefined) { - bodyParams["ShuffleConfig"] = serializeAws_json1_1ShuffleConfig( - input.ShuffleConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ChannelSpecification = ( input: ChannelSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IsRequired !== undefined) { - bodyParams["IsRequired"] = input.IsRequired; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SupportedCompressionTypes !== undefined) { - bodyParams[ - "SupportedCompressionTypes" - ] = serializeAws_json1_1CompressionTypes( - input.SupportedCompressionTypes, - context - ); - } - if (input.SupportedContentTypes !== undefined) { - bodyParams["SupportedContentTypes"] = serializeAws_json1_1ContentTypes( - input.SupportedContentTypes, - context - ); - } - if (input.SupportedInputModes !== undefined) { - bodyParams["SupportedInputModes"] = serializeAws_json1_1InputModes( - input.SupportedInputModes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ChannelSpecifications = ( @@ -11396,14 +11338,10 @@ const serializeAws_json1_1CheckpointConfig = ( input: CheckpointConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1Cidrs = ( @@ -11417,36 +11355,28 @@ const serializeAws_json1_1CognitoMemberDefinition = ( input: CognitoMemberDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientId !== undefined) { - bodyParams["ClientId"] = input.ClientId; - } - if (input.UserGroup !== undefined) { - bodyParams["UserGroup"] = input.UserGroup; - } - if (input.UserPool !== undefined) { - bodyParams["UserPool"] = input.UserPool; - } - return bodyParams; + return { + ...(input.ClientId !== undefined && { ClientId: input.ClientId }), + ...(input.UserGroup !== undefined && { UserGroup: input.UserGroup }), + ...(input.UserPool !== undefined && { UserPool: input.UserPool }) + }; }; const serializeAws_json1_1CollectionConfiguration = ( input: CollectionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionName !== undefined) { - bodyParams["CollectionName"] = input.CollectionName; - } - if (input.CollectionParameters !== undefined) { - bodyParams[ - "CollectionParameters" - ] = serializeAws_json1_1CollectionParameters( - input.CollectionParameters, - context - ); - } - return bodyParams; + return { + ...(input.CollectionName !== undefined && { + CollectionName: input.CollectionName + }), + ...(input.CollectionParameters !== undefined && { + CollectionParameters: serializeAws_json1_1CollectionParameters( + input.CollectionParameters, + context + ) + }) + }; }; const serializeAws_json1_1CollectionConfigurations = ( @@ -11486,29 +11416,25 @@ const serializeAws_json1_1ContainerDefinition = ( input: ContainerDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerHostname !== undefined) { - bodyParams["ContainerHostname"] = input.ContainerHostname; - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1EnvironmentMap( - input.Environment, - context - ); - } - if (input.Image !== undefined) { - bodyParams["Image"] = input.Image; - } - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - if (input.ModelDataUrl !== undefined) { - bodyParams["ModelDataUrl"] = input.ModelDataUrl; - } - if (input.ModelPackageName !== undefined) { - bodyParams["ModelPackageName"] = input.ModelPackageName; - } - return bodyParams; + return { + ...(input.ContainerHostname !== undefined && { + ContainerHostname: input.ContainerHostname + }), + ...(input.Environment !== undefined && { + Environment: serializeAws_json1_1EnvironmentMap( + input.Environment, + context + ) + }), + ...(input.Image !== undefined && { Image: input.Image }), + ...(input.Mode !== undefined && { Mode: input.Mode }), + ...(input.ModelDataUrl !== undefined && { + ModelDataUrl: input.ModelDataUrl + }), + ...(input.ModelPackageName !== undefined && { + ModelPackageName: input.ModelPackageName + }) + }; }; const serializeAws_json1_1ContainerDefinitionList = ( @@ -11545,34 +11471,22 @@ const serializeAws_json1_1ContinuousParameterRange = ( input: ContinuousParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ScalingType !== undefined) { - bodyParams["ScalingType"] = input.ScalingType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ContinuousParameterRangeSpecification = ( input: ContinuousParameterRangeSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - return bodyParams; + return { + ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && { MinValue: input.MinValue }) + }; }; const serializeAws_json1_1ContinuousParameterRanges = ( @@ -11588,1019 +11502,890 @@ const serializeAws_json1_1CreateAlgorithmInput = ( input: CreateAlgorithmInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmDescription !== undefined) { - bodyParams["AlgorithmDescription"] = input.AlgorithmDescription; - } - if (input.AlgorithmName !== undefined) { - bodyParams["AlgorithmName"] = input.AlgorithmName; - } - if (input.CertifyForMarketplace !== undefined) { - bodyParams["CertifyForMarketplace"] = input.CertifyForMarketplace; - } - if (input.InferenceSpecification !== undefined) { - bodyParams[ - "InferenceSpecification" - ] = serializeAws_json1_1InferenceSpecification( - input.InferenceSpecification, - context - ); - } - if (input.TrainingSpecification !== undefined) { - bodyParams[ - "TrainingSpecification" - ] = serializeAws_json1_1TrainingSpecification( - input.TrainingSpecification, - context - ); - } - if (input.ValidationSpecification !== undefined) { - bodyParams[ - "ValidationSpecification" - ] = serializeAws_json1_1AlgorithmValidationSpecification( - input.ValidationSpecification, - context - ); - } - return bodyParams; + 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.TrainingSpecification !== undefined && { + TrainingSpecification: serializeAws_json1_1TrainingSpecification( + input.TrainingSpecification, + context + ) + }), + ...(input.ValidationSpecification !== undefined && { + ValidationSpecification: serializeAws_json1_1AlgorithmValidationSpecification( + input.ValidationSpecification, + context + ) + }) + }; }; const serializeAws_json1_1CreateAppRequest = ( input: CreateAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppName !== undefined) { - bodyParams["AppName"] = input.AppName; - } - if (input.AppType !== undefined) { - bodyParams["AppType"] = input.AppType; - } - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.ResourceSpec !== undefined) { - bodyParams["ResourceSpec"] = serializeAws_json1_1ResourceSpec( - input.ResourceSpec, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateAutoMLJobRequest = ( input: CreateAutoMLJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoMLJobConfig !== undefined) { - bodyParams["AutoMLJobConfig"] = serializeAws_json1_1AutoMLJobConfig( - input.AutoMLJobConfig, - context - ); - } - if (input.AutoMLJobName !== undefined) { - bodyParams["AutoMLJobName"] = input.AutoMLJobName; - } - if (input.AutoMLJobObjective !== undefined) { - bodyParams["AutoMLJobObjective"] = serializeAws_json1_1AutoMLJobObjective( - input.AutoMLJobObjective, - context - ); - } - if (input.GenerateCandidateDefinitionsOnly !== undefined) { - bodyParams["GenerateCandidateDefinitionsOnly"] = - input.GenerateCandidateDefinitionsOnly; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1AutoMLInputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1AutoMLOutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.ProblemType !== undefined) { - bodyParams["ProblemType"] = input.ProblemType; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateCodeRepositoryInput = ( input: CreateCodeRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeRepositoryName !== undefined) { - bodyParams["CodeRepositoryName"] = input.CodeRepositoryName; - } - if (input.GitConfig !== undefined) { - bodyParams["GitConfig"] = serializeAws_json1_1GitConfig( - input.GitConfig, - context - ); - } - return bodyParams; + return { + ...(input.CodeRepositoryName !== undefined && { + CodeRepositoryName: input.CodeRepositoryName + }), + ...(input.GitConfig !== undefined && { + GitConfig: serializeAws_json1_1GitConfig(input.GitConfig, context) + }) + }; }; const serializeAws_json1_1CreateCompilationJobRequest = ( input: CreateCompilationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompilationJobName !== undefined) { - bodyParams["CompilationJobName"] = input.CompilationJobName; - } - if (input.InputConfig !== undefined) { - bodyParams["InputConfig"] = serializeAws_json1_1InputConfig( - input.InputConfig, - context - ); - } - if (input.OutputConfig !== undefined) { - bodyParams["OutputConfig"] = serializeAws_json1_1OutputConfig( - input.OutputConfig, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StoppingCondition !== undefined) { - bodyParams["StoppingCondition"] = serializeAws_json1_1StoppingCondition( - input.StoppingCondition, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateDomainRequest = ( input: CreateDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AuthMode !== undefined) { - bodyParams["AuthMode"] = input.AuthMode; - } - if (input.DefaultUserSettings !== undefined) { - bodyParams["DefaultUserSettings"] = serializeAws_json1_1UserSettings( - input.DefaultUserSettings, - context - ); - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.HomeEfsFileSystemKmsKeyId !== undefined) { - bodyParams["HomeEfsFileSystemKmsKeyId"] = input.HomeEfsFileSystemKmsKeyId; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1Subnets( - input.SubnetIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + return { + ...(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.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 }) + }; }; const serializeAws_json1_1CreateEndpointConfigInput = ( input: CreateEndpointConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataCaptureConfig !== undefined) { - bodyParams["DataCaptureConfig"] = serializeAws_json1_1DataCaptureConfig( - input.DataCaptureConfig, - context - ); - } - if (input.EndpointConfigName !== undefined) { - bodyParams["EndpointConfigName"] = input.EndpointConfigName; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.ProductionVariants !== undefined) { - bodyParams[ - "ProductionVariants" - ] = serializeAws_json1_1ProductionVariantList( - input.ProductionVariants, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateEndpointInput = ( input: CreateEndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointConfigName !== undefined) { - bodyParams["EndpointConfigName"] = input.EndpointConfigName; - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.EndpointConfigName !== undefined && { + EndpointConfigName: input.EndpointConfigName + }), + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateExperimentRequest = ( input: CreateExperimentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateFlowDefinitionRequest = ( input: CreateFlowDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FlowDefinitionName !== undefined) { - bodyParams["FlowDefinitionName"] = input.FlowDefinitionName; - } - if (input.HumanLoopActivationConfig !== undefined) { - bodyParams[ - "HumanLoopActivationConfig" - ] = serializeAws_json1_1HumanLoopActivationConfig( - input.HumanLoopActivationConfig, - context - ); - } - if (input.HumanLoopConfig !== undefined) { - bodyParams["HumanLoopConfig"] = serializeAws_json1_1HumanLoopConfig( - input.HumanLoopConfig, - context - ); - } - if (input.OutputConfig !== undefined) { - bodyParams["OutputConfig"] = serializeAws_json1_1FlowDefinitionOutputConfig( - input.OutputConfig, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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.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) + }) + }; }; const serializeAws_json1_1CreateHumanTaskUiRequest = ( input: CreateHumanTaskUiRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanTaskUiName !== undefined) { - bodyParams["HumanTaskUiName"] = input.HumanTaskUiName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.UiTemplate !== undefined) { - bodyParams["UiTemplate"] = serializeAws_json1_1UiTemplate( - input.UiTemplate, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateHyperParameterTuningJobRequest = ( input: CreateHyperParameterTuningJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameterTuningJobConfig !== undefined) { - bodyParams[ - "HyperParameterTuningJobConfig" - ] = serializeAws_json1_1HyperParameterTuningJobConfig( - input.HyperParameterTuningJobConfig, - context - ); - } - if (input.HyperParameterTuningJobName !== undefined) { - bodyParams["HyperParameterTuningJobName"] = - input.HyperParameterTuningJobName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TrainingJobDefinition !== undefined) { - bodyParams[ - "TrainingJobDefinition" - ] = serializeAws_json1_1HyperParameterTrainingJobDefinition( - input.TrainingJobDefinition, - context - ); - } - if (input.TrainingJobDefinitions !== undefined) { - bodyParams[ - "TrainingJobDefinitions" - ] = serializeAws_json1_1HyperParameterTrainingJobDefinitions( - input.TrainingJobDefinitions, - context - ); - } - if (input.WarmStartConfig !== undefined) { - bodyParams[ - "WarmStartConfig" - ] = serializeAws_json1_1HyperParameterTuningJobWarmStartConfig( - input.WarmStartConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateLabelingJobRequest = ( input: CreateLabelingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanTaskConfig !== undefined) { - bodyParams["HumanTaskConfig"] = serializeAws_json1_1HumanTaskConfig( - input.HumanTaskConfig, - context - ); - } - if (input.InputConfig !== undefined) { - bodyParams["InputConfig"] = serializeAws_json1_1LabelingJobInputConfig( - input.InputConfig, - context - ); - } - if (input.LabelAttributeName !== undefined) { - bodyParams["LabelAttributeName"] = input.LabelAttributeName; - } - if (input.LabelCategoryConfigS3Uri !== undefined) { - bodyParams["LabelCategoryConfigS3Uri"] = input.LabelCategoryConfigS3Uri; - } - if (input.LabelingJobAlgorithmsConfig !== undefined) { - bodyParams[ - "LabelingJobAlgorithmsConfig" - ] = serializeAws_json1_1LabelingJobAlgorithmsConfig( - input.LabelingJobAlgorithmsConfig, - context - ); - } - if (input.LabelingJobName !== undefined) { - bodyParams["LabelingJobName"] = input.LabelingJobName; - } - if (input.OutputConfig !== undefined) { - bodyParams["OutputConfig"] = serializeAws_json1_1LabelingJobOutputConfig( - input.OutputConfig, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StoppingConditions !== undefined) { - bodyParams[ - "StoppingConditions" - ] = serializeAws_json1_1LabelingJobStoppingConditions( - input.StoppingConditions, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateModelInput = ( input: CreateModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Containers !== undefined) { - bodyParams["Containers"] = serializeAws_json1_1ContainerDefinitionList( - input.Containers, - context - ); - } - if (input.EnableNetworkIsolation !== undefined) { - bodyParams["EnableNetworkIsolation"] = input.EnableNetworkIsolation; - } - if (input.ExecutionRoleArn !== undefined) { - bodyParams["ExecutionRoleArn"] = input.ExecutionRoleArn; - } - if (input.ModelName !== undefined) { - bodyParams["ModelName"] = input.ModelName; - } - if (input.PrimaryContainer !== undefined) { - bodyParams["PrimaryContainer"] = serializeAws_json1_1ContainerDefinition( - input.PrimaryContainer, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateModelPackageInput = ( input: CreateModelPackageInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CertifyForMarketplace !== undefined) { - bodyParams["CertifyForMarketplace"] = input.CertifyForMarketplace; - } - if (input.InferenceSpecification !== undefined) { - bodyParams[ - "InferenceSpecification" - ] = serializeAws_json1_1InferenceSpecification( - input.InferenceSpecification, - context - ); - } - if (input.ModelPackageDescription !== undefined) { - bodyParams["ModelPackageDescription"] = input.ModelPackageDescription; - } - if (input.ModelPackageName !== undefined) { - bodyParams["ModelPackageName"] = input.ModelPackageName; - } - if (input.SourceAlgorithmSpecification !== undefined) { - bodyParams[ - "SourceAlgorithmSpecification" - ] = serializeAws_json1_1SourceAlgorithmSpecification( - input.SourceAlgorithmSpecification, - context - ); - } - if (input.ValidationSpecification !== undefined) { - bodyParams[ - "ValidationSpecification" - ] = serializeAws_json1_1ModelPackageValidationSpecification( - input.ValidationSpecification, - context - ); - } - return bodyParams; + return { + ...(input.CertifyForMarketplace !== undefined && { + CertifyForMarketplace: input.CertifyForMarketplace + }), + ...(input.InferenceSpecification !== undefined && { + InferenceSpecification: serializeAws_json1_1InferenceSpecification( + input.InferenceSpecification, + context + ) + }), + ...(input.ModelPackageDescription !== undefined && { + ModelPackageDescription: input.ModelPackageDescription + }), + ...(input.ModelPackageName !== undefined && { + ModelPackageName: input.ModelPackageName + }), + ...(input.SourceAlgorithmSpecification !== undefined && { + SourceAlgorithmSpecification: serializeAws_json1_1SourceAlgorithmSpecification( + input.SourceAlgorithmSpecification, + context + ) + }), + ...(input.ValidationSpecification !== undefined && { + ValidationSpecification: serializeAws_json1_1ModelPackageValidationSpecification( + input.ValidationSpecification, + context + ) + }) + }; }; const serializeAws_json1_1CreateMonitoringScheduleRequest = ( input: CreateMonitoringScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringScheduleConfig !== undefined) { - bodyParams[ - "MonitoringScheduleConfig" - ] = serializeAws_json1_1MonitoringScheduleConfig( - input.MonitoringScheduleConfig, - context - ); - } - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateNotebookInstanceInput = ( input: CreateNotebookInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorTypes !== undefined) { - bodyParams[ - "AcceleratorTypes" - ] = serializeAws_json1_1NotebookInstanceAcceleratorTypes( - input.AcceleratorTypes, - context - ); - } - if (input.AdditionalCodeRepositories !== undefined) { - bodyParams[ - "AdditionalCodeRepositories" - ] = serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls( - input.AdditionalCodeRepositories, - context - ); - } - if (input.DefaultCodeRepository !== undefined) { - bodyParams["DefaultCodeRepository"] = input.DefaultCodeRepository; - } - if (input.DirectInternetAccess !== undefined) { - bodyParams["DirectInternetAccess"] = input.DirectInternetAccess; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.LifecycleConfigName !== undefined) { - bodyParams["LifecycleConfigName"] = input.LifecycleConfigName; - } - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.RootAccess !== undefined) { - bodyParams["RootAccess"] = input.RootAccess; - } - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VolumeSizeInGB !== undefined) { - bodyParams["VolumeSizeInGB"] = input.VolumeSizeInGB; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateNotebookInstanceLifecycleConfigInput = ( input: CreateNotebookInstanceLifecycleConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceLifecycleConfigName !== undefined) { - bodyParams["NotebookInstanceLifecycleConfigName"] = - input.NotebookInstanceLifecycleConfigName; - } - if (input.OnCreate !== undefined) { - bodyParams[ - "OnCreate" - ] = serializeAws_json1_1NotebookInstanceLifecycleConfigList( - input.OnCreate, - context - ); - } - if (input.OnStart !== undefined) { - bodyParams[ - "OnStart" - ] = serializeAws_json1_1NotebookInstanceLifecycleConfigList( - input.OnStart, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreatePresignedDomainUrlRequest = ( input: CreatePresignedDomainUrlRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.SessionExpirationDurationInSeconds !== undefined) { - bodyParams["SessionExpirationDurationInSeconds"] = - input.SessionExpirationDurationInSeconds; - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - return bodyParams; + return { + ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.SessionExpirationDurationInSeconds !== undefined && { + SessionExpirationDurationInSeconds: + input.SessionExpirationDurationInSeconds + }), + ...(input.UserProfileName !== undefined && { + UserProfileName: input.UserProfileName + }) + }; }; const serializeAws_json1_1CreatePresignedNotebookInstanceUrlInput = ( input: CreatePresignedNotebookInstanceUrlInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - if (input.SessionExpirationDurationInSeconds !== undefined) { - bodyParams["SessionExpirationDurationInSeconds"] = - input.SessionExpirationDurationInSeconds; - } - return bodyParams; + return { + ...(input.NotebookInstanceName !== undefined && { + NotebookInstanceName: input.NotebookInstanceName + }), + ...(input.SessionExpirationDurationInSeconds !== undefined && { + SessionExpirationDurationInSeconds: + input.SessionExpirationDurationInSeconds + }) + }; }; const serializeAws_json1_1CreateProcessingJobRequest = ( input: CreateProcessingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppSpecification !== undefined) { - bodyParams["AppSpecification"] = serializeAws_json1_1AppSpecification( - input.AppSpecification, - context - ); - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1ProcessingEnvironmentMap( - input.Environment, - context - ); - } - if (input.ExperimentConfig !== undefined) { - bodyParams["ExperimentConfig"] = serializeAws_json1_1ExperimentConfig( - input.ExperimentConfig, - context - ); - } - if (input.NetworkConfig !== undefined) { - bodyParams["NetworkConfig"] = serializeAws_json1_1NetworkConfig( - input.NetworkConfig, - context - ); - } - if (input.ProcessingInputs !== undefined) { - bodyParams["ProcessingInputs"] = serializeAws_json1_1ProcessingInputs( - input.ProcessingInputs, - context - ); - } - if (input.ProcessingJobName !== undefined) { - bodyParams["ProcessingJobName"] = input.ProcessingJobName; - } - if (input.ProcessingOutputConfig !== undefined) { - bodyParams[ - "ProcessingOutputConfig" - ] = serializeAws_json1_1ProcessingOutputConfig( - input.ProcessingOutputConfig, - context - ); - } - if (input.ProcessingResources !== undefined) { - bodyParams["ProcessingResources"] = serializeAws_json1_1ProcessingResources( - input.ProcessingResources, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StoppingCondition !== undefined) { - bodyParams[ - "StoppingCondition" - ] = serializeAws_json1_1ProcessingStoppingCondition( - input.StoppingCondition, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateTrainingJobRequest = ( input: CreateTrainingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmSpecification !== undefined) { - bodyParams[ - "AlgorithmSpecification" - ] = serializeAws_json1_1AlgorithmSpecification( - input.AlgorithmSpecification, - context - ); - } - if (input.CheckpointConfig !== undefined) { - bodyParams["CheckpointConfig"] = serializeAws_json1_1CheckpointConfig( - input.CheckpointConfig, - context - ); - } - if (input.DebugHookConfig !== undefined) { - bodyParams["DebugHookConfig"] = serializeAws_json1_1DebugHookConfig( - input.DebugHookConfig, - context - ); - } - if (input.DebugRuleConfigurations !== undefined) { - bodyParams[ - "DebugRuleConfigurations" - ] = serializeAws_json1_1DebugRuleConfigurations( - input.DebugRuleConfigurations, - context - ); - } - if (input.EnableInterContainerTrafficEncryption !== undefined) { - bodyParams["EnableInterContainerTrafficEncryption"] = - input.EnableInterContainerTrafficEncryption; - } - if (input.EnableManagedSpotTraining !== undefined) { - bodyParams["EnableManagedSpotTraining"] = input.EnableManagedSpotTraining; - } - if (input.EnableNetworkIsolation !== undefined) { - bodyParams["EnableNetworkIsolation"] = input.EnableNetworkIsolation; - } - if (input.ExperimentConfig !== undefined) { - bodyParams["ExperimentConfig"] = serializeAws_json1_1ExperimentConfig( - input.ExperimentConfig, - context - ); - } - if (input.HyperParameters !== undefined) { - bodyParams["HyperParameters"] = serializeAws_json1_1HyperParameters( - input.HyperParameters, - context - ); - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.ResourceConfig !== undefined) { - bodyParams["ResourceConfig"] = serializeAws_json1_1ResourceConfig( - input.ResourceConfig, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StoppingCondition !== undefined) { - bodyParams["StoppingCondition"] = serializeAws_json1_1StoppingCondition( - input.StoppingCondition, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TensorBoardOutputConfig !== undefined) { - bodyParams[ - "TensorBoardOutputConfig" - ] = serializeAws_json1_1TensorBoardOutputConfig( - input.TensorBoardOutputConfig, - context - ); - } - if (input.TrainingJobName !== undefined) { - bodyParams["TrainingJobName"] = input.TrainingJobName; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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.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) + }) + }; }; const serializeAws_json1_1CreateTransformJobRequest = ( input: CreateTransformJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchStrategy !== undefined) { - bodyParams["BatchStrategy"] = input.BatchStrategy; - } - if (input.DataProcessing !== undefined) { - bodyParams["DataProcessing"] = serializeAws_json1_1DataProcessing( - input.DataProcessing, - context - ); - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1TransformEnvironmentMap( - input.Environment, - context - ); - } - if (input.ExperimentConfig !== undefined) { - bodyParams["ExperimentConfig"] = serializeAws_json1_1ExperimentConfig( - input.ExperimentConfig, - context - ); - } - if (input.MaxConcurrentTransforms !== undefined) { - bodyParams["MaxConcurrentTransforms"] = input.MaxConcurrentTransforms; - } - if (input.MaxPayloadInMB !== undefined) { - bodyParams["MaxPayloadInMB"] = input.MaxPayloadInMB; - } - if (input.ModelName !== undefined) { - bodyParams["ModelName"] = input.ModelName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TransformInput !== undefined) { - bodyParams["TransformInput"] = serializeAws_json1_1TransformInput( - input.TransformInput, - context - ); - } - if (input.TransformJobName !== undefined) { - bodyParams["TransformJobName"] = input.TransformJobName; - } - if (input.TransformOutput !== undefined) { - bodyParams["TransformOutput"] = serializeAws_json1_1TransformOutput( - input.TransformOutput, - context - ); - } - if (input.TransformResources !== undefined) { - bodyParams["TransformResources"] = serializeAws_json1_1TransformResources( - input.TransformResources, - context - ); - } - return bodyParams; + 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.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 + ) + }) + }; }; const serializeAws_json1_1CreateTrialComponentRequest = ( input: CreateTrialComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.InputArtifacts !== undefined) { - bodyParams["InputArtifacts"] = serializeAws_json1_1TrialComponentArtifacts( - input.InputArtifacts, - context - ); - } - if (input.OutputArtifacts !== undefined) { - bodyParams["OutputArtifacts"] = serializeAws_json1_1TrialComponentArtifacts( - input.OutputArtifacts, - context - ); - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1TrialComponentParameters( - input.Parameters, - context - ); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - if (input.Status !== undefined) { - bodyParams["Status"] = serializeAws_json1_1TrialComponentStatus( - input.Status, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TrialComponentName !== undefined) { - bodyParams["TrialComponentName"] = input.TrialComponentName; - } - return bodyParams; + 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.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 + }) + }; }; const serializeAws_json1_1CreateTrialRequest = ( input: CreateTrialRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), + ...(input.ExperimentName !== undefined && { + ExperimentName: input.ExperimentName + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }), + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1CreateUserProfileRequest = ( input: CreateUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.SingleSignOnUserIdentifier !== undefined) { - bodyParams["SingleSignOnUserIdentifier"] = input.SingleSignOnUserIdentifier; - } - if (input.SingleSignOnUserValue !== undefined) { - bodyParams["SingleSignOnUserValue"] = input.SingleSignOnUserValue; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - if (input.UserSettings !== undefined) { - bodyParams["UserSettings"] = serializeAws_json1_1UserSettings( - input.UserSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateWorkteamRequest = ( input: CreateWorkteamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.MemberDefinitions !== undefined) { - bodyParams["MemberDefinitions"] = serializeAws_json1_1MemberDefinitions( - input.MemberDefinitions, - context - ); - } - if (input.NotificationConfiguration !== undefined) { - bodyParams[ - "NotificationConfiguration" - ] = serializeAws_json1_1NotificationConfiguration( - input.NotificationConfiguration, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.WorkteamName !== undefined) { - bodyParams["WorkteamName"] = input.WorkteamName; - } - return bodyParams; + 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.WorkteamName !== undefined && { + WorkteamName: input.WorkteamName + }) + }; }; const serializeAws_json1_1CsvContentTypes = ( @@ -12614,133 +12399,117 @@ const serializeAws_json1_1DataCaptureConfig = ( input: DataCaptureConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptureContentTypeHeader !== undefined) { - bodyParams[ - "CaptureContentTypeHeader" - ] = serializeAws_json1_1CaptureContentTypeHeader( - input.CaptureContentTypeHeader, - context - ); - } - if (input.CaptureOptions !== undefined) { - bodyParams["CaptureOptions"] = serializeAws_json1_1CaptureOptionList( - input.CaptureOptions, - context - ); - } - if (input.DestinationS3Uri !== undefined) { - bodyParams["DestinationS3Uri"] = input.DestinationS3Uri; - } - if (input.EnableCapture !== undefined) { - bodyParams["EnableCapture"] = input.EnableCapture; - } - if (input.InitialSamplingPercentage !== undefined) { - bodyParams["InitialSamplingPercentage"] = input.InitialSamplingPercentage; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DataProcessing = ( input: DataProcessing, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputFilter !== undefined) { - bodyParams["InputFilter"] = input.InputFilter; - } - if (input.JoinSource !== undefined) { - bodyParams["JoinSource"] = input.JoinSource; - } - if (input.OutputFilter !== undefined) { - bodyParams["OutputFilter"] = input.OutputFilter; - } - return bodyParams; + return { + ...(input.InputFilter !== undefined && { InputFilter: input.InputFilter }), + ...(input.JoinSource !== undefined && { JoinSource: input.JoinSource }), + ...(input.OutputFilter !== undefined && { + OutputFilter: input.OutputFilter + }) + }; }; const serializeAws_json1_1DataSource = ( input: DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileSystemDataSource !== undefined) { - bodyParams[ - "FileSystemDataSource" - ] = serializeAws_json1_1FileSystemDataSource( - input.FileSystemDataSource, - context - ); - } - if (input.S3DataSource !== undefined) { - bodyParams["S3DataSource"] = serializeAws_json1_1S3DataSource( - input.S3DataSource, - context - ); - } - return bodyParams; + return { + ...(input.FileSystemDataSource !== undefined && { + FileSystemDataSource: serializeAws_json1_1FileSystemDataSource( + input.FileSystemDataSource, + context + ) + }), + ...(input.S3DataSource !== undefined && { + S3DataSource: serializeAws_json1_1S3DataSource( + input.S3DataSource, + context + ) + }) + }; }; const serializeAws_json1_1DebugHookConfig = ( input: DebugHookConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CollectionConfigurations !== undefined) { - bodyParams[ - "CollectionConfigurations" - ] = serializeAws_json1_1CollectionConfigurations( - input.CollectionConfigurations, - context - ); - } - if (input.HookParameters !== undefined) { - bodyParams["HookParameters"] = serializeAws_json1_1HookParameters( - input.HookParameters, - context - ); - } - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DebugRuleConfiguration = ( input: DebugRuleConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.RuleConfigurationName !== undefined) { - bodyParams["RuleConfigurationName"] = input.RuleConfigurationName; - } - if (input.RuleEvaluatorImage !== undefined) { - bodyParams["RuleEvaluatorImage"] = input.RuleEvaluatorImage; - } - if (input.RuleParameters !== undefined) { - bodyParams["RuleParameters"] = serializeAws_json1_1RuleParameters( - input.RuleParameters, - context - ); - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - if (input.VolumeSizeInGB !== undefined) { - bodyParams["VolumeSizeInGB"] = input.VolumeSizeInGB; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DebugRuleConfigurations = ( @@ -12756,551 +12525,513 @@ const serializeAws_json1_1DeleteAlgorithmInput = ( input: DeleteAlgorithmInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmName !== undefined) { - bodyParams["AlgorithmName"] = input.AlgorithmName; - } - return bodyParams; + return { + ...(input.AlgorithmName !== undefined && { + AlgorithmName: input.AlgorithmName + }) + }; }; const serializeAws_json1_1DeleteAppRequest = ( input: DeleteAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppName !== undefined) { - bodyParams["AppName"] = input.AppName; - } - if (input.AppType !== undefined) { - bodyParams["AppType"] = input.AppType; - } - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteCodeRepositoryInput = ( input: DeleteCodeRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeRepositoryName !== undefined) { - bodyParams["CodeRepositoryName"] = input.CodeRepositoryName; - } - return bodyParams; + return { + ...(input.CodeRepositoryName !== undefined && { + CodeRepositoryName: input.CodeRepositoryName + }) + }; }; const serializeAws_json1_1DeleteDomainRequest = ( input: DeleteDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.RetentionPolicy !== undefined) { - bodyParams["RetentionPolicy"] = serializeAws_json1_1RetentionPolicy( - input.RetentionPolicy, - context - ); - } - return bodyParams; + return { + ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.RetentionPolicy !== undefined && { + RetentionPolicy: serializeAws_json1_1RetentionPolicy( + input.RetentionPolicy, + context + ) + }) + }; }; const serializeAws_json1_1DeleteEndpointConfigInput = ( input: DeleteEndpointConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointConfigName !== undefined) { - bodyParams["EndpointConfigName"] = input.EndpointConfigName; - } - return bodyParams; + return { + ...(input.EndpointConfigName !== undefined && { + EndpointConfigName: input.EndpointConfigName + }) + }; }; const serializeAws_json1_1DeleteEndpointInput = ( input: DeleteEndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - return bodyParams; + return { + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }) + }; }; const serializeAws_json1_1DeleteExperimentRequest = ( input: DeleteExperimentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - return bodyParams; + return { + ...(input.ExperimentName !== undefined && { + ExperimentName: input.ExperimentName + }) + }; }; const serializeAws_json1_1DeleteFlowDefinitionRequest = ( input: DeleteFlowDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FlowDefinitionName !== undefined) { - bodyParams["FlowDefinitionName"] = input.FlowDefinitionName; - } - return bodyParams; + return { + ...(input.FlowDefinitionName !== undefined && { + FlowDefinitionName: input.FlowDefinitionName + }) + }; }; const serializeAws_json1_1DeleteModelInput = ( input: DeleteModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ModelName !== undefined) { - bodyParams["ModelName"] = input.ModelName; - } - return bodyParams; + return { + ...(input.ModelName !== undefined && { ModelName: input.ModelName }) + }; }; const serializeAws_json1_1DeleteModelPackageInput = ( input: DeleteModelPackageInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ModelPackageName !== undefined) { - bodyParams["ModelPackageName"] = input.ModelPackageName; - } - return bodyParams; + return { + ...(input.ModelPackageName !== undefined && { + ModelPackageName: input.ModelPackageName + }) + }; }; const serializeAws_json1_1DeleteMonitoringScheduleRequest = ( input: DeleteMonitoringScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - return bodyParams; + return { + ...(input.MonitoringScheduleName !== undefined && { + MonitoringScheduleName: input.MonitoringScheduleName + }) + }; }; const serializeAws_json1_1DeleteNotebookInstanceInput = ( input: DeleteNotebookInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - return bodyParams; + return { + ...(input.NotebookInstanceName !== undefined && { + NotebookInstanceName: input.NotebookInstanceName + }) + }; }; const serializeAws_json1_1DeleteNotebookInstanceLifecycleConfigInput = ( input: DeleteNotebookInstanceLifecycleConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceLifecycleConfigName !== undefined) { - bodyParams["NotebookInstanceLifecycleConfigName"] = - input.NotebookInstanceLifecycleConfigName; - } - return bodyParams; + return { + ...(input.NotebookInstanceLifecycleConfigName !== undefined && { + NotebookInstanceLifecycleConfigName: + input.NotebookInstanceLifecycleConfigName + }) + }; }; const serializeAws_json1_1DeleteTagsInput = ( input: DeleteTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1DeleteTrialComponentRequest = ( input: DeleteTrialComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrialComponentName !== undefined) { - bodyParams["TrialComponentName"] = input.TrialComponentName; - } - return bodyParams; + return { + ...(input.TrialComponentName !== undefined && { + TrialComponentName: input.TrialComponentName + }) + }; }; const serializeAws_json1_1DeleteTrialRequest = ( input: DeleteTrialRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1DeleteUserProfileRequest = ( input: DeleteUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - return bodyParams; + return { + ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && { + UserProfileName: input.UserProfileName + }) + }; }; const serializeAws_json1_1DeleteWorkteamRequest = ( input: DeleteWorkteamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkteamName !== undefined) { - bodyParams["WorkteamName"] = input.WorkteamName; - } - return bodyParams; + return { + ...(input.WorkteamName !== undefined && { + WorkteamName: input.WorkteamName + }) + }; }; const serializeAws_json1_1DescribeAlgorithmInput = ( input: DescribeAlgorithmInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmName !== undefined) { - bodyParams["AlgorithmName"] = input.AlgorithmName; - } - return bodyParams; + return { + ...(input.AlgorithmName !== undefined && { + AlgorithmName: input.AlgorithmName + }) + }; }; const serializeAws_json1_1DescribeAppRequest = ( input: DescribeAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AppName !== undefined) { - bodyParams["AppName"] = input.AppName; - } - if (input.AppType !== undefined) { - bodyParams["AppType"] = input.AppType; - } - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeAutoMLJobRequest = ( input: DescribeAutoMLJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoMLJobName !== undefined) { - bodyParams["AutoMLJobName"] = input.AutoMLJobName; - } - return bodyParams; + return { + ...(input.AutoMLJobName !== undefined && { + AutoMLJobName: input.AutoMLJobName + }) + }; }; const serializeAws_json1_1DescribeCodeRepositoryInput = ( input: DescribeCodeRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeRepositoryName !== undefined) { - bodyParams["CodeRepositoryName"] = input.CodeRepositoryName; - } - return bodyParams; + return { + ...(input.CodeRepositoryName !== undefined && { + CodeRepositoryName: input.CodeRepositoryName + }) + }; }; const serializeAws_json1_1DescribeCompilationJobRequest = ( input: DescribeCompilationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompilationJobName !== undefined) { - bodyParams["CompilationJobName"] = input.CompilationJobName; - } - return bodyParams; + return { + ...(input.CompilationJobName !== undefined && { + CompilationJobName: input.CompilationJobName + }) + }; }; const serializeAws_json1_1DescribeDomainRequest = ( input: DescribeDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - return bodyParams; + return { + ...(input.DomainId !== undefined && { DomainId: input.DomainId }) + }; }; const serializeAws_json1_1DescribeEndpointConfigInput = ( input: DescribeEndpointConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointConfigName !== undefined) { - bodyParams["EndpointConfigName"] = input.EndpointConfigName; - } - return bodyParams; + return { + ...(input.EndpointConfigName !== undefined && { + EndpointConfigName: input.EndpointConfigName + }) + }; }; const serializeAws_json1_1DescribeEndpointInput = ( input: DescribeEndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - return bodyParams; + return { + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }) + }; }; const serializeAws_json1_1DescribeExperimentRequest = ( input: DescribeExperimentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - return bodyParams; + return { + ...(input.ExperimentName !== undefined && { + ExperimentName: input.ExperimentName + }) + }; }; const serializeAws_json1_1DescribeFlowDefinitionRequest = ( input: DescribeFlowDefinitionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FlowDefinitionName !== undefined) { - bodyParams["FlowDefinitionName"] = input.FlowDefinitionName; - } - return bodyParams; + return { + ...(input.FlowDefinitionName !== undefined && { + FlowDefinitionName: input.FlowDefinitionName + }) + }; }; const serializeAws_json1_1DescribeHumanTaskUiRequest = ( input: DescribeHumanTaskUiRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanTaskUiName !== undefined) { - bodyParams["HumanTaskUiName"] = input.HumanTaskUiName; - } - return bodyParams; + return { + ...(input.HumanTaskUiName !== undefined && { + HumanTaskUiName: input.HumanTaskUiName + }) + }; }; const serializeAws_json1_1DescribeHyperParameterTuningJobRequest = ( input: DescribeHyperParameterTuningJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameterTuningJobName !== undefined) { - bodyParams["HyperParameterTuningJobName"] = - input.HyperParameterTuningJobName; - } - return bodyParams; + return { + ...(input.HyperParameterTuningJobName !== undefined && { + HyperParameterTuningJobName: input.HyperParameterTuningJobName + }) + }; }; const serializeAws_json1_1DescribeLabelingJobRequest = ( input: DescribeLabelingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LabelingJobName !== undefined) { - bodyParams["LabelingJobName"] = input.LabelingJobName; - } - return bodyParams; + return { + ...(input.LabelingJobName !== undefined && { + LabelingJobName: input.LabelingJobName + }) + }; }; const serializeAws_json1_1DescribeModelInput = ( input: DescribeModelInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ModelName !== undefined) { - bodyParams["ModelName"] = input.ModelName; - } - return bodyParams; + return { + ...(input.ModelName !== undefined && { ModelName: input.ModelName }) + }; }; const serializeAws_json1_1DescribeModelPackageInput = ( input: DescribeModelPackageInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ModelPackageName !== undefined) { - bodyParams["ModelPackageName"] = input.ModelPackageName; - } - return bodyParams; + return { + ...(input.ModelPackageName !== undefined && { + ModelPackageName: input.ModelPackageName + }) + }; }; const serializeAws_json1_1DescribeMonitoringScheduleRequest = ( input: DescribeMonitoringScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - return bodyParams; + return { + ...(input.MonitoringScheduleName !== undefined && { + MonitoringScheduleName: input.MonitoringScheduleName + }) + }; }; const serializeAws_json1_1DescribeNotebookInstanceInput = ( input: DescribeNotebookInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - return bodyParams; + return { + ...(input.NotebookInstanceName !== undefined && { + NotebookInstanceName: input.NotebookInstanceName + }) + }; }; const serializeAws_json1_1DescribeNotebookInstanceLifecycleConfigInput = ( input: DescribeNotebookInstanceLifecycleConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceLifecycleConfigName !== undefined) { - bodyParams["NotebookInstanceLifecycleConfigName"] = - input.NotebookInstanceLifecycleConfigName; - } - return bodyParams; + return { + ...(input.NotebookInstanceLifecycleConfigName !== undefined && { + NotebookInstanceLifecycleConfigName: + input.NotebookInstanceLifecycleConfigName + }) + }; }; const serializeAws_json1_1DescribeProcessingJobRequest = ( input: DescribeProcessingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProcessingJobName !== undefined) { - bodyParams["ProcessingJobName"] = input.ProcessingJobName; - } - return bodyParams; + return { + ...(input.ProcessingJobName !== undefined && { + ProcessingJobName: input.ProcessingJobName + }) + }; }; const serializeAws_json1_1DescribeSubscribedWorkteamRequest = ( input: DescribeSubscribedWorkteamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkteamArn !== undefined) { - bodyParams["WorkteamArn"] = input.WorkteamArn; - } - return bodyParams; + return { + ...(input.WorkteamArn !== undefined && { WorkteamArn: input.WorkteamArn }) + }; }; const serializeAws_json1_1DescribeTrainingJobRequest = ( input: DescribeTrainingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrainingJobName !== undefined) { - bodyParams["TrainingJobName"] = input.TrainingJobName; - } - return bodyParams; + return { + ...(input.TrainingJobName !== undefined && { + TrainingJobName: input.TrainingJobName + }) + }; }; const serializeAws_json1_1DescribeTransformJobRequest = ( input: DescribeTransformJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TransformJobName !== undefined) { - bodyParams["TransformJobName"] = input.TransformJobName; - } - return bodyParams; + return { + ...(input.TransformJobName !== undefined && { + TransformJobName: input.TransformJobName + }) + }; }; const serializeAws_json1_1DescribeTrialComponentRequest = ( input: DescribeTrialComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrialComponentName !== undefined) { - bodyParams["TrialComponentName"] = input.TrialComponentName; - } - return bodyParams; + return { + ...(input.TrialComponentName !== undefined && { + TrialComponentName: input.TrialComponentName + }) + }; }; const serializeAws_json1_1DescribeTrialRequest = ( input: DescribeTrialRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1DescribeUserProfileRequest = ( input: DescribeUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - return bodyParams; + return { + ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && { + UserProfileName: input.UserProfileName + }) + }; }; const serializeAws_json1_1DescribeWorkforceRequest = ( input: DescribeWorkforceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkforceName !== undefined) { - bodyParams["WorkforceName"] = input.WorkforceName; - } - return bodyParams; + return { + ...(input.WorkforceName !== undefined && { + WorkforceName: input.WorkforceName + }) + }; }; const serializeAws_json1_1DescribeWorkteamRequest = ( input: DescribeWorkteamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkteamName !== undefined) { - bodyParams["WorkteamName"] = input.WorkteamName; - } - return bodyParams; + return { + ...(input.WorkteamName !== undefined && { + WorkteamName: input.WorkteamName + }) + }; }; const serializeAws_json1_1DesiredWeightAndCapacity = ( input: DesiredWeightAndCapacity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredInstanceCount !== undefined) { - bodyParams["DesiredInstanceCount"] = input.DesiredInstanceCount; - } - if (input.DesiredWeight !== undefined) { - bodyParams["DesiredWeight"] = input.DesiredWeight; - } - if (input.VariantName !== undefined) { - bodyParams["VariantName"] = input.VariantName; - } - return bodyParams; + return { + ...(input.DesiredInstanceCount !== undefined && { + DesiredInstanceCount: input.DesiredInstanceCount + }), + ...(input.DesiredWeight !== undefined && { + DesiredWeight: input.DesiredWeight + }), + ...(input.VariantName !== undefined && { VariantName: input.VariantName }) + }; }; const serializeAws_json1_1DesiredWeightAndCapacityList = ( @@ -13316,34 +13047,28 @@ const serializeAws_json1_1DisassociateTrialComponentRequest = ( input: DisassociateTrialComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrialComponentName !== undefined) { - bodyParams["TrialComponentName"] = input.TrialComponentName; - } - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.TrialComponentName !== undefined && { + TrialComponentName: input.TrialComponentName + }), + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1EndpointInput = ( input: EndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3DataDistributionType !== undefined) { - bodyParams["S3DataDistributionType"] = input.S3DataDistributionType; - } - if (input.S3InputMode !== undefined) { - bodyParams["S3InputMode"] = input.S3InputMode; - } - return bodyParams; + return { + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }), + ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), + ...(input.S3DataDistributionType !== undefined && { + S3DataDistributionType: input.S3DataDistributionType + }), + ...(input.S3InputMode !== undefined && { S3InputMode: input.S3InputMode }) + }; }; const serializeAws_json1_1EnvironmentMap = ( @@ -13360,54 +13085,46 @@ const serializeAws_json1_1ExperimentConfig = ( input: ExperimentConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - if (input.TrialComponentDisplayName !== undefined) { - bodyParams["TrialComponentDisplayName"] = input.TrialComponentDisplayName; - } - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.ExperimentName !== undefined && { + ExperimentName: input.ExperimentName + }), + ...(input.TrialComponentDisplayName !== undefined && { + TrialComponentDisplayName: input.TrialComponentDisplayName + }), + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1FileSystemDataSource = ( input: FileSystemDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryPath !== undefined) { - bodyParams["DirectoryPath"] = input.DirectoryPath; - } - if (input.FileSystemAccessMode !== undefined) { - bodyParams["FileSystemAccessMode"] = input.FileSystemAccessMode; - } - if (input.FileSystemId !== undefined) { - bodyParams["FileSystemId"] = input.FileSystemId; - } - if (input.FileSystemType !== undefined) { - bodyParams["FileSystemType"] = input.FileSystemType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1Filter = ( input: Filter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Operator !== undefined) { - bodyParams["Operator"] = input.Operator; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Operator !== undefined && { Operator: input.Operator }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1FilterList = ( @@ -13421,14 +13138,12 @@ const serializeAws_json1_1FlowDefinitionOutputConfig = ( input: FlowDefinitionOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && { + S3OutputPath: input.S3OutputPath + }) + }; }; const serializeAws_json1_1FlowDefinitionTaskKeywords = ( @@ -13442,45 +13157,37 @@ const serializeAws_json1_1GetSearchSuggestionsRequest = ( input: GetSearchSuggestionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Resource !== undefined) { - bodyParams["Resource"] = input.Resource; - } - if (input.SuggestionQuery !== undefined) { - bodyParams["SuggestionQuery"] = serializeAws_json1_1SuggestionQuery( - input.SuggestionQuery, - context - ); - } - return bodyParams; + return { + ...(input.Resource !== undefined && { Resource: input.Resource }), + ...(input.SuggestionQuery !== undefined && { + SuggestionQuery: serializeAws_json1_1SuggestionQuery( + input.SuggestionQuery, + context + ) + }) + }; }; const serializeAws_json1_1GitConfig = ( input: GitConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Branch !== undefined) { - bodyParams["Branch"] = input.Branch; - } - if (input.RepositoryUrl !== undefined) { - bodyParams["RepositoryUrl"] = input.RepositoryUrl; - } - if (input.SecretArn !== undefined) { - bodyParams["SecretArn"] = input.SecretArn; - } - return bodyParams; + return { + ...(input.Branch !== undefined && { Branch: input.Branch }), + ...(input.RepositoryUrl !== undefined && { + RepositoryUrl: input.RepositoryUrl + }), + ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }) + }; }; const serializeAws_json1_1GitConfigForUpdate = ( input: GitConfigForUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretArn !== undefined) { - bodyParams["SecretArn"] = input.SecretArn; - } - return bodyParams; + return { + ...(input.SecretArn !== undefined && { SecretArn: input.SecretArn }) + }; }; const serializeAws_json1_1HookParameters = ( @@ -13497,210 +13204,170 @@ const serializeAws_json1_1HumanLoopActivationConditionsConfig = ( input: HumanLoopActivationConditionsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanLoopActivationConditions !== undefined) { - bodyParams["HumanLoopActivationConditions"] = __LazyJsonString.fromObject( - input.HumanLoopActivationConditions - ); - } - return bodyParams; + return { + ...(input.HumanLoopActivationConditions !== undefined && { + HumanLoopActivationConditions: __LazyJsonString.fromObject( + input.HumanLoopActivationConditions + ) + }) + }; }; const serializeAws_json1_1HumanLoopActivationConfig = ( input: HumanLoopActivationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanLoopActivationConditionsConfig !== undefined) { - bodyParams[ - "HumanLoopActivationConditionsConfig" - ] = serializeAws_json1_1HumanLoopActivationConditionsConfig( - input.HumanLoopActivationConditionsConfig, - context - ); - } - if (input.HumanLoopRequestSource !== undefined) { - bodyParams[ - "HumanLoopRequestSource" - ] = serializeAws_json1_1HumanLoopRequestSource( - input.HumanLoopRequestSource, - context - ); - } - return bodyParams; + return { + ...(input.HumanLoopActivationConditionsConfig !== undefined && { + HumanLoopActivationConditionsConfig: serializeAws_json1_1HumanLoopActivationConditionsConfig( + input.HumanLoopActivationConditionsConfig, + context + ) + }), + ...(input.HumanLoopRequestSource !== undefined && { + HumanLoopRequestSource: serializeAws_json1_1HumanLoopRequestSource( + input.HumanLoopRequestSource, + context + ) + }) + }; }; const serializeAws_json1_1HumanLoopConfig = ( input: HumanLoopConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HumanTaskUiArn !== undefined) { - bodyParams["HumanTaskUiArn"] = input.HumanTaskUiArn; - } - if (input.PublicWorkforceTaskPrice !== undefined) { - bodyParams[ - "PublicWorkforceTaskPrice" - ] = serializeAws_json1_1PublicWorkforceTaskPrice( - input.PublicWorkforceTaskPrice, - context - ); - } - if (input.TaskAvailabilityLifetimeInSeconds !== undefined) { - bodyParams["TaskAvailabilityLifetimeInSeconds"] = - input.TaskAvailabilityLifetimeInSeconds; - } - if (input.TaskCount !== undefined) { - bodyParams["TaskCount"] = input.TaskCount; - } - if (input.TaskDescription !== undefined) { - bodyParams["TaskDescription"] = input.TaskDescription; - } - if (input.TaskKeywords !== undefined) { - bodyParams["TaskKeywords"] = serializeAws_json1_1FlowDefinitionTaskKeywords( - input.TaskKeywords, - context - ); - } - if (input.TaskTimeLimitInSeconds !== undefined) { - bodyParams["TaskTimeLimitInSeconds"] = input.TaskTimeLimitInSeconds; - } - if (input.TaskTitle !== undefined) { - bodyParams["TaskTitle"] = input.TaskTitle; - } - if (input.WorkteamArn !== undefined) { - bodyParams["WorkteamArn"] = input.WorkteamArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1HumanLoopRequestSource = ( input: HumanLoopRequestSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsManagedHumanLoopRequestSource !== undefined) { - bodyParams["AwsManagedHumanLoopRequestSource"] = - input.AwsManagedHumanLoopRequestSource; - } - return bodyParams; -}; - -const serializeAws_json1_1HumanTaskConfig = ( - input: HumanTaskConfig, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.AnnotationConsolidationConfig !== undefined) { - bodyParams[ - "AnnotationConsolidationConfig" - ] = serializeAws_json1_1AnnotationConsolidationConfig( - input.AnnotationConsolidationConfig, - context - ); - } - if (input.MaxConcurrentTaskCount !== undefined) { - bodyParams["MaxConcurrentTaskCount"] = input.MaxConcurrentTaskCount; - } - if (input.NumberOfHumanWorkersPerDataObject !== undefined) { - bodyParams["NumberOfHumanWorkersPerDataObject"] = - input.NumberOfHumanWorkersPerDataObject; - } - if (input.PreHumanTaskLambdaArn !== undefined) { - bodyParams["PreHumanTaskLambdaArn"] = input.PreHumanTaskLambdaArn; - } - if (input.PublicWorkforceTaskPrice !== undefined) { - bodyParams[ - "PublicWorkforceTaskPrice" - ] = serializeAws_json1_1PublicWorkforceTaskPrice( - input.PublicWorkforceTaskPrice, - context - ); - } - if (input.TaskAvailabilityLifetimeInSeconds !== undefined) { - bodyParams["TaskAvailabilityLifetimeInSeconds"] = - input.TaskAvailabilityLifetimeInSeconds; - } - if (input.TaskDescription !== undefined) { - bodyParams["TaskDescription"] = input.TaskDescription; - } - if (input.TaskKeywords !== undefined) { - bodyParams["TaskKeywords"] = serializeAws_json1_1TaskKeywords( - input.TaskKeywords, - context - ); - } - if (input.TaskTimeLimitInSeconds !== undefined) { - bodyParams["TaskTimeLimitInSeconds"] = input.TaskTimeLimitInSeconds; - } - if (input.TaskTitle !== undefined) { - bodyParams["TaskTitle"] = input.TaskTitle; - } - if (input.UiConfig !== undefined) { - bodyParams["UiConfig"] = serializeAws_json1_1UiConfig( - input.UiConfig, - context - ); - } - if (input.WorkteamArn !== undefined) { - bodyParams["WorkteamArn"] = input.WorkteamArn; - } - return bodyParams; + return { + ...(input.AwsManagedHumanLoopRequestSource !== undefined && { + 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 }) + }; }; const serializeAws_json1_1HyperParameterAlgorithmSpecification = ( input: HyperParameterAlgorithmSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmName !== undefined) { - bodyParams["AlgorithmName"] = input.AlgorithmName; - } - if (input.MetricDefinitions !== undefined) { - bodyParams["MetricDefinitions"] = serializeAws_json1_1MetricDefinitionList( - input.MetricDefinitions, - context - ); - } - if (input.TrainingImage !== undefined) { - bodyParams["TrainingImage"] = input.TrainingImage; - } - if (input.TrainingInputMode !== undefined) { - bodyParams["TrainingInputMode"] = input.TrainingInputMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1HyperParameterSpecification = ( input: HyperParameterSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultValue !== undefined) { - bodyParams["DefaultValue"] = input.DefaultValue; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IsRequired !== undefined) { - bodyParams["IsRequired"] = input.IsRequired; - } - if (input.IsTunable !== undefined) { - bodyParams["IsTunable"] = input.IsTunable; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Range !== undefined) { - bodyParams["Range"] = serializeAws_json1_1ParameterRange( - input.Range, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1HyperParameterSpecifications = ( @@ -13716,88 +13383,79 @@ const serializeAws_json1_1HyperParameterTrainingJobDefinition = ( input: HyperParameterTrainingJobDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmSpecification !== undefined) { - bodyParams[ - "AlgorithmSpecification" - ] = serializeAws_json1_1HyperParameterAlgorithmSpecification( - input.AlgorithmSpecification, - context - ); - } - if (input.CheckpointConfig !== undefined) { - bodyParams["CheckpointConfig"] = serializeAws_json1_1CheckpointConfig( - input.CheckpointConfig, - context - ); - } - if (input.DefinitionName !== undefined) { - bodyParams["DefinitionName"] = input.DefinitionName; - } - if (input.EnableInterContainerTrafficEncryption !== undefined) { - bodyParams["EnableInterContainerTrafficEncryption"] = - input.EnableInterContainerTrafficEncryption; - } - if (input.EnableManagedSpotTraining !== undefined) { - bodyParams["EnableManagedSpotTraining"] = input.EnableManagedSpotTraining; - } - if (input.EnableNetworkIsolation !== undefined) { - bodyParams["EnableNetworkIsolation"] = input.EnableNetworkIsolation; - } - if (input.HyperParameterRanges !== undefined) { - bodyParams["HyperParameterRanges"] = serializeAws_json1_1ParameterRanges( - input.HyperParameterRanges, - context - ); - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.ResourceConfig !== undefined) { - bodyParams["ResourceConfig"] = serializeAws_json1_1ResourceConfig( - input.ResourceConfig, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StaticHyperParameters !== undefined) { - bodyParams["StaticHyperParameters"] = serializeAws_json1_1HyperParameters( - input.StaticHyperParameters, - context - ); - } - if (input.StoppingCondition !== undefined) { - bodyParams["StoppingCondition"] = serializeAws_json1_1StoppingCondition( - input.StoppingCondition, - context - ); - } - if (input.TuningObjective !== undefined) { - bodyParams[ - "TuningObjective" - ] = serializeAws_json1_1HyperParameterTuningJobObjective( - input.TuningObjective, - context - ); - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1HyperParameterTrainingJobDefinitions = ( @@ -13813,57 +13471,46 @@ const serializeAws_json1_1HyperParameterTuningJobConfig = ( input: HyperParameterTuningJobConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameterTuningJobObjective !== undefined) { - bodyParams[ - "HyperParameterTuningJobObjective" - ] = serializeAws_json1_1HyperParameterTuningJobObjective( - input.HyperParameterTuningJobObjective, - context - ); - } - if (input.ParameterRanges !== undefined) { - bodyParams["ParameterRanges"] = serializeAws_json1_1ParameterRanges( - input.ParameterRanges, - context - ); - } - if (input.ResourceLimits !== undefined) { - bodyParams["ResourceLimits"] = serializeAws_json1_1ResourceLimits( - input.ResourceLimits, - context - ); - } - if (input.Strategy !== undefined) { - bodyParams["Strategy"] = input.Strategy; - } - if (input.TrainingJobEarlyStoppingType !== undefined) { - bodyParams["TrainingJobEarlyStoppingType"] = - input.TrainingJobEarlyStoppingType; - } - if (input.TuningJobCompletionCriteria !== undefined) { - bodyParams[ - "TuningJobCompletionCriteria" - ] = serializeAws_json1_1TuningJobCompletionCriteria( - input.TuningJobCompletionCriteria, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1HyperParameterTuningJobObjective = ( input: HyperParameterTuningJobObjective, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.MetricName !== undefined && { MetricName: input.MetricName }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1HyperParameterTuningJobObjectives = ( @@ -13879,19 +13526,17 @@ const serializeAws_json1_1HyperParameterTuningJobWarmStartConfig = ( input: HyperParameterTuningJobWarmStartConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ParentHyperParameterTuningJobs !== undefined) { - bodyParams[ - "ParentHyperParameterTuningJobs" - ] = serializeAws_json1_1ParentHyperParameterTuningJobs( - input.ParentHyperParameterTuningJobs, - context - ); - } - if (input.WarmStartType !== undefined) { - bodyParams["WarmStartType"] = input.WarmStartType; - } - return bodyParams; + return { + ...(input.ParentHyperParameterTuningJobs !== undefined && { + ParentHyperParameterTuningJobs: serializeAws_json1_1ParentHyperParameterTuningJobs( + input.ParentHyperParameterTuningJobs, + context + ) + }), + ...(input.WarmStartType !== undefined && { + WarmStartType: input.WarmStartType + }) + }; }; const serializeAws_json1_1HyperParameters = ( @@ -13908,63 +13553,51 @@ const serializeAws_json1_1InferenceSpecification = ( input: InferenceSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Containers !== undefined) { - bodyParams[ - "Containers" - ] = serializeAws_json1_1ModelPackageContainerDefinitionList( - input.Containers, - context - ); - } - if (input.SupportedContentTypes !== undefined) { - bodyParams["SupportedContentTypes"] = serializeAws_json1_1ContentTypes( - input.SupportedContentTypes, - context - ); - } - if (input.SupportedRealtimeInferenceInstanceTypes !== undefined) { - bodyParams[ - "SupportedRealtimeInferenceInstanceTypes" - ] = serializeAws_json1_1RealtimeInferenceInstanceTypes( - input.SupportedRealtimeInferenceInstanceTypes, - context - ); - } - if (input.SupportedResponseMIMETypes !== undefined) { - bodyParams[ - "SupportedResponseMIMETypes" - ] = serializeAws_json1_1ResponseMIMETypes( - input.SupportedResponseMIMETypes, - context - ); - } - if (input.SupportedTransformInstanceTypes !== undefined) { - bodyParams[ - "SupportedTransformInstanceTypes" - ] = serializeAws_json1_1TransformInstanceTypes( - input.SupportedTransformInstanceTypes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1InputConfig = ( input: InputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataInputConfig !== undefined) { - bodyParams["DataInputConfig"] = input.DataInputConfig; - } - if (input.Framework !== undefined) { - bodyParams["Framework"] = input.Framework; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.DataInputConfig !== undefined && { + DataInputConfig: input.DataInputConfig + }), + ...(input.Framework !== undefined && { Framework: input.Framework }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1InputDataConfig = ( @@ -13985,34 +13618,22 @@ const serializeAws_json1_1IntegerParameterRange = ( input: IntegerParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ScalingType !== undefined) { - bodyParams["ScalingType"] = input.ScalingType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1IntegerParameterRangeSpecification = ( input: IntegerParameterRangeSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxValue !== undefined) { - bodyParams["MaxValue"] = input.MaxValue; - } - if (input.MinValue !== undefined) { - bodyParams["MinValue"] = input.MinValue; - } - return bodyParams; + return { + ...(input.MaxValue !== undefined && { MaxValue: input.MaxValue }), + ...(input.MinValue !== undefined && { MinValue: input.MinValue }) + }; }; const serializeAws_json1_1IntegerParameterRanges = ( @@ -14035,1155 +13656,855 @@ const serializeAws_json1_1JupyterServerAppSettings = ( input: JupyterServerAppSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultResourceSpec !== undefined) { - bodyParams["DefaultResourceSpec"] = serializeAws_json1_1ResourceSpec( - input.DefaultResourceSpec, - context - ); - } - return bodyParams; + return { + ...(input.DefaultResourceSpec !== undefined && { + DefaultResourceSpec: serializeAws_json1_1ResourceSpec( + input.DefaultResourceSpec, + context + ) + }) + }; }; const serializeAws_json1_1KernelGatewayAppSettings = ( input: KernelGatewayAppSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultResourceSpec !== undefined) { - bodyParams["DefaultResourceSpec"] = serializeAws_json1_1ResourceSpec( - input.DefaultResourceSpec, - context - ); - } - return bodyParams; + return { + ...(input.DefaultResourceSpec !== undefined && { + DefaultResourceSpec: serializeAws_json1_1ResourceSpec( + input.DefaultResourceSpec, + context + ) + }) + }; }; const serializeAws_json1_1LabelingJobAlgorithmsConfig = ( input: LabelingJobAlgorithmsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InitialActiveLearningModelArn !== undefined) { - bodyParams["InitialActiveLearningModelArn"] = - input.InitialActiveLearningModelArn; - } - if (input.LabelingJobAlgorithmSpecificationArn !== undefined) { - bodyParams["LabelingJobAlgorithmSpecificationArn"] = - input.LabelingJobAlgorithmSpecificationArn; - } - if (input.LabelingJobResourceConfig !== undefined) { - bodyParams[ - "LabelingJobResourceConfig" - ] = serializeAws_json1_1LabelingJobResourceConfig( - input.LabelingJobResourceConfig, - context - ); - } - return bodyParams; + return { + ...(input.InitialActiveLearningModelArn !== undefined && { + InitialActiveLearningModelArn: input.InitialActiveLearningModelArn + }), + ...(input.LabelingJobAlgorithmSpecificationArn !== undefined && { + LabelingJobAlgorithmSpecificationArn: + input.LabelingJobAlgorithmSpecificationArn + }), + ...(input.LabelingJobResourceConfig !== undefined && { + LabelingJobResourceConfig: serializeAws_json1_1LabelingJobResourceConfig( + input.LabelingJobResourceConfig, + context + ) + }) + }; }; const serializeAws_json1_1LabelingJobDataAttributes = ( input: LabelingJobDataAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContentClassifiers !== undefined) { - bodyParams["ContentClassifiers"] = serializeAws_json1_1ContentClassifiers( - input.ContentClassifiers, - context - ); - } - return bodyParams; + return { + ...(input.ContentClassifiers !== undefined && { + ContentClassifiers: serializeAws_json1_1ContentClassifiers( + input.ContentClassifiers, + context + ) + }) + }; }; const serializeAws_json1_1LabelingJobDataSource = ( input: LabelingJobDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3DataSource !== undefined) { - bodyParams["S3DataSource"] = serializeAws_json1_1LabelingJobS3DataSource( - input.S3DataSource, - context - ); - } - return bodyParams; + return { + ...(input.S3DataSource !== undefined && { + S3DataSource: serializeAws_json1_1LabelingJobS3DataSource( + input.S3DataSource, + context + ) + }) + }; }; const serializeAws_json1_1LabelingJobInputConfig = ( input: LabelingJobInputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataAttributes !== undefined) { - bodyParams[ - "DataAttributes" - ] = serializeAws_json1_1LabelingJobDataAttributes( - input.DataAttributes, - context - ); - } - if (input.DataSource !== undefined) { - bodyParams["DataSource"] = serializeAws_json1_1LabelingJobDataSource( - input.DataSource, - context - ); - } - return bodyParams; + return { + ...(input.DataAttributes !== undefined && { + DataAttributes: serializeAws_json1_1LabelingJobDataAttributes( + input.DataAttributes, + context + ) + }), + ...(input.DataSource !== undefined && { + DataSource: serializeAws_json1_1LabelingJobDataSource( + input.DataSource, + context + ) + }) + }; }; const serializeAws_json1_1LabelingJobOutputConfig = ( input: LabelingJobOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && { + S3OutputPath: input.S3OutputPath + }) + }; }; const serializeAws_json1_1LabelingJobResourceConfig = ( input: LabelingJobResourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - return bodyParams; + return { + ...(input.VolumeKmsKeyId !== undefined && { + VolumeKmsKeyId: input.VolumeKmsKeyId + }) + }; }; const serializeAws_json1_1LabelingJobS3DataSource = ( input: LabelingJobS3DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManifestS3Uri !== undefined) { - bodyParams["ManifestS3Uri"] = input.ManifestS3Uri; - } - return bodyParams; + return { + ...(input.ManifestS3Uri !== undefined && { + ManifestS3Uri: input.ManifestS3Uri + }) + }; }; const serializeAws_json1_1LabelingJobStoppingConditions = ( input: LabelingJobStoppingConditions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxHumanLabeledObjectCount !== undefined) { - bodyParams["MaxHumanLabeledObjectCount"] = input.MaxHumanLabeledObjectCount; - } - if (input.MaxPercentageOfInputDatasetLabeled !== undefined) { - bodyParams["MaxPercentageOfInputDatasetLabeled"] = - input.MaxPercentageOfInputDatasetLabeled; - } - return bodyParams; + return { + ...(input.MaxHumanLabeledObjectCount !== undefined && { + MaxHumanLabeledObjectCount: input.MaxHumanLabeledObjectCount + }), + ...(input.MaxPercentageOfInputDatasetLabeled !== undefined && { + MaxPercentageOfInputDatasetLabeled: + input.MaxPercentageOfInputDatasetLabeled + }) + }; }; const serializeAws_json1_1ListAlgorithmsInput = ( input: ListAlgorithmsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListAppsRequest = ( input: ListAppsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainIdEquals !== undefined) { - bodyParams["DomainIdEquals"] = input.DomainIdEquals; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.UserProfileNameEquals !== undefined) { - bodyParams["UserProfileNameEquals"] = input.UserProfileNameEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListAutoMLJobsRequest = ( input: ListAutoMLJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListCandidatesForAutoMLJobRequest = ( input: ListCandidatesForAutoMLJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoMLJobName !== undefined) { - bodyParams["AutoMLJobName"] = input.AutoMLJobName; - } - if (input.CandidateNameEquals !== undefined) { - bodyParams["CandidateNameEquals"] = input.CandidateNameEquals; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListCodeRepositoriesInput = ( input: ListCodeRepositoriesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListCompilationJobsRequest = ( input: ListCompilationJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListDomainsRequest = ( input: ListDomainsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListEndpointConfigsInput = ( input: ListEndpointConfigsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListEndpointsInput = ( input: ListEndpointsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListExperimentsRequest = ( input: ListExperimentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedAfter !== undefined) { - bodyParams["CreatedAfter"] = Math.round( - input.CreatedAfter.getTime() / 1000 - ); - } - if (input.CreatedBefore !== undefined) { - bodyParams["CreatedBefore"] = Math.round( - input.CreatedBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListFlowDefinitionsRequest = ( input: ListFlowDefinitionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListHumanTaskUisRequest = ( input: ListHumanTaskUisRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListHyperParameterTuningJobsRequest = ( input: ListHyperParameterTuningJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListLabelingJobsForWorkteamRequest = ( input: ListLabelingJobsForWorkteamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.JobReferenceCodeContains !== undefined) { - bodyParams["JobReferenceCodeContains"] = input.JobReferenceCodeContains; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.WorkteamArn !== undefined) { - bodyParams["WorkteamArn"] = input.WorkteamArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListLabelingJobsRequest = ( input: ListLabelingJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListModelPackagesInput = ( input: ListModelPackagesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListModelsInput = ( input: ListModelsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListMonitoringExecutionsRequest = ( input: ListMonitoringExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ScheduledTimeAfter !== undefined) { - bodyParams["ScheduledTimeAfter"] = Math.round( - input.ScheduledTimeAfter.getTime() / 1000 - ); - } - if (input.ScheduledTimeBefore !== undefined) { - bodyParams["ScheduledTimeBefore"] = Math.round( - input.ScheduledTimeBefore.getTime() / 1000 - ); - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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.MonitoringScheduleName !== undefined && { + MonitoringScheduleName: input.MonitoringScheduleName + }), + ...(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 + }) + }; }; const serializeAws_json1_1ListMonitoringSchedulesRequest = ( input: ListMonitoringSchedulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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.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 + }) + }; }; const serializeAws_json1_1ListNotebookInstanceLifecycleConfigsInput = ( input: ListNotebookInstanceLifecycleConfigsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListNotebookInstancesInput = ( input: ListNotebookInstancesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalCodeRepositoryEquals !== undefined) { - bodyParams["AdditionalCodeRepositoryEquals"] = - input.AdditionalCodeRepositoryEquals; - } - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.DefaultCodeRepositoryContains !== undefined) { - bodyParams["DefaultCodeRepositoryContains"] = - input.DefaultCodeRepositoryContains; - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.NotebookInstanceLifecycleConfigNameContains !== undefined) { - bodyParams["NotebookInstanceLifecycleConfigNameContains"] = - input.NotebookInstanceLifecycleConfigNameContains; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListProcessingJobsRequest = ( input: ListProcessingJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListSubscribedWorkteamsRequest = ( input: ListSubscribedWorkteamsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && { + NameContains: input.NameContains + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsInput = ( input: ListTagsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListTrainingJobsForHyperParameterTuningJobRequest = ( input: ListTrainingJobsForHyperParameterTuningJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameterTuningJobName !== undefined) { - bodyParams["HyperParameterTuningJobName"] = - input.HyperParameterTuningJobName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListTrainingJobsRequest = ( input: ListTrainingJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListTransformJobsRequest = ( input: ListTransformJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreationTimeAfter !== undefined) { - bodyParams["CreationTimeAfter"] = Math.round( - input.CreationTimeAfter.getTime() / 1000 - ); - } - if (input.CreationTimeBefore !== undefined) { - bodyParams["CreationTimeBefore"] = Math.round( - input.CreationTimeBefore.getTime() / 1000 - ); - } - if (input.LastModifiedTimeAfter !== undefined) { - bodyParams["LastModifiedTimeAfter"] = Math.round( - input.LastModifiedTimeAfter.getTime() / 1000 - ); - } - if (input.LastModifiedTimeBefore !== undefined) { - bodyParams["LastModifiedTimeBefore"] = Math.round( - input.LastModifiedTimeBefore.getTime() / 1000 - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.StatusEquals !== undefined) { - bodyParams["StatusEquals"] = input.StatusEquals; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListTrialComponentKey256 = ( @@ -15197,137 +14518,91 @@ const serializeAws_json1_1ListTrialComponentsRequest = ( input: ListTrialComponentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedAfter !== undefined) { - bodyParams["CreatedAfter"] = Math.round( - input.CreatedAfter.getTime() / 1000 - ); - } - if (input.CreatedBefore !== undefined) { - bodyParams["CreatedBefore"] = Math.round( - input.CreatedBefore.getTime() / 1000 - ); - } - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.SourceArn !== undefined) { - bodyParams["SourceArn"] = input.SourceArn; - } - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTrialsRequest = ( input: ListTrialsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedAfter !== undefined) { - bodyParams["CreatedAfter"] = Math.round( - input.CreatedAfter.getTime() / 1000 - ); - } - if (input.CreatedBefore !== undefined) { - bodyParams["CreatedBefore"] = Math.round( - input.CreatedBefore.getTime() / 1000 - ); - } - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListUserProfilesRequest = ( input: ListUserProfilesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainIdEquals !== undefined) { - bodyParams["DomainIdEquals"] = input.DomainIdEquals; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - if (input.UserProfileNameContains !== undefined) { - bodyParams["UserProfileNameContains"] = input.UserProfileNameContains; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListWorkteamsRequest = ( input: ListWorkteamsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1MemberDefinition = ( input: MemberDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CognitoMemberDefinition !== undefined) { - bodyParams[ - "CognitoMemberDefinition" - ] = serializeAws_json1_1CognitoMemberDefinition( - input.CognitoMemberDefinition, - context - ); - } - return bodyParams; + return { + ...(input.CognitoMemberDefinition !== undefined && { + CognitoMemberDefinition: serializeAws_json1_1CognitoMemberDefinition( + input.CognitoMemberDefinition, + context + ) + }) + }; }; const serializeAws_json1_1MemberDefinitions = ( @@ -15343,14 +14618,10 @@ const serializeAws_json1_1MetricDefinition = ( input: MetricDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Regex !== undefined) { - bodyParams["Regex"] = input.Regex; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Regex !== undefined && { Regex: input.Regex }) + }; }; const serializeAws_json1_1MetricDefinitionList = ( @@ -15363,26 +14634,20 @@ const serializeAws_json1_1MetricDefinitionList = ( }; const serializeAws_json1_1ModelPackageContainerDefinition = ( - input: ModelPackageContainerDefinition, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.ContainerHostname !== undefined) { - bodyParams["ContainerHostname"] = input.ContainerHostname; - } - if (input.Image !== undefined) { - bodyParams["Image"] = input.Image; - } - if (input.ImageDigest !== undefined) { - bodyParams["ImageDigest"] = input.ImageDigest; - } - if (input.ModelDataUrl !== undefined) { - bodyParams["ModelDataUrl"] = input.ModelDataUrl; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + input: ModelPackageContainerDefinition, + 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 }) + }; }; const serializeAws_json1_1ModelPackageContainerDefinitionList = ( @@ -15398,19 +14663,15 @@ const serializeAws_json1_1ModelPackageValidationProfile = ( input: ModelPackageValidationProfile, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProfileName !== undefined) { - bodyParams["ProfileName"] = input.ProfileName; - } - if (input.TransformJobDefinition !== undefined) { - bodyParams[ - "TransformJobDefinition" - ] = serializeAws_json1_1TransformJobDefinition( - input.TransformJobDefinition, - context - ); - } - return bodyParams; + return { + ...(input.ProfileName !== undefined && { ProfileName: input.ProfileName }), + ...(input.TransformJobDefinition !== undefined && { + TransformJobDefinition: serializeAws_json1_1TransformJobDefinition( + input.TransformJobDefinition, + context + ) + }) + }; }; const serializeAws_json1_1ModelPackageValidationProfiles = ( @@ -15426,107 +14687,93 @@ const serializeAws_json1_1ModelPackageValidationSpecification = ( input: ModelPackageValidationSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ValidationProfiles !== undefined) { - bodyParams[ - "ValidationProfiles" - ] = serializeAws_json1_1ModelPackageValidationProfiles( - input.ValidationProfiles, - context - ); - } - if (input.ValidationRole !== undefined) { - bodyParams["ValidationRole"] = input.ValidationRole; - } - return bodyParams; + return { + ...(input.ValidationProfiles !== undefined && { + ValidationProfiles: serializeAws_json1_1ModelPackageValidationProfiles( + input.ValidationProfiles, + context + ) + }), + ...(input.ValidationRole !== undefined && { + ValidationRole: input.ValidationRole + }) + }; }; const serializeAws_json1_1MonitoringAppSpecification = ( input: MonitoringAppSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContainerArguments !== undefined) { - bodyParams[ - "ContainerArguments" - ] = serializeAws_json1_1MonitoringContainerArguments( - input.ContainerArguments, - context - ); - } - if (input.ContainerEntrypoint !== undefined) { - bodyParams["ContainerEntrypoint"] = serializeAws_json1_1ContainerEntrypoint( - input.ContainerEntrypoint, - context - ); - } - if (input.ImageUri !== undefined) { - bodyParams["ImageUri"] = input.ImageUri; - } - if (input.PostAnalyticsProcessorSourceUri !== undefined) { - bodyParams["PostAnalyticsProcessorSourceUri"] = - input.PostAnalyticsProcessorSourceUri; - } - if (input.RecordPreprocessorSourceUri !== undefined) { - bodyParams["RecordPreprocessorSourceUri"] = - input.RecordPreprocessorSourceUri; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MonitoringBaselineConfig = ( input: MonitoringBaselineConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConstraintsResource !== undefined) { - bodyParams[ - "ConstraintsResource" - ] = serializeAws_json1_1MonitoringConstraintsResource( - input.ConstraintsResource, - context - ); - } - if (input.StatisticsResource !== undefined) { - bodyParams[ - "StatisticsResource" - ] = serializeAws_json1_1MonitoringStatisticsResource( - input.StatisticsResource, - context - ); - } - return bodyParams; + return { + ...(input.ConstraintsResource !== undefined && { + ConstraintsResource: serializeAws_json1_1MonitoringConstraintsResource( + input.ConstraintsResource, + context + ) + }), + ...(input.StatisticsResource !== undefined && { + StatisticsResource: serializeAws_json1_1MonitoringStatisticsResource( + input.StatisticsResource, + context + ) + }) + }; }; const serializeAws_json1_1MonitoringClusterConfig = ( input: MonitoringClusterConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VolumeSizeInGB !== undefined) { - bodyParams["VolumeSizeInGB"] = input.VolumeSizeInGB; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MonitoringConstraintsResource = ( input: MonitoringConstraintsResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1MonitoringContainerArguments = ( @@ -15550,14 +14797,14 @@ const serializeAws_json1_1MonitoringInput = ( input: MonitoringInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointInput !== undefined) { - bodyParams["EndpointInput"] = serializeAws_json1_1EndpointInput( - input.EndpointInput, - context - ); - } - return bodyParams; + return { + ...(input.EndpointInput !== undefined && { + EndpointInput: serializeAws_json1_1EndpointInput( + input.EndpointInput, + context + ) + }) + }; }; const serializeAws_json1_1MonitoringInputs = ( @@ -15573,96 +14820,83 @@ const serializeAws_json1_1MonitoringJobDefinition = ( input: MonitoringJobDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineConfig !== undefined) { - bodyParams["BaselineConfig"] = serializeAws_json1_1MonitoringBaselineConfig( - input.BaselineConfig, - context - ); - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1MonitoringEnvironmentMap( - input.Environment, - context - ); - } - if (input.MonitoringAppSpecification !== undefined) { - bodyParams[ - "MonitoringAppSpecification" - ] = serializeAws_json1_1MonitoringAppSpecification( - input.MonitoringAppSpecification, - context - ); - } - if (input.MonitoringInputs !== undefined) { - bodyParams["MonitoringInputs"] = serializeAws_json1_1MonitoringInputs( - input.MonitoringInputs, - context - ); - } - if (input.MonitoringOutputConfig !== undefined) { - bodyParams[ - "MonitoringOutputConfig" - ] = serializeAws_json1_1MonitoringOutputConfig( - input.MonitoringOutputConfig, - context - ); - } - if (input.MonitoringResources !== undefined) { - bodyParams["MonitoringResources"] = serializeAws_json1_1MonitoringResources( - input.MonitoringResources, - context - ); - } - if (input.NetworkConfig !== undefined) { - bodyParams["NetworkConfig"] = serializeAws_json1_1NetworkConfig( - input.NetworkConfig, - context - ); - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.StoppingCondition !== undefined) { - bodyParams[ - "StoppingCondition" - ] = serializeAws_json1_1MonitoringStoppingCondition( - input.StoppingCondition, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1MonitoringOutput = ( input: MonitoringOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Output !== undefined) { - bodyParams["S3Output"] = serializeAws_json1_1MonitoringS3Output( - input.S3Output, - context - ); - } - return bodyParams; + return { + ...(input.S3Output !== undefined && { + S3Output: serializeAws_json1_1MonitoringS3Output(input.S3Output, context) + }) + }; }; const serializeAws_json1_1MonitoringOutputConfig = ( input: MonitoringOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.MonitoringOutputs !== undefined) { - bodyParams["MonitoringOutputs"] = serializeAws_json1_1MonitoringOutputs( - input.MonitoringOutputs, - context - ); - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.MonitoringOutputs !== undefined && { + MonitoringOutputs: serializeAws_json1_1MonitoringOutputs( + input.MonitoringOutputs, + context + ) + }) + }; }; const serializeAws_json1_1MonitoringOutputs = ( @@ -15678,92 +14912,81 @@ const serializeAws_json1_1MonitoringResources = ( input: MonitoringResources, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterConfig !== undefined) { - bodyParams["ClusterConfig"] = serializeAws_json1_1MonitoringClusterConfig( - input.ClusterConfig, - context - ); - } - return bodyParams; + return { + ...(input.ClusterConfig !== undefined && { + ClusterConfig: serializeAws_json1_1MonitoringClusterConfig( + input.ClusterConfig, + context + ) + }) + }; }; const serializeAws_json1_1MonitoringS3Output = ( input: MonitoringS3Output, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3UploadMode !== undefined) { - bodyParams["S3UploadMode"] = input.S3UploadMode; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), + ...(input.S3UploadMode !== undefined && { + S3UploadMode: input.S3UploadMode + }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1MonitoringScheduleConfig = ( input: MonitoringScheduleConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringJobDefinition !== undefined) { - bodyParams[ - "MonitoringJobDefinition" - ] = serializeAws_json1_1MonitoringJobDefinition( - input.MonitoringJobDefinition, - context - ); - } - if (input.ScheduleConfig !== undefined) { - bodyParams["ScheduleConfig"] = serializeAws_json1_1ScheduleConfig( - input.ScheduleConfig, - context - ); - } - return bodyParams; + return { + ...(input.MonitoringJobDefinition !== undefined && { + MonitoringJobDefinition: serializeAws_json1_1MonitoringJobDefinition( + input.MonitoringJobDefinition, + context + ) + }), + ...(input.ScheduleConfig !== undefined && { + ScheduleConfig: serializeAws_json1_1ScheduleConfig( + input.ScheduleConfig, + context + ) + }) + }; }; const serializeAws_json1_1MonitoringStatisticsResource = ( input: MonitoringStatisticsResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1MonitoringStoppingCondition = ( input: MonitoringStoppingCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxRuntimeInSeconds !== undefined) { - bodyParams["MaxRuntimeInSeconds"] = input.MaxRuntimeInSeconds; - } - return bodyParams; + return { + ...(input.MaxRuntimeInSeconds !== undefined && { + MaxRuntimeInSeconds: input.MaxRuntimeInSeconds + }) + }; }; const serializeAws_json1_1NestedFilters = ( input: NestedFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.NestedPropertyName !== undefined) { - bodyParams["NestedPropertyName"] = input.NestedPropertyName; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1FilterList(input.Filters, context) + }), + ...(input.NestedPropertyName !== undefined && { + NestedPropertyName: input.NestedPropertyName + }) + }; }; const serializeAws_json1_1NestedFiltersList = ( @@ -15777,17 +15000,14 @@ const serializeAws_json1_1NetworkConfig = ( input: NetworkConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnableNetworkIsolation !== undefined) { - bodyParams["EnableNetworkIsolation"] = input.EnableNetworkIsolation; - } - if (input.VpcConfig !== undefined) { - bodyParams["VpcConfig"] = serializeAws_json1_1VpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + return { + ...(input.EnableNetworkIsolation !== undefined && { + EnableNetworkIsolation: input.EnableNetworkIsolation + }), + ...(input.VpcConfig !== undefined && { + VpcConfig: serializeAws_json1_1VpcConfig(input.VpcConfig, context) + }) + }; }; const serializeAws_json1_1NotebookInstanceAcceleratorTypes = ( @@ -15810,114 +15030,98 @@ const serializeAws_json1_1NotebookInstanceLifecycleHook = ( input: NotebookInstanceLifecycleHook, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - return bodyParams; + return { + ...(input.Content !== undefined && { Content: input.Content }) + }; }; const serializeAws_json1_1NotificationConfiguration = ( input: NotificationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotificationTopicArn !== undefined) { - bodyParams["NotificationTopicArn"] = input.NotificationTopicArn; - } - return bodyParams; + return { + ...(input.NotificationTopicArn !== undefined && { + NotificationTopicArn: input.NotificationTopicArn + }) + }; }; const serializeAws_json1_1OutputConfig = ( input: OutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3OutputLocation !== undefined) { - bodyParams["S3OutputLocation"] = input.S3OutputLocation; - } - if (input.TargetDevice !== undefined) { - bodyParams["TargetDevice"] = input.TargetDevice; - } - return bodyParams; + return { + ...(input.S3OutputLocation !== undefined && { + S3OutputLocation: input.S3OutputLocation + }), + ...(input.TargetDevice !== undefined && { + TargetDevice: input.TargetDevice + }) + }; }; const serializeAws_json1_1OutputDataConfig = ( input: OutputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.S3OutputPath !== undefined && { + S3OutputPath: input.S3OutputPath + }) + }; }; const serializeAws_json1_1ParameterRange = ( input: ParameterRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CategoricalParameterRangeSpecification !== undefined) { - bodyParams[ - "CategoricalParameterRangeSpecification" - ] = serializeAws_json1_1CategoricalParameterRangeSpecification( - input.CategoricalParameterRangeSpecification, - context - ); - } - if (input.ContinuousParameterRangeSpecification !== undefined) { - bodyParams[ - "ContinuousParameterRangeSpecification" - ] = serializeAws_json1_1ContinuousParameterRangeSpecification( - input.ContinuousParameterRangeSpecification, - context - ); - } - if (input.IntegerParameterRangeSpecification !== undefined) { - bodyParams[ - "IntegerParameterRangeSpecification" - ] = serializeAws_json1_1IntegerParameterRangeSpecification( - input.IntegerParameterRangeSpecification, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ParameterRanges = ( input: ParameterRanges, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CategoricalParameterRanges !== undefined) { - bodyParams[ - "CategoricalParameterRanges" - ] = serializeAws_json1_1CategoricalParameterRanges( - input.CategoricalParameterRanges, - context - ); - } - if (input.ContinuousParameterRanges !== undefined) { - bodyParams[ - "ContinuousParameterRanges" - ] = serializeAws_json1_1ContinuousParameterRanges( - input.ContinuousParameterRanges, - context - ); - } - if (input.IntegerParameterRanges !== undefined) { - bodyParams[ - "IntegerParameterRanges" - ] = serializeAws_json1_1IntegerParameterRanges( - input.IntegerParameterRanges, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ParameterValues = ( @@ -15931,12 +15135,11 @@ const serializeAws_json1_1ParentHyperParameterTuningJob = ( input: ParentHyperParameterTuningJob, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameterTuningJobName !== undefined) { - bodyParams["HyperParameterTuningJobName"] = - input.HyperParameterTuningJobName; - } - return bodyParams; + return { + ...(input.HyperParameterTuningJobName !== undefined && { + HyperParameterTuningJobName: input.HyperParameterTuningJobName + }) + }; }; const serializeAws_json1_1ParentHyperParameterTuningJobs = ( @@ -15952,20 +15155,20 @@ const serializeAws_json1_1ProcessingClusterConfig = ( input: ProcessingClusterConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VolumeSizeInGB !== undefined) { - bodyParams["VolumeSizeInGB"] = input.VolumeSizeInGB; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ProcessingEnvironmentMap = ( @@ -15982,17 +15185,12 @@ const serializeAws_json1_1ProcessingInput = ( input: ProcessingInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InputName !== undefined) { - bodyParams["InputName"] = input.InputName; - } - if (input.S3Input !== undefined) { - bodyParams["S3Input"] = serializeAws_json1_1ProcessingS3Input( - input.S3Input, - context - ); - } - return bodyParams; + return { + ...(input.InputName !== undefined && { InputName: input.InputName }), + ...(input.S3Input !== undefined && { + S3Input: serializeAws_json1_1ProcessingS3Input(input.S3Input, context) + }) + }; }; const serializeAws_json1_1ProcessingInputs = ( @@ -16008,34 +15206,24 @@ const serializeAws_json1_1ProcessingOutput = ( input: ProcessingOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputName !== undefined) { - bodyParams["OutputName"] = input.OutputName; - } - if (input.S3Output !== undefined) { - bodyParams["S3Output"] = serializeAws_json1_1ProcessingS3Output( - input.S3Output, - context - ); - } - return bodyParams; + return { + ...(input.OutputName !== undefined && { OutputName: input.OutputName }), + ...(input.S3Output !== undefined && { + S3Output: serializeAws_json1_1ProcessingS3Output(input.S3Output, context) + }) + }; }; const serializeAws_json1_1ProcessingOutputConfig = ( input: ProcessingOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.Outputs !== undefined) { - bodyParams["Outputs"] = serializeAws_json1_1ProcessingOutputs( - input.Outputs, - context - ); - } - return bodyParams; + return { + ...(input.KmsKeyId !== undefined && { KmsKeyId: input.KmsKeyId }), + ...(input.Outputs !== undefined && { + Outputs: serializeAws_json1_1ProcessingOutputs(input.Outputs, context) + }) + }; }; const serializeAws_json1_1ProcessingOutputs = ( @@ -16051,94 +15239,78 @@ const serializeAws_json1_1ProcessingResources = ( input: ProcessingResources, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterConfig !== undefined) { - bodyParams["ClusterConfig"] = serializeAws_json1_1ProcessingClusterConfig( - input.ClusterConfig, - context - ); - } - return bodyParams; + return { + ...(input.ClusterConfig !== undefined && { + ClusterConfig: serializeAws_json1_1ProcessingClusterConfig( + input.ClusterConfig, + context + ) + }) + }; }; const serializeAws_json1_1ProcessingS3Input = ( input: ProcessingS3Input, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3CompressionType !== undefined) { - bodyParams["S3CompressionType"] = input.S3CompressionType; - } - if (input.S3DataDistributionType !== undefined) { - bodyParams["S3DataDistributionType"] = input.S3DataDistributionType; - } - if (input.S3DataType !== undefined) { - bodyParams["S3DataType"] = input.S3DataType; - } - if (input.S3InputMode !== undefined) { - bodyParams["S3InputMode"] = input.S3InputMode; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ProcessingS3Output = ( input: ProcessingS3Output, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3UploadMode !== undefined) { - bodyParams["S3UploadMode"] = input.S3UploadMode; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), + ...(input.S3UploadMode !== undefined && { + S3UploadMode: input.S3UploadMode + }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1ProcessingStoppingCondition = ( input: ProcessingStoppingCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxRuntimeInSeconds !== undefined) { - bodyParams["MaxRuntimeInSeconds"] = input.MaxRuntimeInSeconds; - } - return bodyParams; + return { + ...(input.MaxRuntimeInSeconds !== undefined && { + MaxRuntimeInSeconds: input.MaxRuntimeInSeconds + }) + }; }; const serializeAws_json1_1ProductionVariant = ( input: ProductionVariant, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorType !== undefined) { - bodyParams["AcceleratorType"] = input.AcceleratorType; - } - if (input.InitialInstanceCount !== undefined) { - bodyParams["InitialInstanceCount"] = input.InitialInstanceCount; - } - if (input.InitialVariantWeight !== undefined) { - bodyParams["InitialVariantWeight"] = input.InitialVariantWeight; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.ModelName !== undefined) { - bodyParams["ModelName"] = input.ModelName; - } - if (input.VariantName !== undefined) { - bodyParams["VariantName"] = input.VariantName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ProductionVariantList = ( @@ -16154,25 +15326,22 @@ const serializeAws_json1_1PropertyNameQuery = ( input: PropertyNameQuery, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PropertyNameHint !== undefined) { - bodyParams["PropertyNameHint"] = input.PropertyNameHint; - } - return bodyParams; + return { + ...(input.PropertyNameHint !== undefined && { + PropertyNameHint: input.PropertyNameHint + }) + }; }; const serializeAws_json1_1PublicWorkforceTaskPrice = ( input: PublicWorkforceTaskPrice, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AmountInUsd !== undefined) { - bodyParams["AmountInUsd"] = serializeAws_json1_1USD( - input.AmountInUsd, - context - ); - } - return bodyParams; + return { + ...(input.AmountInUsd !== undefined && { + AmountInUsd: serializeAws_json1_1USD(input.AmountInUsd, context) + }) + }; }; const serializeAws_json1_1RealtimeInferenceInstanceTypes = ( @@ -16186,82 +15355,72 @@ const serializeAws_json1_1RenderUiTemplateRequest = ( input: RenderUiTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.Task !== undefined) { - bodyParams["Task"] = serializeAws_json1_1RenderableTask( - input.Task, - context - ); - } - if (input.UiTemplate !== undefined) { - bodyParams["UiTemplate"] = serializeAws_json1_1UiTemplate( - input.UiTemplate, - context - ); - } - return bodyParams; + return { + ...(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) + }) + }; }; const serializeAws_json1_1RenderableTask = ( input: RenderableTask, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Input !== undefined) { - bodyParams["Input"] = input.Input; - } - return bodyParams; + return { + ...(input.Input !== undefined && { Input: input.Input }) + }; }; const serializeAws_json1_1ResourceConfig = ( input: ResourceConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - if (input.VolumeSizeInGB !== undefined) { - bodyParams["VolumeSizeInGB"] = input.VolumeSizeInGB; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ResourceLimits = ( input: ResourceLimits, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxNumberOfTrainingJobs !== undefined) { - bodyParams["MaxNumberOfTrainingJobs"] = input.MaxNumberOfTrainingJobs; - } - if (input.MaxParallelTrainingJobs !== undefined) { - bodyParams["MaxParallelTrainingJobs"] = input.MaxParallelTrainingJobs; - } - return bodyParams; + return { + ...(input.MaxNumberOfTrainingJobs !== undefined && { + MaxNumberOfTrainingJobs: input.MaxNumberOfTrainingJobs + }), + ...(input.MaxParallelTrainingJobs !== undefined && { + MaxParallelTrainingJobs: input.MaxParallelTrainingJobs + }) + }; }; const serializeAws_json1_1ResourceSpec = ( input: ResourceSpec, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EnvironmentArn !== undefined) { - bodyParams["EnvironmentArn"] = input.EnvironmentArn; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - return bodyParams; + return { + ...(input.EnvironmentArn !== undefined && { + EnvironmentArn: input.EnvironmentArn + }), + ...(input.InstanceType !== undefined && { + InstanceType: input.InstanceType + }) + }; }; const serializeAws_json1_1ResponseMIMETypes = ( @@ -16275,11 +15434,11 @@ const serializeAws_json1_1RetentionPolicy = ( input: RetentionPolicy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HomeEfsFileSystem !== undefined) { - bodyParams["HomeEfsFileSystem"] = input.HomeEfsFileSystem; - } - return bodyParams; + return { + ...(input.HomeEfsFileSystem !== undefined && { + HomeEfsFileSystem: input.HomeEfsFileSystem + }) + }; }; const serializeAws_json1_1RuleParameters = ( @@ -16296,63 +15455,54 @@ const serializeAws_json1_1S3DataSource = ( input: S3DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttributeNames !== undefined) { - bodyParams["AttributeNames"] = serializeAws_json1_1AttributeNames( - input.AttributeNames, - context - ); - } - if (input.S3DataDistributionType !== undefined) { - bodyParams["S3DataDistributionType"] = input.S3DataDistributionType; - } - if (input.S3DataType !== undefined) { - bodyParams["S3DataType"] = input.S3DataType; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ScheduleConfig = ( input: ScheduleConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - return bodyParams; + return { + ...(input.ScheduleExpression !== undefined && { + ScheduleExpression: input.ScheduleExpression + }) + }; }; const serializeAws_json1_1SearchExpression = ( input: SearchExpression, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1FilterList( - input.Filters, - context - ); - } - if (input.NestedFilters !== undefined) { - bodyParams["NestedFilters"] = serializeAws_json1_1NestedFiltersList( - input.NestedFilters, - context - ); - } - if (input.Operator !== undefined) { - bodyParams["Operator"] = input.Operator; - } - if (input.SubExpressions !== undefined) { - bodyParams["SubExpressions"] = serializeAws_json1_1SearchExpressionList( - input.SubExpressions, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SearchExpressionList = ( @@ -16368,29 +15518,19 @@ const serializeAws_json1_1SearchRequest = ( input: SearchRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Resource !== undefined) { - bodyParams["Resource"] = input.Resource; - } - if (input.SearchExpression !== undefined) { - bodyParams["SearchExpression"] = serializeAws_json1_1SearchExpression( - input.SearchExpression, - context - ); - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SecurityGroupIds = ( @@ -16404,42 +15544,38 @@ const serializeAws_json1_1SharingSettings = ( input: SharingSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookOutputOption !== undefined) { - bodyParams["NotebookOutputOption"] = input.NotebookOutputOption; - } - if (input.S3KmsKeyId !== undefined) { - bodyParams["S3KmsKeyId"] = input.S3KmsKeyId; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + return { + ...(input.NotebookOutputOption !== undefined && { + NotebookOutputOption: input.NotebookOutputOption + }), + ...(input.S3KmsKeyId !== undefined && { S3KmsKeyId: input.S3KmsKeyId }), + ...(input.S3OutputPath !== undefined && { + S3OutputPath: input.S3OutputPath + }) + }; }; const serializeAws_json1_1ShuffleConfig = ( input: ShuffleConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Seed !== undefined) { - bodyParams["Seed"] = input.Seed; - } - return bodyParams; + return { + ...(input.Seed !== undefined && { Seed: input.Seed }) + }; }; const serializeAws_json1_1SourceAlgorithm = ( input: SourceAlgorithm, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AlgorithmName !== undefined) { - bodyParams["AlgorithmName"] = input.AlgorithmName; - } - if (input.ModelDataUrl !== undefined) { - bodyParams["ModelDataUrl"] = input.ModelDataUrl; - } - return bodyParams; + return { + ...(input.AlgorithmName !== undefined && { + AlgorithmName: input.AlgorithmName + }), + ...(input.ModelDataUrl !== undefined && { + ModelDataUrl: input.ModelDataUrl + }) + }; }; const serializeAws_json1_1SourceAlgorithmList = ( @@ -16455,161 +15591,160 @@ const serializeAws_json1_1SourceAlgorithmSpecification = ( input: SourceAlgorithmSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SourceAlgorithms !== undefined) { - bodyParams["SourceAlgorithms"] = serializeAws_json1_1SourceAlgorithmList( - input.SourceAlgorithms, - context - ); - } - return bodyParams; + return { + ...(input.SourceAlgorithms !== undefined && { + SourceAlgorithms: serializeAws_json1_1SourceAlgorithmList( + input.SourceAlgorithms, + context + ) + }) + }; }; const serializeAws_json1_1SourceIpConfig = ( input: SourceIpConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Cidrs !== undefined) { - bodyParams["Cidrs"] = serializeAws_json1_1Cidrs(input.Cidrs, context); - } - return bodyParams; + return { + ...(input.Cidrs !== undefined && { + Cidrs: serializeAws_json1_1Cidrs(input.Cidrs, context) + }) + }; }; const serializeAws_json1_1StartMonitoringScheduleRequest = ( input: StartMonitoringScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - return bodyParams; + return { + ...(input.MonitoringScheduleName !== undefined && { + MonitoringScheduleName: input.MonitoringScheduleName + }) + }; }; const serializeAws_json1_1StartNotebookInstanceInput = ( input: StartNotebookInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - return bodyParams; + return { + ...(input.NotebookInstanceName !== undefined && { + NotebookInstanceName: input.NotebookInstanceName + }) + }; }; const serializeAws_json1_1StopAutoMLJobRequest = ( input: StopAutoMLJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoMLJobName !== undefined) { - bodyParams["AutoMLJobName"] = input.AutoMLJobName; - } - return bodyParams; + return { + ...(input.AutoMLJobName !== undefined && { + AutoMLJobName: input.AutoMLJobName + }) + }; }; const serializeAws_json1_1StopCompilationJobRequest = ( input: StopCompilationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompilationJobName !== undefined) { - bodyParams["CompilationJobName"] = input.CompilationJobName; - } - return bodyParams; + return { + ...(input.CompilationJobName !== undefined && { + CompilationJobName: input.CompilationJobName + }) + }; }; const serializeAws_json1_1StopHyperParameterTuningJobRequest = ( input: StopHyperParameterTuningJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameterTuningJobName !== undefined) { - bodyParams["HyperParameterTuningJobName"] = - input.HyperParameterTuningJobName; - } - return bodyParams; + return { + ...(input.HyperParameterTuningJobName !== undefined && { + HyperParameterTuningJobName: input.HyperParameterTuningJobName + }) + }; }; const serializeAws_json1_1StopLabelingJobRequest = ( input: StopLabelingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LabelingJobName !== undefined) { - bodyParams["LabelingJobName"] = input.LabelingJobName; - } - return bodyParams; + return { + ...(input.LabelingJobName !== undefined && { + LabelingJobName: input.LabelingJobName + }) + }; }; const serializeAws_json1_1StopMonitoringScheduleRequest = ( input: StopMonitoringScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - return bodyParams; + return { + ...(input.MonitoringScheduleName !== undefined && { + MonitoringScheduleName: input.MonitoringScheduleName + }) + }; }; const serializeAws_json1_1StopNotebookInstanceInput = ( input: StopNotebookInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - return bodyParams; + return { + ...(input.NotebookInstanceName !== undefined && { + NotebookInstanceName: input.NotebookInstanceName + }) + }; }; const serializeAws_json1_1StopProcessingJobRequest = ( input: StopProcessingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProcessingJobName !== undefined) { - bodyParams["ProcessingJobName"] = input.ProcessingJobName; - } - return bodyParams; + return { + ...(input.ProcessingJobName !== undefined && { + ProcessingJobName: input.ProcessingJobName + }) + }; }; const serializeAws_json1_1StopTrainingJobRequest = ( input: StopTrainingJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TrainingJobName !== undefined) { - bodyParams["TrainingJobName"] = input.TrainingJobName; - } - return bodyParams; + return { + ...(input.TrainingJobName !== undefined && { + TrainingJobName: input.TrainingJobName + }) + }; }; const serializeAws_json1_1StopTransformJobRequest = ( input: StopTransformJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TransformJobName !== undefined) { - bodyParams["TransformJobName"] = input.TransformJobName; - } - return bodyParams; + return { + ...(input.TransformJobName !== undefined && { + TransformJobName: input.TransformJobName + }) + }; }; const serializeAws_json1_1StoppingCondition = ( input: StoppingCondition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxRuntimeInSeconds !== undefined) { - bodyParams["MaxRuntimeInSeconds"] = input.MaxRuntimeInSeconds; - } - if (input.MaxWaitTimeInSeconds !== undefined) { - bodyParams["MaxWaitTimeInSeconds"] = input.MaxWaitTimeInSeconds; - } - return bodyParams; + return { + ...(input.MaxRuntimeInSeconds !== undefined && { + MaxRuntimeInSeconds: input.MaxRuntimeInSeconds + }), + ...(input.MaxWaitTimeInSeconds !== undefined && { + MaxWaitTimeInSeconds: input.MaxWaitTimeInSeconds + }) + }; }; const serializeAws_json1_1Subnets = ( @@ -16623,25 +15758,21 @@ const serializeAws_json1_1SuggestionQuery = ( input: SuggestionQuery, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PropertyNameQuery !== undefined) { - bodyParams["PropertyNameQuery"] = serializeAws_json1_1PropertyNameQuery( - input.PropertyNameQuery, - context - ); - } - return bodyParams; + return { + ...(input.PropertyNameQuery !== undefined && { + PropertyNameQuery: serializeAws_json1_1PropertyNameQuery( + input.PropertyNameQuery, + context + ) + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -16669,28 +15800,26 @@ const serializeAws_json1_1TensorBoardAppSettings = ( input: TensorBoardAppSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultResourceSpec !== undefined) { - bodyParams["DefaultResourceSpec"] = serializeAws_json1_1ResourceSpec( - input.DefaultResourceSpec, - context - ); - } - return bodyParams; + return { + ...(input.DefaultResourceSpec !== undefined && { + DefaultResourceSpec: serializeAws_json1_1ResourceSpec( + input.DefaultResourceSpec, + context + ) + }) + }; }; const serializeAws_json1_1TensorBoardOutputConfig = ( input: TensorBoardOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LocalPath !== undefined) { - bodyParams["LocalPath"] = input.LocalPath; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + return { + ...(input.LocalPath !== undefined && { LocalPath: input.LocalPath }), + ...(input.S3OutputPath !== undefined && { + S3OutputPath: input.S3OutputPath + }) + }; }; const serializeAws_json1_1TrainingInstanceTypes = ( @@ -16704,109 +15833,102 @@ const serializeAws_json1_1TrainingJobDefinition = ( input: TrainingJobDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HyperParameters !== undefined) { - bodyParams["HyperParameters"] = serializeAws_json1_1HyperParameters( - input.HyperParameters, - context - ); - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.ResourceConfig !== undefined) { - bodyParams["ResourceConfig"] = serializeAws_json1_1ResourceConfig( - input.ResourceConfig, - context - ); - } - if (input.StoppingCondition !== undefined) { - bodyParams["StoppingCondition"] = serializeAws_json1_1StoppingCondition( - input.StoppingCondition, - context - ); - } - if (input.TrainingInputMode !== undefined) { - bodyParams["TrainingInputMode"] = input.TrainingInputMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1TrainingSpecification = ( input: TrainingSpecification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MetricDefinitions !== undefined) { - bodyParams["MetricDefinitions"] = serializeAws_json1_1MetricDefinitionList( - input.MetricDefinitions, - context - ); - } - if (input.SupportedHyperParameters !== undefined) { - bodyParams[ - "SupportedHyperParameters" - ] = serializeAws_json1_1HyperParameterSpecifications( - input.SupportedHyperParameters, - context - ); - } - if (input.SupportedTrainingInstanceTypes !== undefined) { - bodyParams[ - "SupportedTrainingInstanceTypes" - ] = serializeAws_json1_1TrainingInstanceTypes( - input.SupportedTrainingInstanceTypes, - context - ); - } - if (input.SupportedTuningJobObjectiveMetrics !== undefined) { - bodyParams[ - "SupportedTuningJobObjectiveMetrics" - ] = serializeAws_json1_1HyperParameterTuningJobObjectives( - input.SupportedTuningJobObjectiveMetrics, - context - ); - } - if (input.SupportsDistributedTraining !== undefined) { - bodyParams["SupportsDistributedTraining"] = - input.SupportsDistributedTraining; - } - if (input.TrainingChannels !== undefined) { - bodyParams["TrainingChannels"] = serializeAws_json1_1ChannelSpecifications( - input.TrainingChannels, - context - ); - } - if (input.TrainingImage !== undefined) { - bodyParams["TrainingImage"] = input.TrainingImage; - } - if (input.TrainingImageDigest !== undefined) { - bodyParams["TrainingImageDigest"] = input.TrainingImageDigest; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1TransformDataSource = ( input: TransformDataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3DataSource !== undefined) { - bodyParams["S3DataSource"] = serializeAws_json1_1TransformS3DataSource( - input.S3DataSource, - context - ); - } - return bodyParams; + return { + ...(input.S3DataSource !== undefined && { + S3DataSource: serializeAws_json1_1TransformS3DataSource( + input.S3DataSource, + context + ) + }) + }; }; const serializeAws_json1_1TransformEnvironmentMap = ( @@ -16823,23 +15945,19 @@ const serializeAws_json1_1TransformInput = ( input: TransformInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CompressionType !== undefined) { - bodyParams["CompressionType"] = input.CompressionType; - } - if (input.ContentType !== undefined) { - bodyParams["ContentType"] = input.ContentType; - } - if (input.DataSource !== undefined) { - bodyParams["DataSource"] = serializeAws_json1_1TransformDataSource( - input.DataSource, - context - ); - } - if (input.SplitType !== undefined) { - bodyParams["SplitType"] = input.SplitType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1TransformInstanceTypes = ( @@ -16853,106 +15971,94 @@ const serializeAws_json1_1TransformJobDefinition = ( input: TransformJobDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BatchStrategy !== undefined) { - bodyParams["BatchStrategy"] = input.BatchStrategy; - } - if (input.Environment !== undefined) { - bodyParams["Environment"] = serializeAws_json1_1TransformEnvironmentMap( - input.Environment, - context - ); - } - if (input.MaxConcurrentTransforms !== undefined) { - bodyParams["MaxConcurrentTransforms"] = input.MaxConcurrentTransforms; - } - if (input.MaxPayloadInMB !== undefined) { - bodyParams["MaxPayloadInMB"] = input.MaxPayloadInMB; - } - if (input.TransformInput !== undefined) { - bodyParams["TransformInput"] = serializeAws_json1_1TransformInput( - input.TransformInput, - context - ); - } - if (input.TransformOutput !== undefined) { - bodyParams["TransformOutput"] = serializeAws_json1_1TransformOutput( - input.TransformOutput, - context - ); - } - if (input.TransformResources !== undefined) { - bodyParams["TransformResources"] = serializeAws_json1_1TransformResources( - input.TransformResources, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1TransformOutput = ( input: TransformOutput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Accept !== undefined) { - bodyParams["Accept"] = input.Accept; - } - if (input.AssembleWith !== undefined) { - bodyParams["AssembleWith"] = input.AssembleWith; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.S3OutputPath !== undefined) { - bodyParams["S3OutputPath"] = input.S3OutputPath; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1TransformResources = ( input: TransformResources, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceCount !== undefined) { - bodyParams["InstanceCount"] = input.InstanceCount; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.VolumeKmsKeyId !== undefined) { - bodyParams["VolumeKmsKeyId"] = input.VolumeKmsKeyId; - } - return bodyParams; + return { + ...(input.InstanceCount !== undefined && { + InstanceCount: input.InstanceCount + }), + ...(input.InstanceType !== undefined && { + InstanceType: input.InstanceType + }), + ...(input.VolumeKmsKeyId !== undefined && { + VolumeKmsKeyId: input.VolumeKmsKeyId + }) + }; }; const serializeAws_json1_1TransformS3DataSource = ( input: TransformS3DataSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3DataType !== undefined) { - bodyParams["S3DataType"] = input.S3DataType; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3DataType !== undefined && { S3DataType: input.S3DataType }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1TrialComponentArtifact = ( input: TrialComponentArtifact, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MediaType !== undefined) { - bodyParams["MediaType"] = input.MediaType; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.MediaType !== undefined && { MediaType: input.MediaType }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TrialComponentArtifacts = ( @@ -16969,14 +16075,10 @@ const serializeAws_json1_1TrialComponentParameterValue = ( input: TrialComponentParameterValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NumberValue !== undefined) { - bodyParams["NumberValue"] = input.NumberValue; - } - if (input.StringValue !== undefined) { - bodyParams["StringValue"] = input.StringValue; - } - return bodyParams; + return { + ...(input.NumberValue !== undefined && { NumberValue: input.NumberValue }), + ...(input.StringValue !== undefined && { StringValue: input.StringValue }) + }; }; const serializeAws_json1_1TrialComponentParameters = ( @@ -16996,464 +16098,404 @@ const serializeAws_json1_1TrialComponentStatus = ( input: TrialComponentStatus, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Message !== undefined) { - bodyParams["Message"] = input.Message; - } - if (input.PrimaryStatus !== undefined) { - bodyParams["PrimaryStatus"] = input.PrimaryStatus; - } - return bodyParams; + return { + ...(input.Message !== undefined && { Message: input.Message }), + ...(input.PrimaryStatus !== undefined && { + PrimaryStatus: input.PrimaryStatus + }) + }; }; const serializeAws_json1_1TuningJobCompletionCriteria = ( input: TuningJobCompletionCriteria, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetObjectiveMetricValue !== undefined) { - bodyParams["TargetObjectiveMetricValue"] = input.TargetObjectiveMetricValue; - } - return bodyParams; + return { + ...(input.TargetObjectiveMetricValue !== undefined && { + TargetObjectiveMetricValue: input.TargetObjectiveMetricValue + }) + }; }; const serializeAws_json1_1USD = (input: USD, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Cents !== undefined) { - bodyParams["Cents"] = input.Cents; - } - if (input.Dollars !== undefined) { - bodyParams["Dollars"] = input.Dollars; - } - if (input.TenthFractionsOfACent !== undefined) { - bodyParams["TenthFractionsOfACent"] = input.TenthFractionsOfACent; - } - return bodyParams; + return { + ...(input.Cents !== undefined && { Cents: input.Cents }), + ...(input.Dollars !== undefined && { Dollars: input.Dollars }), + ...(input.TenthFractionsOfACent !== undefined && { + TenthFractionsOfACent: input.TenthFractionsOfACent + }) + }; }; const serializeAws_json1_1UiConfig = ( input: UiConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.UiTemplateS3Uri !== undefined) { - bodyParams["UiTemplateS3Uri"] = input.UiTemplateS3Uri; - } - return bodyParams; + return { + ...(input.UiTemplateS3Uri !== undefined && { + UiTemplateS3Uri: input.UiTemplateS3Uri + }) + }; }; const serializeAws_json1_1UiTemplate = ( input: UiTemplate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - return bodyParams; + return { + ...(input.Content !== undefined && { Content: input.Content }) + }; }; const serializeAws_json1_1UpdateCodeRepositoryInput = ( input: UpdateCodeRepositoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CodeRepositoryName !== undefined) { - bodyParams["CodeRepositoryName"] = input.CodeRepositoryName; - } - if (input.GitConfig !== undefined) { - bodyParams["GitConfig"] = serializeAws_json1_1GitConfigForUpdate( - input.GitConfig, - context - ); - } - return bodyParams; + return { + ...(input.CodeRepositoryName !== undefined && { + CodeRepositoryName: input.CodeRepositoryName + }), + ...(input.GitConfig !== undefined && { + GitConfig: serializeAws_json1_1GitConfigForUpdate( + input.GitConfig, + context + ) + }) + }; }; const serializeAws_json1_1UpdateDomainRequest = ( input: UpdateDomainRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultUserSettings !== undefined) { - bodyParams["DefaultUserSettings"] = serializeAws_json1_1UserSettings( - input.DefaultUserSettings, - context - ); - } - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - return bodyParams; + return { + ...(input.DefaultUserSettings !== undefined && { + DefaultUserSettings: serializeAws_json1_1UserSettings( + input.DefaultUserSettings, + context + ) + }), + ...(input.DomainId !== undefined && { DomainId: input.DomainId }) + }; }; const serializeAws_json1_1UpdateEndpointInput = ( input: UpdateEndpointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointConfigName !== undefined) { - bodyParams["EndpointConfigName"] = input.EndpointConfigName; - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - return bodyParams; + return { + ...(input.EndpointConfigName !== undefined && { + EndpointConfigName: input.EndpointConfigName + }), + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }) + }; }; const serializeAws_json1_1UpdateEndpointWeightsAndCapacitiesInput = ( input: UpdateEndpointWeightsAndCapacitiesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredWeightsAndCapacities !== undefined) { - bodyParams[ - "DesiredWeightsAndCapacities" - ] = serializeAws_json1_1DesiredWeightAndCapacityList( - input.DesiredWeightsAndCapacities, - context - ); - } - if (input.EndpointName !== undefined) { - bodyParams["EndpointName"] = input.EndpointName; - } - return bodyParams; + return { + ...(input.DesiredWeightsAndCapacities !== undefined && { + DesiredWeightsAndCapacities: serializeAws_json1_1DesiredWeightAndCapacityList( + input.DesiredWeightsAndCapacities, + context + ) + }), + ...(input.EndpointName !== undefined && { + EndpointName: input.EndpointName + }) + }; }; const serializeAws_json1_1UpdateExperimentRequest = ( input: UpdateExperimentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.ExperimentName !== undefined) { - bodyParams["ExperimentName"] = input.ExperimentName; - } - return bodyParams; + return { + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), + ...(input.ExperimentName !== undefined && { + ExperimentName: input.ExperimentName + }) + }; }; const serializeAws_json1_1UpdateMonitoringScheduleRequest = ( input: UpdateMonitoringScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringScheduleConfig !== undefined) { - bodyParams[ - "MonitoringScheduleConfig" - ] = serializeAws_json1_1MonitoringScheduleConfig( - input.MonitoringScheduleConfig, - context - ); - } - if (input.MonitoringScheduleName !== undefined) { - bodyParams["MonitoringScheduleName"] = input.MonitoringScheduleName; - } - return bodyParams; + return { + ...(input.MonitoringScheduleConfig !== undefined && { + MonitoringScheduleConfig: serializeAws_json1_1MonitoringScheduleConfig( + input.MonitoringScheduleConfig, + context + ) + }), + ...(input.MonitoringScheduleName !== undefined && { + MonitoringScheduleName: input.MonitoringScheduleName + }) + }; }; const serializeAws_json1_1UpdateNotebookInstanceInput = ( input: UpdateNotebookInstanceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceleratorTypes !== undefined) { - bodyParams[ - "AcceleratorTypes" - ] = serializeAws_json1_1NotebookInstanceAcceleratorTypes( - input.AcceleratorTypes, - context - ); - } - if (input.AdditionalCodeRepositories !== undefined) { - bodyParams[ - "AdditionalCodeRepositories" - ] = serializeAws_json1_1AdditionalCodeRepositoryNamesOrUrls( - input.AdditionalCodeRepositories, - context - ); - } - if (input.DefaultCodeRepository !== undefined) { - bodyParams["DefaultCodeRepository"] = input.DefaultCodeRepository; - } - if (input.DisassociateAcceleratorTypes !== undefined) { - bodyParams["DisassociateAcceleratorTypes"] = - input.DisassociateAcceleratorTypes; - } - if (input.DisassociateAdditionalCodeRepositories !== undefined) { - bodyParams["DisassociateAdditionalCodeRepositories"] = - input.DisassociateAdditionalCodeRepositories; - } - if (input.DisassociateDefaultCodeRepository !== undefined) { - bodyParams["DisassociateDefaultCodeRepository"] = - input.DisassociateDefaultCodeRepository; - } - if (input.DisassociateLifecycleConfig !== undefined) { - bodyParams["DisassociateLifecycleConfig"] = - input.DisassociateLifecycleConfig; - } - if (input.InstanceType !== undefined) { - bodyParams["InstanceType"] = input.InstanceType; - } - if (input.LifecycleConfigName !== undefined) { - bodyParams["LifecycleConfigName"] = input.LifecycleConfigName; - } - if (input.NotebookInstanceName !== undefined) { - bodyParams["NotebookInstanceName"] = input.NotebookInstanceName; - } - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.RootAccess !== undefined) { - bodyParams["RootAccess"] = input.RootAccess; - } - if (input.VolumeSizeInGB !== undefined) { - bodyParams["VolumeSizeInGB"] = input.VolumeSizeInGB; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateNotebookInstanceLifecycleConfigInput = ( input: UpdateNotebookInstanceLifecycleConfigInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotebookInstanceLifecycleConfigName !== undefined) { - bodyParams["NotebookInstanceLifecycleConfigName"] = - input.NotebookInstanceLifecycleConfigName; - } - if (input.OnCreate !== undefined) { - bodyParams[ - "OnCreate" - ] = serializeAws_json1_1NotebookInstanceLifecycleConfigList( - input.OnCreate, - context - ); - } - if (input.OnStart !== undefined) { - bodyParams[ - "OnStart" - ] = serializeAws_json1_1NotebookInstanceLifecycleConfigList( - input.OnStart, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateTrialComponentRequest = ( input: UpdateTrialComponentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.InputArtifacts !== undefined) { - bodyParams["InputArtifacts"] = serializeAws_json1_1TrialComponentArtifacts( - input.InputArtifacts, - context - ); - } - if (input.InputArtifactsToRemove !== undefined) { - bodyParams[ - "InputArtifactsToRemove" - ] = serializeAws_json1_1ListTrialComponentKey256( - input.InputArtifactsToRemove, - context - ); - } - if (input.OutputArtifacts !== undefined) { - bodyParams["OutputArtifacts"] = serializeAws_json1_1TrialComponentArtifacts( - input.OutputArtifacts, - context - ); - } - if (input.OutputArtifactsToRemove !== undefined) { - bodyParams[ - "OutputArtifactsToRemove" - ] = serializeAws_json1_1ListTrialComponentKey256( - input.OutputArtifactsToRemove, - context - ); - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1TrialComponentParameters( - input.Parameters, - context - ); - } - if (input.ParametersToRemove !== undefined) { - bodyParams[ - "ParametersToRemove" - ] = serializeAws_json1_1ListTrialComponentKey256( - input.ParametersToRemove, - context - ); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - if (input.Status !== undefined) { - bodyParams["Status"] = serializeAws_json1_1TrialComponentStatus( - input.Status, - context - ); - } - if (input.TrialComponentName !== undefined) { - bodyParams["TrialComponentName"] = input.TrialComponentName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateTrialRequest = ( input: UpdateTrialRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.TrialName !== undefined) { - bodyParams["TrialName"] = input.TrialName; - } - return bodyParams; + return { + ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), + ...(input.TrialName !== undefined && { TrialName: input.TrialName }) + }; }; const serializeAws_json1_1UpdateUserProfileRequest = ( input: UpdateUserProfileRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainId !== undefined) { - bodyParams["DomainId"] = input.DomainId; - } - if (input.UserProfileName !== undefined) { - bodyParams["UserProfileName"] = input.UserProfileName; - } - if (input.UserSettings !== undefined) { - bodyParams["UserSettings"] = serializeAws_json1_1UserSettings( - input.UserSettings, - context - ); - } - return bodyParams; + return { + ...(input.DomainId !== undefined && { DomainId: input.DomainId }), + ...(input.UserProfileName !== undefined && { + UserProfileName: input.UserProfileName + }), + ...(input.UserSettings !== undefined && { + UserSettings: serializeAws_json1_1UserSettings( + input.UserSettings, + context + ) + }) + }; }; const serializeAws_json1_1UpdateWorkforceRequest = ( input: UpdateWorkforceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SourceIpConfig !== undefined) { - bodyParams["SourceIpConfig"] = serializeAws_json1_1SourceIpConfig( - input.SourceIpConfig, - context - ); - } - if (input.WorkforceName !== undefined) { - bodyParams["WorkforceName"] = input.WorkforceName; - } - return bodyParams; + return { + ...(input.SourceIpConfig !== undefined && { + SourceIpConfig: serializeAws_json1_1SourceIpConfig( + input.SourceIpConfig, + context + ) + }), + ...(input.WorkforceName !== undefined && { + WorkforceName: input.WorkforceName + }) + }; }; const serializeAws_json1_1UpdateWorkteamRequest = ( input: UpdateWorkteamRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.MemberDefinitions !== undefined) { - bodyParams["MemberDefinitions"] = serializeAws_json1_1MemberDefinitions( - input.MemberDefinitions, - context - ); - } - if (input.NotificationConfiguration !== undefined) { - bodyParams[ - "NotificationConfiguration" - ] = serializeAws_json1_1NotificationConfiguration( - input.NotificationConfiguration, - context - ); - } - if (input.WorkteamName !== undefined) { - bodyParams["WorkteamName"] = input.WorkteamName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UserSettings = ( input: UserSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExecutionRole !== undefined) { - bodyParams["ExecutionRole"] = input.ExecutionRole; - } - if (input.JupyterServerAppSettings !== undefined) { - bodyParams[ - "JupyterServerAppSettings" - ] = serializeAws_json1_1JupyterServerAppSettings( - input.JupyterServerAppSettings, - context - ); - } - if (input.KernelGatewayAppSettings !== undefined) { - bodyParams[ - "KernelGatewayAppSettings" - ] = serializeAws_json1_1KernelGatewayAppSettings( - input.KernelGatewayAppSettings, - context - ); - } - if (input.SecurityGroups !== undefined) { - bodyParams["SecurityGroups"] = serializeAws_json1_1SecurityGroupIds( - input.SecurityGroups, - context - ); - } - if (input.SharingSettings !== undefined) { - bodyParams["SharingSettings"] = serializeAws_json1_1SharingSettings( - input.SharingSettings, - context - ); - } - if (input.TensorBoardAppSettings !== undefined) { - bodyParams[ - "TensorBoardAppSettings" - ] = serializeAws_json1_1TensorBoardAppSettings( - input.TensorBoardAppSettings, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1VpcConfig = ( input: VpcConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_json1_1VpcSecurityGroupIds( - input.SecurityGroupIds, - context - ); - } - if (input.Subnets !== undefined) { - bodyParams["Subnets"] = serializeAws_json1_1Subnets(input.Subnets, context); - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_json1_1VpcSecurityGroupIds( + input.SecurityGroupIds, + context + ) + }), + ...(input.Subnets !== undefined && { + Subnets: serializeAws_json1_1Subnets(input.Subnets, context) + }) + }; }; const serializeAws_json1_1VpcSecurityGroupIds = ( diff --git a/clients/client-savingsplans/protocols/Aws_restJson1_1.ts b/clients/client-savingsplans/protocols/Aws_restJson1_1.ts index 351ebfb338c0..68d1bbbe8050 100644 --- a/clients/client-savingsplans/protocols/Aws_restJson1_1.ts +++ b/clients/client-savingsplans/protocols/Aws_restJson1_1.ts @@ -1243,17 +1243,12 @@ const serializeAws_restJson1_1SavingsPlanOfferingFilterElement = ( input: SavingsPlanOfferingFilterElement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_restJson1_1FilterValuesList( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_restJson1_1FilterValuesList(input.values, context) + }) + }; }; const serializeAws_restJson1_1SavingsPlanOfferingFiltersList = ( @@ -1269,17 +1264,12 @@ const serializeAws_restJson1_1SavingsPlanOfferingRateFilterElement = ( input: SavingsPlanOfferingRateFilterElement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_restJson1_1FilterValuesList( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_restJson1_1FilterValuesList(input.values, context) + }) + }; }; const serializeAws_restJson1_1SavingsPlanOfferingRateFiltersList = ( @@ -1379,17 +1369,12 @@ const serializeAws_restJson1_1SavingsPlanFilter = ( input: SavingsPlanFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_restJson1_1ListOfStrings( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_restJson1_1ListOfStrings(input.values, context) + }) + }; }; const serializeAws_restJson1_1SavingsPlanFilterList = ( @@ -1412,17 +1397,12 @@ const serializeAws_restJson1_1SavingsPlanRateFilter = ( input: SavingsPlanRateFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.values !== undefined) { - bodyParams["values"] = serializeAws_restJson1_1ListOfStrings( - input.values, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.values !== undefined && { + values: serializeAws_restJson1_1ListOfStrings(input.values, context) + }) + }; }; const serializeAws_restJson1_1SavingsPlanRateFilterList = ( diff --git a/clients/client-secrets-manager/protocols/Aws_json1_1.ts b/clients/client-secrets-manager/protocols/Aws_json1_1.ts index 60effe3d6064..95ed007facd0 100644 --- a/clients/client-secrets-manager/protocols/Aws_json1_1.ts +++ b/clients/client-secrets-manager/protocols/Aws_json1_1.ts @@ -2383,267 +2383,214 @@ const serializeAws_json1_1CancelRotateSecretRequest = ( input: CancelRotateSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1CreateSecretRequest = ( input: CreateSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SecretBinary !== undefined) { - bodyParams["SecretBinary"] = context.base64Encoder(input.SecretBinary); - } - if (input.SecretString !== undefined) { - bodyParams["SecretString"] = input.SecretString; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagListType(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DeleteResourcePolicyRequest = ( input: DeleteResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1DeleteSecretRequest = ( input: DeleteSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForceDeleteWithoutRecovery !== undefined) { - bodyParams["ForceDeleteWithoutRecovery"] = input.ForceDeleteWithoutRecovery; - } - if (input.RecoveryWindowInDays !== undefined) { - bodyParams["RecoveryWindowInDays"] = input.RecoveryWindowInDays; - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.ForceDeleteWithoutRecovery !== undefined && { + ForceDeleteWithoutRecovery: input.ForceDeleteWithoutRecovery + }), + ...(input.RecoveryWindowInDays !== undefined && { + RecoveryWindowInDays: input.RecoveryWindowInDays + }), + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1DescribeSecretRequest = ( input: DescribeSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1GetRandomPasswordRequest = ( input: GetRandomPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludeCharacters !== undefined) { - bodyParams["ExcludeCharacters"] = input.ExcludeCharacters; - } - if (input.ExcludeLowercase !== undefined) { - bodyParams["ExcludeLowercase"] = input.ExcludeLowercase; - } - if (input.ExcludeNumbers !== undefined) { - bodyParams["ExcludeNumbers"] = input.ExcludeNumbers; - } - if (input.ExcludePunctuation !== undefined) { - bodyParams["ExcludePunctuation"] = input.ExcludePunctuation; - } - if (input.ExcludeUppercase !== undefined) { - bodyParams["ExcludeUppercase"] = input.ExcludeUppercase; - } - if (input.IncludeSpace !== undefined) { - bodyParams["IncludeSpace"] = input.IncludeSpace; - } - if (input.PasswordLength !== undefined) { - bodyParams["PasswordLength"] = input.PasswordLength; - } - if (input.RequireEachIncludedType !== undefined) { - bodyParams["RequireEachIncludedType"] = input.RequireEachIncludedType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetResourcePolicyRequest = ( input: GetResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1GetSecretValueRequest = ( input: GetSecretValueRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - if (input.VersionId !== undefined) { - bodyParams["VersionId"] = input.VersionId; - } - if (input.VersionStage !== undefined) { - bodyParams["VersionStage"] = input.VersionStage; - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.VersionId !== undefined && { VersionId: input.VersionId }), + ...(input.VersionStage !== undefined && { + VersionStage: input.VersionStage + }) + }; }; const serializeAws_json1_1ListSecretVersionIdsRequest = ( input: ListSecretVersionIdsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IncludeDeprecated !== undefined) { - bodyParams["IncludeDeprecated"] = input.IncludeDeprecated; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListSecretsRequest = ( input: ListSecretsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1PutResourcePolicyRequest = ( input: PutResourcePolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourcePolicy !== undefined) { - bodyParams["ResourcePolicy"] = input.ResourcePolicy; - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.ResourcePolicy !== undefined && { + ResourcePolicy: input.ResourcePolicy + }), + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1PutSecretValueRequest = ( input: PutSecretValueRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.SecretBinary !== undefined) { - bodyParams["SecretBinary"] = context.base64Encoder(input.SecretBinary); - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - if (input.SecretString !== undefined) { - bodyParams["SecretString"] = input.SecretString; - } - if (input.VersionStages !== undefined) { - bodyParams["VersionStages"] = serializeAws_json1_1SecretVersionStagesType( - input.VersionStages, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RestoreSecretRequest = ( input: RestoreSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }) + }; }; const serializeAws_json1_1RotateSecretRequest = ( input: RotateSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.RotationLambdaARN !== undefined) { - bodyParams["RotationLambdaARN"] = input.RotationLambdaARN; - } - if (input.RotationRules !== undefined) { - bodyParams["RotationRules"] = serializeAws_json1_1RotationRulesType( - input.RotationRules, - context - ); - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RotationRulesType = ( input: RotationRulesType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomaticallyAfterDays !== undefined) { - bodyParams["AutomaticallyAfterDays"] = input.AutomaticallyAfterDays; - } - return bodyParams; + return { + ...(input.AutomaticallyAfterDays !== undefined && { + AutomaticallyAfterDays: input.AutomaticallyAfterDays + }) + }; }; const serializeAws_json1_1SecretVersionStagesType = ( @@ -2654,14 +2601,10 @@ const serializeAws_json1_1SecretVersionStagesType = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyListType = ( @@ -2682,80 +2625,60 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagListType(input.Tags, context); - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagListType(input.Tags, context) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyListType( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.SecretId !== undefined && { SecretId: input.SecretId }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyListType(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateSecretRequest = ( input: UpdateSecretRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken === undefined) { - input.ClientRequestToken = generateIdempotencyToken(); - } - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.KmsKeyId !== undefined) { - bodyParams["KmsKeyId"] = input.KmsKeyId; - } - if (input.SecretBinary !== undefined) { - bodyParams["SecretBinary"] = context.base64Encoder(input.SecretBinary); - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - if (input.SecretString !== undefined) { - bodyParams["SecretString"] = input.SecretString; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateSecretVersionStageRequest = ( input: UpdateSecretVersionStageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MoveToVersionId !== undefined) { - bodyParams["MoveToVersionId"] = input.MoveToVersionId; - } - if (input.RemoveFromVersionId !== undefined) { - bodyParams["RemoveFromVersionId"] = input.RemoveFromVersionId; - } - if (input.SecretId !== undefined) { - bodyParams["SecretId"] = input.SecretId; - } - if (input.VersionStage !== undefined) { - bodyParams["VersionStage"] = input.VersionStage; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1CancelRotateSecretResponse = ( diff --git a/clients/client-securityhub/protocols/Aws_restJson1_1.ts b/clients/client-securityhub/protocols/Aws_restJson1_1.ts index 8b88fbb5241d..11098bc2529f 100644 --- a/clients/client-securityhub/protocols/Aws_restJson1_1.ts +++ b/clients/client-securityhub/protocols/Aws_restJson1_1.ts @@ -5743,14 +5743,10 @@ const serializeAws_restJson1_1AccountDetails = ( input: AccountDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - return bodyParams; + return { + ...(input.AccountId !== undefined && { AccountId: input.AccountId }), + ...(input.Email !== undefined && { Email: input.Email }) + }; }; const serializeAws_restJson1_1AccountDetailsList = ( @@ -5780,14 +5776,10 @@ const serializeAws_restJson1_1AvailabilityZone = ( input: AvailabilityZone, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.ZoneName !== undefined) { - bodyParams["ZoneName"] = input.ZoneName; - } - return bodyParams; + return { + ...(input.SubnetId !== undefined && { SubnetId: input.SubnetId }), + ...(input.ZoneName !== undefined && { ZoneName: input.ZoneName }) + }; }; const serializeAws_restJson1_1AvailabilityZones = ( @@ -5803,76 +5795,52 @@ const serializeAws_restJson1_1AwsCloudFrontDistributionDetails = ( input: AwsCloudFrontDistributionDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.ETag !== undefined) { - bodyParams["ETag"] = input.ETag; - } - if (input.LastModifiedTime !== undefined) { - bodyParams["LastModifiedTime"] = input.LastModifiedTime; - } - if (input.Logging !== undefined) { - bodyParams[ - "Logging" - ] = serializeAws_restJson1_1AwsCloudFrontDistributionLogging( - input.Logging, - context - ); - } - if (input.Origins !== undefined) { - bodyParams[ - "Origins" - ] = serializeAws_restJson1_1AwsCloudFrontDistributionOrigins( - input.Origins, - context - ); - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.WebAclId !== undefined) { - bodyParams["WebAclId"] = input.WebAclId; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.ETag !== undefined && { ETag: input.ETag }), + ...(input.LastModifiedTime !== undefined && { + LastModifiedTime: input.LastModifiedTime + }), + ...(input.Logging !== undefined && { + Logging: serializeAws_restJson1_1AwsCloudFrontDistributionLogging( + input.Logging, + context + ) + }), + ...(input.Origins !== undefined && { + Origins: serializeAws_restJson1_1AwsCloudFrontDistributionOrigins( + input.Origins, + context + ) + }), + ...(input.Status !== undefined && { Status: input.Status }), + ...(input.WebAclId !== undefined && { WebAclId: input.WebAclId }) + }; }; const serializeAws_restJson1_1AwsCloudFrontDistributionLogging = ( input: AwsCloudFrontDistributionLogging, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.IncludeCookies !== undefined) { - bodyParams["IncludeCookies"] = input.IncludeCookies; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1AwsCloudFrontDistributionOriginItem = ( input: AwsCloudFrontDistributionOriginItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.OriginPath !== undefined) { - bodyParams["OriginPath"] = input.OriginPath; - } - return bodyParams; + return { + ...(input.DomainName !== undefined && { DomainName: input.DomainName }), + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.OriginPath !== undefined && { OriginPath: input.OriginPath }) + }; }; const serializeAws_restJson1_1AwsCloudFrontDistributionOriginItemList = ( @@ -5888,351 +5856,248 @@ const serializeAws_restJson1_1AwsCloudFrontDistributionOrigins = ( input: AwsCloudFrontDistributionOrigins, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Items !== undefined) { - bodyParams[ - "Items" - ] = serializeAws_restJson1_1AwsCloudFrontDistributionOriginItemList( - input.Items, - context - ); - } - return bodyParams; + return { + ...(input.Items !== undefined && { + Items: serializeAws_restJson1_1AwsCloudFrontDistributionOriginItemList( + input.Items, + context + ) + }) + }; }; const serializeAws_restJson1_1AwsEc2InstanceDetails = ( input: AwsEc2InstanceDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamInstanceProfileArn !== undefined) { - bodyParams["IamInstanceProfileArn"] = input.IamInstanceProfileArn; - } - if (input.ImageId !== undefined) { - bodyParams["ImageId"] = input.ImageId; - } - if (input.IpV4Addresses !== undefined) { - bodyParams["IpV4Addresses"] = serializeAws_restJson1_1StringList( - input.IpV4Addresses, - context - ); - } - if (input.IpV6Addresses !== undefined) { - bodyParams["IpV6Addresses"] = serializeAws_restJson1_1StringList( - input.IpV6Addresses, - context - ); - } - if (input.KeyName !== undefined) { - bodyParams["KeyName"] = input.KeyName; - } - if (input.LaunchedAt !== undefined) { - bodyParams["LaunchedAt"] = input.LaunchedAt; - } - if (input.SubnetId !== undefined) { - bodyParams["SubnetId"] = input.SubnetId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + return { + ...(input.IamInstanceProfileArn !== undefined && { + IamInstanceProfileArn: input.IamInstanceProfileArn + }), + ...(input.ImageId !== undefined && { ImageId: input.ImageId }), + ...(input.IpV4Addresses !== undefined && { + IpV4Addresses: serializeAws_restJson1_1StringList( + input.IpV4Addresses, + context + ) + }), + ...(input.IpV6Addresses !== undefined && { + IpV6Addresses: serializeAws_restJson1_1StringList( + 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 }) + }; }; const serializeAws_restJson1_1AwsElbv2LoadBalancerDetails = ( input: AwsElbv2LoadBalancerDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AvailabilityZones !== undefined) { - bodyParams["AvailabilityZones"] = serializeAws_restJson1_1AvailabilityZones( - input.AvailabilityZones, - context - ); - } - if (input.CanonicalHostedZoneId !== undefined) { - bodyParams["CanonicalHostedZoneId"] = input.CanonicalHostedZoneId; - } - if (input.CreatedTime !== undefined) { - bodyParams["CreatedTime"] = input.CreatedTime; - } - if (input.DNSName !== undefined) { - bodyParams["DNSName"] = input.DNSName; - } - if (input.IpAddressType !== undefined) { - bodyParams["IpAddressType"] = input.IpAddressType; - } - if (input.Scheme !== undefined) { - bodyParams["Scheme"] = input.Scheme; - } - if (input.SecurityGroups !== undefined) { - bodyParams["SecurityGroups"] = serializeAws_restJson1_1SecurityGroups( - input.SecurityGroups, - context - ); - } - if (input.State !== undefined) { - bodyParams["State"] = serializeAws_restJson1_1LoadBalancerState( - input.State, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + return { + ...(input.AvailabilityZones !== undefined && { + AvailabilityZones: serializeAws_restJson1_1AvailabilityZones( + 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_restJson1_1SecurityGroups( + input.SecurityGroups, + context + ) + }), + ...(input.State !== undefined && { + State: serializeAws_restJson1_1LoadBalancerState(input.State, context) + }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.VpcId !== undefined && { VpcId: input.VpcId }) + }; }; const serializeAws_restJson1_1AwsIamAccessKeyDetails = ( input: AwsIamAccessKeyDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatedAt !== undefined) { - bodyParams["CreatedAt"] = input.CreatedAt; - } - if (input.PrincipalId !== undefined) { - bodyParams["PrincipalId"] = input.PrincipalId; - } - if (input.PrincipalName !== undefined) { - bodyParams["PrincipalName"] = input.PrincipalName; - } - if (input.PrincipalType !== undefined) { - bodyParams["PrincipalType"] = input.PrincipalType; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(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.Status !== undefined && { Status: input.Status }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_restJson1_1AwsIamRoleDetails = ( input: AwsIamRoleDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssumeRolePolicyDocument !== undefined) { - bodyParams["AssumeRolePolicyDocument"] = input.AssumeRolePolicyDocument; - } - if (input.CreateDate !== undefined) { - bodyParams["CreateDate"] = input.CreateDate; - } - if (input.MaxSessionDuration !== undefined) { - bodyParams["MaxSessionDuration"] = input.MaxSessionDuration; - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - if (input.RoleId !== undefined) { - bodyParams["RoleId"] = input.RoleId; - } - if (input.RoleName !== undefined) { - bodyParams["RoleName"] = input.RoleName; - } - return bodyParams; + return { + ...(input.AssumeRolePolicyDocument !== undefined && { + AssumeRolePolicyDocument: input.AssumeRolePolicyDocument + }), + ...(input.CreateDate !== undefined && { CreateDate: input.CreateDate }), + ...(input.MaxSessionDuration !== undefined && { + MaxSessionDuration: input.MaxSessionDuration + }), + ...(input.Path !== undefined && { Path: input.Path }), + ...(input.RoleId !== undefined && { RoleId: input.RoleId }), + ...(input.RoleName !== undefined && { RoleName: input.RoleName }) + }; }; const serializeAws_restJson1_1AwsKmsKeyDetails = ( input: AwsKmsKeyDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AWSAccountId !== undefined) { - bodyParams["AWSAccountId"] = input.AWSAccountId; - } - if (input.CreationDate !== undefined) { - bodyParams["CreationDate"] = input.CreationDate; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.KeyManager !== undefined) { - bodyParams["KeyManager"] = input.KeyManager; - } - if (input.KeyState !== undefined) { - bodyParams["KeyState"] = input.KeyState; - } - if (input.Origin !== undefined) { - bodyParams["Origin"] = input.Origin; - } - return bodyParams; + return { + ...(input.AWSAccountId !== undefined && { + AWSAccountId: input.AWSAccountId + }), + ...(input.CreationDate !== undefined && { + CreationDate: input.CreationDate + }), + ...(input.KeyId !== undefined && { KeyId: input.KeyId }), + ...(input.KeyManager !== undefined && { KeyManager: input.KeyManager }), + ...(input.KeyState !== undefined && { KeyState: input.KeyState }), + ...(input.Origin !== undefined && { Origin: input.Origin }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionCode = ( input: AwsLambdaFunctionCode, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Bucket !== undefined) { - bodyParams["S3Bucket"] = input.S3Bucket; - } - if (input.S3Key !== undefined) { - bodyParams["S3Key"] = input.S3Key; - } - if (input.S3ObjectVersion !== undefined) { - bodyParams["S3ObjectVersion"] = input.S3ObjectVersion; - } - if (input.ZipFile !== undefined) { - bodyParams["ZipFile"] = input.ZipFile; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionDeadLetterConfig = ( input: AwsLambdaFunctionDeadLetterConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetArn !== undefined) { - bodyParams["TargetArn"] = input.TargetArn; - } - return bodyParams; + return { + ...(input.TargetArn !== undefined && { TargetArn: input.TargetArn }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionDetails = ( input: AwsLambdaFunctionDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Code !== undefined) { - bodyParams["Code"] = serializeAws_restJson1_1AwsLambdaFunctionCode( - input.Code, - context - ); - } - if (input.CodeSha256 !== undefined) { - bodyParams["CodeSha256"] = input.CodeSha256; - } - if (input.DeadLetterConfig !== undefined) { - bodyParams[ - "DeadLetterConfig" - ] = serializeAws_restJson1_1AwsLambdaFunctionDeadLetterConfig( - input.DeadLetterConfig, - context - ); - } - if (input.Environment !== undefined) { - bodyParams[ - "Environment" - ] = serializeAws_restJson1_1AwsLambdaFunctionEnvironment( - input.Environment, - context - ); - } - if (input.FunctionName !== undefined) { - bodyParams["FunctionName"] = input.FunctionName; - } - if (input.Handler !== undefined) { - bodyParams["Handler"] = input.Handler; - } - if (input.KmsKeyArn !== undefined) { - bodyParams["KmsKeyArn"] = input.KmsKeyArn; - } - if (input.LastModified !== undefined) { - bodyParams["LastModified"] = input.LastModified; - } - if (input.Layers !== undefined) { - bodyParams["Layers"] = serializeAws_restJson1_1AwsLambdaFunctionLayerList( - input.Layers, - context - ); - } - if (input.MasterArn !== undefined) { - bodyParams["MasterArn"] = input.MasterArn; - } - if (input.MemorySize !== undefined) { - bodyParams["MemorySize"] = input.MemorySize; - } - if (input.RevisionId !== undefined) { - bodyParams["RevisionId"] = input.RevisionId; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Runtime !== undefined) { - bodyParams["Runtime"] = input.Runtime; - } - if (input.Timeout !== undefined) { - bodyParams["Timeout"] = input.Timeout; - } - if (input.TracingConfig !== undefined) { - bodyParams[ - "TracingConfig" - ] = serializeAws_restJson1_1AwsLambdaFunctionTracingConfig( - input.TracingConfig, - context - ); - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - if (input.VpcConfig !== undefined) { - bodyParams[ - "VpcConfig" - ] = serializeAws_restJson1_1AwsLambdaFunctionVpcConfig( - input.VpcConfig, - context - ); - } - return bodyParams; + return { + ...(input.Code !== undefined && { + Code: serializeAws_restJson1_1AwsLambdaFunctionCode(input.Code, context) + }), + ...(input.CodeSha256 !== undefined && { CodeSha256: input.CodeSha256 }), + ...(input.DeadLetterConfig !== undefined && { + DeadLetterConfig: serializeAws_restJson1_1AwsLambdaFunctionDeadLetterConfig( + input.DeadLetterConfig, + context + ) + }), + ...(input.Environment !== undefined && { + Environment: serializeAws_restJson1_1AwsLambdaFunctionEnvironment( + 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_restJson1_1AwsLambdaFunctionLayerList( + 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_restJson1_1AwsLambdaFunctionTracingConfig( + input.TracingConfig, + context + ) + }), + ...(input.Version !== undefined && { Version: input.Version }), + ...(input.VpcConfig !== undefined && { + VpcConfig: serializeAws_restJson1_1AwsLambdaFunctionVpcConfig( + input.VpcConfig, + context + ) + }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionEnvironment = ( input: AwsLambdaFunctionEnvironment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Error !== undefined) { - bodyParams[ - "Error" - ] = serializeAws_restJson1_1AwsLambdaFunctionEnvironmentError( - input.Error, - context - ); - } - if (input.Variables !== undefined) { - bodyParams["Variables"] = serializeAws_restJson1_1FieldMap( - input.Variables, - context - ); - } - return bodyParams; + return { + ...(input.Error !== undefined && { + Error: serializeAws_restJson1_1AwsLambdaFunctionEnvironmentError( + input.Error, + context + ) + }), + ...(input.Variables !== undefined && { + Variables: serializeAws_restJson1_1FieldMap(input.Variables, context) + }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionEnvironmentError = ( input: AwsLambdaFunctionEnvironmentError, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ErrorCode !== undefined) { - bodyParams["ErrorCode"] = input.ErrorCode; - } - if (input.Message !== undefined) { - bodyParams["Message"] = input.Message; - } - return bodyParams; + return { + ...(input.ErrorCode !== undefined && { ErrorCode: input.ErrorCode }), + ...(input.Message !== undefined && { Message: input.Message }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionLayer = ( input: AwsLambdaFunctionLayer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.CodeSize !== undefined) { - bodyParams["CodeSize"] = input.CodeSize; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.CodeSize !== undefined && { CodeSize: input.CodeSize }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionLayerList = ( @@ -6248,746 +6113,625 @@ const serializeAws_restJson1_1AwsLambdaFunctionTracingConfig = ( input: AwsLambdaFunctionTracingConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - return bodyParams; + return { + ...(input.Mode !== undefined && { Mode: input.Mode }) + }; }; const serializeAws_restJson1_1AwsLambdaFunctionVpcConfig = ( input: AwsLambdaFunctionVpcConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SecurityGroupIds !== undefined) { - bodyParams["SecurityGroupIds"] = serializeAws_restJson1_1NonEmptyStringList( - input.SecurityGroupIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_restJson1_1NonEmptyStringList( - input.SubnetIds, - context - ); - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + return { + ...(input.SecurityGroupIds !== undefined && { + SecurityGroupIds: serializeAws_restJson1_1NonEmptyStringList( + input.SecurityGroupIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_restJson1_1NonEmptyStringList( + input.SubnetIds, + context + ) + }), + ...(input.VpcId !== undefined && { VpcId: input.VpcId }) + }; }; const serializeAws_restJson1_1AwsS3BucketDetails = ( input: AwsS3BucketDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OwnerId !== undefined) { - bodyParams["OwnerId"] = input.OwnerId; - } - if (input.OwnerName !== undefined) { - bodyParams["OwnerName"] = input.OwnerName; - } - return bodyParams; + return { + ...(input.OwnerId !== undefined && { OwnerId: input.OwnerId }), + ...(input.OwnerName !== undefined && { OwnerName: input.OwnerName }) + }; }; const serializeAws_restJson1_1AwsSecurityFinding = ( input: AwsSecurityFinding, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsAccountId !== undefined) { - bodyParams["AwsAccountId"] = input.AwsAccountId; - } - if (input.Compliance !== undefined) { - bodyParams["Compliance"] = serializeAws_restJson1_1Compliance( - input.Compliance, - context - ); - } - if (input.Confidence !== undefined) { - bodyParams["Confidence"] = input.Confidence; - } - if (input.CreatedAt !== undefined) { - bodyParams["CreatedAt"] = input.CreatedAt; - } - if (input.Criticality !== undefined) { - bodyParams["Criticality"] = input.Criticality; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.FirstObservedAt !== undefined) { - bodyParams["FirstObservedAt"] = input.FirstObservedAt; - } - if (input.GeneratorId !== undefined) { - bodyParams["GeneratorId"] = input.GeneratorId; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LastObservedAt !== undefined) { - bodyParams["LastObservedAt"] = input.LastObservedAt; - } - if (input.Malware !== undefined) { - bodyParams["Malware"] = serializeAws_restJson1_1MalwareList( - input.Malware, - context - ); - } - if (input.Network !== undefined) { - bodyParams["Network"] = serializeAws_restJson1_1Network( - input.Network, - context - ); - } - if (input.Note !== undefined) { - bodyParams["Note"] = serializeAws_restJson1_1Note(input.Note, context); - } - if (input.Process !== undefined) { - bodyParams["Process"] = serializeAws_restJson1_1ProcessDetails( - input.Process, - context - ); - } - if (input.ProductArn !== undefined) { - bodyParams["ProductArn"] = input.ProductArn; - } - if (input.ProductFields !== undefined) { - bodyParams["ProductFields"] = serializeAws_restJson1_1FieldMap( - input.ProductFields, - context - ); - } - if (input.RecordState !== undefined) { - bodyParams["RecordState"] = input.RecordState; - } - if (input.RelatedFindings !== undefined) { - bodyParams["RelatedFindings"] = serializeAws_restJson1_1RelatedFindingList( - input.RelatedFindings, - context - ); - } - if (input.Remediation !== undefined) { - bodyParams["Remediation"] = serializeAws_restJson1_1Remediation( - input.Remediation, - context - ); - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_restJson1_1ResourceList( - input.Resources, - context - ); - } - if (input.SchemaVersion !== undefined) { - bodyParams["SchemaVersion"] = input.SchemaVersion; - } - if (input.Severity !== undefined) { - bodyParams["Severity"] = serializeAws_restJson1_1Severity( - input.Severity, - context - ); - } - if (input.SourceUrl !== undefined) { - bodyParams["SourceUrl"] = input.SourceUrl; - } - if (input.ThreatIntelIndicators !== undefined) { - bodyParams[ - "ThreatIntelIndicators" - ] = serializeAws_restJson1_1ThreatIntelIndicatorList( - input.ThreatIntelIndicators, - context - ); - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - if (input.Types !== undefined) { - bodyParams["Types"] = serializeAws_restJson1_1TypeList( - input.Types, - context - ); - } - if (input.UpdatedAt !== undefined) { - bodyParams["UpdatedAt"] = input.UpdatedAt; - } - if (input.UserDefinedFields !== undefined) { - bodyParams["UserDefinedFields"] = serializeAws_restJson1_1FieldMap( - input.UserDefinedFields, - context - ); - } - if (input.VerificationState !== undefined) { - bodyParams["VerificationState"] = input.VerificationState; - } - if (input.WorkflowState !== undefined) { - bodyParams["WorkflowState"] = input.WorkflowState; - } - return bodyParams; + return { + ...(input.AwsAccountId !== undefined && { + AwsAccountId: input.AwsAccountId + }), + ...(input.Compliance !== undefined && { + Compliance: serializeAws_restJson1_1Compliance(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_restJson1_1MalwareList(input.Malware, context) + }), + ...(input.Network !== undefined && { + Network: serializeAws_restJson1_1Network(input.Network, context) + }), + ...(input.Note !== undefined && { + Note: serializeAws_restJson1_1Note(input.Note, context) + }), + ...(input.Process !== undefined && { + Process: serializeAws_restJson1_1ProcessDetails(input.Process, context) + }), + ...(input.ProductArn !== undefined && { ProductArn: input.ProductArn }), + ...(input.ProductFields !== undefined && { + ProductFields: serializeAws_restJson1_1FieldMap( + input.ProductFields, + context + ) + }), + ...(input.RecordState !== undefined && { RecordState: input.RecordState }), + ...(input.RelatedFindings !== undefined && { + RelatedFindings: serializeAws_restJson1_1RelatedFindingList( + input.RelatedFindings, + context + ) + }), + ...(input.Remediation !== undefined && { + Remediation: serializeAws_restJson1_1Remediation( + input.Remediation, + context + ) + }), + ...(input.Resources !== undefined && { + Resources: serializeAws_restJson1_1ResourceList(input.Resources, context) + }), + ...(input.SchemaVersion !== undefined && { + SchemaVersion: input.SchemaVersion + }), + ...(input.Severity !== undefined && { + Severity: serializeAws_restJson1_1Severity(input.Severity, context) + }), + ...(input.SourceUrl !== undefined && { SourceUrl: input.SourceUrl }), + ...(input.ThreatIntelIndicators !== undefined && { + ThreatIntelIndicators: serializeAws_restJson1_1ThreatIntelIndicatorList( + input.ThreatIntelIndicators, + context + ) + }), + ...(input.Title !== undefined && { Title: input.Title }), + ...(input.Types !== undefined && { + Types: serializeAws_restJson1_1TypeList(input.Types, context) + }), + ...(input.UpdatedAt !== undefined && { UpdatedAt: input.UpdatedAt }), + ...(input.UserDefinedFields !== undefined && { + UserDefinedFields: serializeAws_restJson1_1FieldMap( + input.UserDefinedFields, + context + ) + }), + ...(input.VerificationState !== undefined && { + VerificationState: input.VerificationState + }), + ...(input.WorkflowState !== undefined && { + WorkflowState: input.WorkflowState + }) + }; }; const serializeAws_restJson1_1AwsSecurityFindingFilters = ( input: AwsSecurityFindingFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsAccountId !== undefined) { - bodyParams["AwsAccountId"] = serializeAws_restJson1_1StringFilterList( - input.AwsAccountId, - context - ); - } - if (input.CompanyName !== undefined) { - bodyParams["CompanyName"] = serializeAws_restJson1_1StringFilterList( - input.CompanyName, - context - ); - } - if (input.ComplianceStatus !== undefined) { - bodyParams["ComplianceStatus"] = serializeAws_restJson1_1StringFilterList( - input.ComplianceStatus, - context - ); - } - if (input.Confidence !== undefined) { - bodyParams["Confidence"] = serializeAws_restJson1_1NumberFilterList( - input.Confidence, - context - ); - } - if (input.CreatedAt !== undefined) { - bodyParams["CreatedAt"] = serializeAws_restJson1_1DateFilterList( - input.CreatedAt, - context - ); - } - if (input.Criticality !== undefined) { - bodyParams["Criticality"] = serializeAws_restJson1_1NumberFilterList( - input.Criticality, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = serializeAws_restJson1_1StringFilterList( - input.Description, - context - ); - } - if (input.FirstObservedAt !== undefined) { - bodyParams["FirstObservedAt"] = serializeAws_restJson1_1DateFilterList( - input.FirstObservedAt, - context - ); - } - if (input.GeneratorId !== undefined) { - bodyParams["GeneratorId"] = serializeAws_restJson1_1StringFilterList( - input.GeneratorId, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = serializeAws_restJson1_1StringFilterList( - input.Id, - context - ); - } - if (input.Keyword !== undefined) { - bodyParams["Keyword"] = serializeAws_restJson1_1KeywordFilterList( - input.Keyword, - context - ); - } - if (input.LastObservedAt !== undefined) { - bodyParams["LastObservedAt"] = serializeAws_restJson1_1DateFilterList( - input.LastObservedAt, - context - ); - } - if (input.MalwareName !== undefined) { - bodyParams["MalwareName"] = serializeAws_restJson1_1StringFilterList( - input.MalwareName, - context - ); - } - if (input.MalwarePath !== undefined) { - bodyParams["MalwarePath"] = serializeAws_restJson1_1StringFilterList( - input.MalwarePath, - context - ); - } - if (input.MalwareState !== undefined) { - bodyParams["MalwareState"] = serializeAws_restJson1_1StringFilterList( - input.MalwareState, - context - ); - } - if (input.MalwareType !== undefined) { - bodyParams["MalwareType"] = serializeAws_restJson1_1StringFilterList( - input.MalwareType, - context - ); - } - if (input.NetworkDestinationDomain !== undefined) { - bodyParams[ - "NetworkDestinationDomain" - ] = serializeAws_restJson1_1StringFilterList( - input.NetworkDestinationDomain, - context - ); - } - if (input.NetworkDestinationIpV4 !== undefined) { - bodyParams["NetworkDestinationIpV4"] = serializeAws_restJson1_1IpFilterList( - input.NetworkDestinationIpV4, - context - ); - } - if (input.NetworkDestinationIpV6 !== undefined) { - bodyParams["NetworkDestinationIpV6"] = serializeAws_restJson1_1IpFilterList( - input.NetworkDestinationIpV6, - context - ); - } - if (input.NetworkDestinationPort !== undefined) { - bodyParams[ - "NetworkDestinationPort" - ] = serializeAws_restJson1_1NumberFilterList( - input.NetworkDestinationPort, - context - ); - } - if (input.NetworkDirection !== undefined) { - bodyParams["NetworkDirection"] = serializeAws_restJson1_1StringFilterList( - input.NetworkDirection, - context - ); - } - if (input.NetworkProtocol !== undefined) { - bodyParams["NetworkProtocol"] = serializeAws_restJson1_1StringFilterList( - input.NetworkProtocol, - context - ); - } - if (input.NetworkSourceDomain !== undefined) { - bodyParams[ - "NetworkSourceDomain" - ] = serializeAws_restJson1_1StringFilterList( - input.NetworkSourceDomain, - context - ); - } - if (input.NetworkSourceIpV4 !== undefined) { - bodyParams["NetworkSourceIpV4"] = serializeAws_restJson1_1IpFilterList( - input.NetworkSourceIpV4, - context - ); - } - if (input.NetworkSourceIpV6 !== undefined) { - bodyParams["NetworkSourceIpV6"] = serializeAws_restJson1_1IpFilterList( - input.NetworkSourceIpV6, - context - ); - } - if (input.NetworkSourceMac !== undefined) { - bodyParams["NetworkSourceMac"] = serializeAws_restJson1_1StringFilterList( - input.NetworkSourceMac, - context - ); - } - if (input.NetworkSourcePort !== undefined) { - bodyParams["NetworkSourcePort"] = serializeAws_restJson1_1NumberFilterList( - input.NetworkSourcePort, - context - ); - } - if (input.NoteText !== undefined) { - bodyParams["NoteText"] = serializeAws_restJson1_1StringFilterList( - input.NoteText, - context - ); - } - if (input.NoteUpdatedAt !== undefined) { - bodyParams["NoteUpdatedAt"] = serializeAws_restJson1_1DateFilterList( - input.NoteUpdatedAt, - context - ); - } - if (input.NoteUpdatedBy !== undefined) { - bodyParams["NoteUpdatedBy"] = serializeAws_restJson1_1StringFilterList( - input.NoteUpdatedBy, - context - ); - } - if (input.ProcessLaunchedAt !== undefined) { - bodyParams["ProcessLaunchedAt"] = serializeAws_restJson1_1DateFilterList( - input.ProcessLaunchedAt, - context - ); - } - if (input.ProcessName !== undefined) { - bodyParams["ProcessName"] = serializeAws_restJson1_1StringFilterList( - input.ProcessName, - context - ); - } - if (input.ProcessParentPid !== undefined) { - bodyParams["ProcessParentPid"] = serializeAws_restJson1_1NumberFilterList( - input.ProcessParentPid, - context - ); - } - if (input.ProcessPath !== undefined) { - bodyParams["ProcessPath"] = serializeAws_restJson1_1StringFilterList( - input.ProcessPath, - context - ); - } - if (input.ProcessPid !== undefined) { - bodyParams["ProcessPid"] = serializeAws_restJson1_1NumberFilterList( - input.ProcessPid, - context - ); - } - if (input.ProcessTerminatedAt !== undefined) { - bodyParams["ProcessTerminatedAt"] = serializeAws_restJson1_1DateFilterList( - input.ProcessTerminatedAt, - context - ); - } - if (input.ProductArn !== undefined) { - bodyParams["ProductArn"] = serializeAws_restJson1_1StringFilterList( - input.ProductArn, - context - ); - } - if (input.ProductFields !== undefined) { - bodyParams["ProductFields"] = serializeAws_restJson1_1MapFilterList( - input.ProductFields, - context - ); - } - if (input.ProductName !== undefined) { - bodyParams["ProductName"] = serializeAws_restJson1_1StringFilterList( - input.ProductName, - context - ); - } - if (input.RecommendationText !== undefined) { - bodyParams["RecommendationText"] = serializeAws_restJson1_1StringFilterList( - input.RecommendationText, - context - ); - } - if (input.RecordState !== undefined) { - bodyParams["RecordState"] = serializeAws_restJson1_1StringFilterList( - input.RecordState, - context - ); - } - if (input.RelatedFindingsId !== undefined) { - bodyParams["RelatedFindingsId"] = serializeAws_restJson1_1StringFilterList( - input.RelatedFindingsId, - context - ); - } - if (input.RelatedFindingsProductArn !== undefined) { - bodyParams[ - "RelatedFindingsProductArn" - ] = serializeAws_restJson1_1StringFilterList( - input.RelatedFindingsProductArn, - context - ); - } - if (input.ResourceAwsEc2InstanceIamInstanceProfileArn !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceIamInstanceProfileArn" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsEc2InstanceIamInstanceProfileArn, - context - ); - } - if (input.ResourceAwsEc2InstanceImageId !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceImageId" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsEc2InstanceImageId, - context - ); - } - if (input.ResourceAwsEc2InstanceIpV4Addresses !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceIpV4Addresses" - ] = serializeAws_restJson1_1IpFilterList( - input.ResourceAwsEc2InstanceIpV4Addresses, - context - ); - } - if (input.ResourceAwsEc2InstanceIpV6Addresses !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceIpV6Addresses" - ] = serializeAws_restJson1_1IpFilterList( - input.ResourceAwsEc2InstanceIpV6Addresses, - context - ); - } - if (input.ResourceAwsEc2InstanceKeyName !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceKeyName" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsEc2InstanceKeyName, - context - ); - } - if (input.ResourceAwsEc2InstanceLaunchedAt !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceLaunchedAt" - ] = serializeAws_restJson1_1DateFilterList( - input.ResourceAwsEc2InstanceLaunchedAt, - context - ); - } - if (input.ResourceAwsEc2InstanceSubnetId !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceSubnetId" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsEc2InstanceSubnetId, - context - ); - } - if (input.ResourceAwsEc2InstanceType !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceType" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsEc2InstanceType, - context - ); - } - if (input.ResourceAwsEc2InstanceVpcId !== undefined) { - bodyParams[ - "ResourceAwsEc2InstanceVpcId" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsEc2InstanceVpcId, - context - ); - } - if (input.ResourceAwsIamAccessKeyCreatedAt !== undefined) { - bodyParams[ - "ResourceAwsIamAccessKeyCreatedAt" - ] = serializeAws_restJson1_1DateFilterList( - input.ResourceAwsIamAccessKeyCreatedAt, - context - ); - } - if (input.ResourceAwsIamAccessKeyStatus !== undefined) { - bodyParams[ - "ResourceAwsIamAccessKeyStatus" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsIamAccessKeyStatus, - context - ); - } - if (input.ResourceAwsIamAccessKeyUserName !== undefined) { - bodyParams[ - "ResourceAwsIamAccessKeyUserName" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsIamAccessKeyUserName, - context - ); - } - if (input.ResourceAwsS3BucketOwnerId !== undefined) { - bodyParams[ - "ResourceAwsS3BucketOwnerId" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsS3BucketOwnerId, - context - ); - } - if (input.ResourceAwsS3BucketOwnerName !== undefined) { - bodyParams[ - "ResourceAwsS3BucketOwnerName" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceAwsS3BucketOwnerName, - context - ); - } - if (input.ResourceContainerImageId !== undefined) { - bodyParams[ - "ResourceContainerImageId" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceContainerImageId, - context - ); - } - if (input.ResourceContainerImageName !== undefined) { - bodyParams[ - "ResourceContainerImageName" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceContainerImageName, - context - ); - } - if (input.ResourceContainerLaunchedAt !== undefined) { - bodyParams[ - "ResourceContainerLaunchedAt" - ] = serializeAws_restJson1_1DateFilterList( - input.ResourceContainerLaunchedAt, - context - ); - } - if (input.ResourceContainerName !== undefined) { - bodyParams[ - "ResourceContainerName" - ] = serializeAws_restJson1_1StringFilterList( - input.ResourceContainerName, - context - ); - } - if (input.ResourceDetailsOther !== undefined) { - bodyParams["ResourceDetailsOther"] = serializeAws_restJson1_1MapFilterList( - input.ResourceDetailsOther, - context - ); - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = serializeAws_restJson1_1StringFilterList( - input.ResourceId, - context - ); - } - if (input.ResourcePartition !== undefined) { - bodyParams["ResourcePartition"] = serializeAws_restJson1_1StringFilterList( - input.ResourcePartition, - context - ); - } - if (input.ResourceRegion !== undefined) { - bodyParams["ResourceRegion"] = serializeAws_restJson1_1StringFilterList( - input.ResourceRegion, - context - ); - } - if (input.ResourceTags !== undefined) { - bodyParams["ResourceTags"] = serializeAws_restJson1_1MapFilterList( - input.ResourceTags, - context - ); - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = serializeAws_restJson1_1StringFilterList( - input.ResourceType, - context - ); - } - if (input.SeverityLabel !== undefined) { - bodyParams["SeverityLabel"] = serializeAws_restJson1_1StringFilterList( - input.SeverityLabel, - context - ); - } - if (input.SeverityNormalized !== undefined) { - bodyParams["SeverityNormalized"] = serializeAws_restJson1_1NumberFilterList( - input.SeverityNormalized, - context - ); - } - if (input.SeverityProduct !== undefined) { - bodyParams["SeverityProduct"] = serializeAws_restJson1_1NumberFilterList( - input.SeverityProduct, - context - ); - } - if (input.SourceUrl !== undefined) { - bodyParams["SourceUrl"] = serializeAws_restJson1_1StringFilterList( - input.SourceUrl, - context - ); - } - if (input.ThreatIntelIndicatorCategory !== undefined) { - bodyParams[ - "ThreatIntelIndicatorCategory" - ] = serializeAws_restJson1_1StringFilterList( - input.ThreatIntelIndicatorCategory, - context - ); - } - if (input.ThreatIntelIndicatorLastObservedAt !== undefined) { - bodyParams[ - "ThreatIntelIndicatorLastObservedAt" - ] = serializeAws_restJson1_1DateFilterList( - input.ThreatIntelIndicatorLastObservedAt, - context - ); - } - if (input.ThreatIntelIndicatorSource !== undefined) { - bodyParams[ - "ThreatIntelIndicatorSource" - ] = serializeAws_restJson1_1StringFilterList( - input.ThreatIntelIndicatorSource, - context - ); - } - if (input.ThreatIntelIndicatorSourceUrl !== undefined) { - bodyParams[ - "ThreatIntelIndicatorSourceUrl" - ] = serializeAws_restJson1_1StringFilterList( - input.ThreatIntelIndicatorSourceUrl, - context - ); - } - if (input.ThreatIntelIndicatorType !== undefined) { - bodyParams[ - "ThreatIntelIndicatorType" - ] = serializeAws_restJson1_1StringFilterList( - input.ThreatIntelIndicatorType, - context - ); - } - if (input.ThreatIntelIndicatorValue !== undefined) { - bodyParams[ - "ThreatIntelIndicatorValue" - ] = serializeAws_restJson1_1StringFilterList( - input.ThreatIntelIndicatorValue, - context - ); - } - if (input.Title !== undefined) { - bodyParams["Title"] = serializeAws_restJson1_1StringFilterList( - input.Title, - context - ); - } - if (input.Type !== undefined) { - bodyParams["Type"] = serializeAws_restJson1_1StringFilterList( - input.Type, - context - ); - } - if (input.UpdatedAt !== undefined) { - bodyParams["UpdatedAt"] = serializeAws_restJson1_1DateFilterList( - input.UpdatedAt, - context - ); - } - if (input.UserDefinedFields !== undefined) { - bodyParams["UserDefinedFields"] = serializeAws_restJson1_1MapFilterList( - input.UserDefinedFields, - context - ); - } - if (input.VerificationState !== undefined) { - bodyParams["VerificationState"] = serializeAws_restJson1_1StringFilterList( - input.VerificationState, - context - ); - } - if (input.WorkflowState !== undefined) { - bodyParams["WorkflowState"] = serializeAws_restJson1_1StringFilterList( - input.WorkflowState, - context - ); - } - return bodyParams; + return { + ...(input.AwsAccountId !== undefined && { + AwsAccountId: serializeAws_restJson1_1StringFilterList( + input.AwsAccountId, + context + ) + }), + ...(input.CompanyName !== undefined && { + CompanyName: serializeAws_restJson1_1StringFilterList( + input.CompanyName, + context + ) + }), + ...(input.ComplianceStatus !== undefined && { + ComplianceStatus: serializeAws_restJson1_1StringFilterList( + input.ComplianceStatus, + context + ) + }), + ...(input.Confidence !== undefined && { + Confidence: serializeAws_restJson1_1NumberFilterList( + input.Confidence, + context + ) + }), + ...(input.CreatedAt !== undefined && { + CreatedAt: serializeAws_restJson1_1DateFilterList( + input.CreatedAt, + context + ) + }), + ...(input.Criticality !== undefined && { + Criticality: serializeAws_restJson1_1NumberFilterList( + input.Criticality, + context + ) + }), + ...(input.Description !== undefined && { + Description: serializeAws_restJson1_1StringFilterList( + input.Description, + context + ) + }), + ...(input.FirstObservedAt !== undefined && { + FirstObservedAt: serializeAws_restJson1_1DateFilterList( + input.FirstObservedAt, + context + ) + }), + ...(input.GeneratorId !== undefined && { + GeneratorId: serializeAws_restJson1_1StringFilterList( + input.GeneratorId, + context + ) + }), + ...(input.Id !== undefined && { + Id: serializeAws_restJson1_1StringFilterList(input.Id, context) + }), + ...(input.Keyword !== undefined && { + Keyword: serializeAws_restJson1_1KeywordFilterList(input.Keyword, context) + }), + ...(input.LastObservedAt !== undefined && { + LastObservedAt: serializeAws_restJson1_1DateFilterList( + input.LastObservedAt, + context + ) + }), + ...(input.MalwareName !== undefined && { + MalwareName: serializeAws_restJson1_1StringFilterList( + input.MalwareName, + context + ) + }), + ...(input.MalwarePath !== undefined && { + MalwarePath: serializeAws_restJson1_1StringFilterList( + input.MalwarePath, + context + ) + }), + ...(input.MalwareState !== undefined && { + MalwareState: serializeAws_restJson1_1StringFilterList( + input.MalwareState, + context + ) + }), + ...(input.MalwareType !== undefined && { + MalwareType: serializeAws_restJson1_1StringFilterList( + input.MalwareType, + context + ) + }), + ...(input.NetworkDestinationDomain !== undefined && { + NetworkDestinationDomain: serializeAws_restJson1_1StringFilterList( + input.NetworkDestinationDomain, + context + ) + }), + ...(input.NetworkDestinationIpV4 !== undefined && { + NetworkDestinationIpV4: serializeAws_restJson1_1IpFilterList( + input.NetworkDestinationIpV4, + context + ) + }), + ...(input.NetworkDestinationIpV6 !== undefined && { + NetworkDestinationIpV6: serializeAws_restJson1_1IpFilterList( + input.NetworkDestinationIpV6, + context + ) + }), + ...(input.NetworkDestinationPort !== undefined && { + NetworkDestinationPort: serializeAws_restJson1_1NumberFilterList( + input.NetworkDestinationPort, + context + ) + }), + ...(input.NetworkDirection !== undefined && { + NetworkDirection: serializeAws_restJson1_1StringFilterList( + input.NetworkDirection, + context + ) + }), + ...(input.NetworkProtocol !== undefined && { + NetworkProtocol: serializeAws_restJson1_1StringFilterList( + input.NetworkProtocol, + context + ) + }), + ...(input.NetworkSourceDomain !== undefined && { + NetworkSourceDomain: serializeAws_restJson1_1StringFilterList( + input.NetworkSourceDomain, + context + ) + }), + ...(input.NetworkSourceIpV4 !== undefined && { + NetworkSourceIpV4: serializeAws_restJson1_1IpFilterList( + input.NetworkSourceIpV4, + context + ) + }), + ...(input.NetworkSourceIpV6 !== undefined && { + NetworkSourceIpV6: serializeAws_restJson1_1IpFilterList( + input.NetworkSourceIpV6, + context + ) + }), + ...(input.NetworkSourceMac !== undefined && { + NetworkSourceMac: serializeAws_restJson1_1StringFilterList( + input.NetworkSourceMac, + context + ) + }), + ...(input.NetworkSourcePort !== undefined && { + NetworkSourcePort: serializeAws_restJson1_1NumberFilterList( + input.NetworkSourcePort, + context + ) + }), + ...(input.NoteText !== undefined && { + NoteText: serializeAws_restJson1_1StringFilterList( + input.NoteText, + context + ) + }), + ...(input.NoteUpdatedAt !== undefined && { + NoteUpdatedAt: serializeAws_restJson1_1DateFilterList( + input.NoteUpdatedAt, + context + ) + }), + ...(input.NoteUpdatedBy !== undefined && { + NoteUpdatedBy: serializeAws_restJson1_1StringFilterList( + input.NoteUpdatedBy, + context + ) + }), + ...(input.ProcessLaunchedAt !== undefined && { + ProcessLaunchedAt: serializeAws_restJson1_1DateFilterList( + input.ProcessLaunchedAt, + context + ) + }), + ...(input.ProcessName !== undefined && { + ProcessName: serializeAws_restJson1_1StringFilterList( + input.ProcessName, + context + ) + }), + ...(input.ProcessParentPid !== undefined && { + ProcessParentPid: serializeAws_restJson1_1NumberFilterList( + input.ProcessParentPid, + context + ) + }), + ...(input.ProcessPath !== undefined && { + ProcessPath: serializeAws_restJson1_1StringFilterList( + input.ProcessPath, + context + ) + }), + ...(input.ProcessPid !== undefined && { + ProcessPid: serializeAws_restJson1_1NumberFilterList( + input.ProcessPid, + context + ) + }), + ...(input.ProcessTerminatedAt !== undefined && { + ProcessTerminatedAt: serializeAws_restJson1_1DateFilterList( + input.ProcessTerminatedAt, + context + ) + }), + ...(input.ProductArn !== undefined && { + ProductArn: serializeAws_restJson1_1StringFilterList( + input.ProductArn, + context + ) + }), + ...(input.ProductFields !== undefined && { + ProductFields: serializeAws_restJson1_1MapFilterList( + input.ProductFields, + context + ) + }), + ...(input.ProductName !== undefined && { + ProductName: serializeAws_restJson1_1StringFilterList( + input.ProductName, + context + ) + }), + ...(input.RecommendationText !== undefined && { + RecommendationText: serializeAws_restJson1_1StringFilterList( + input.RecommendationText, + context + ) + }), + ...(input.RecordState !== undefined && { + RecordState: serializeAws_restJson1_1StringFilterList( + input.RecordState, + context + ) + }), + ...(input.RelatedFindingsId !== undefined && { + RelatedFindingsId: serializeAws_restJson1_1StringFilterList( + input.RelatedFindingsId, + context + ) + }), + ...(input.RelatedFindingsProductArn !== undefined && { + RelatedFindingsProductArn: serializeAws_restJson1_1StringFilterList( + input.RelatedFindingsProductArn, + context + ) + }), + ...(input.ResourceAwsEc2InstanceIamInstanceProfileArn !== undefined && { + ResourceAwsEc2InstanceIamInstanceProfileArn: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsEc2InstanceIamInstanceProfileArn, + context + ) + }), + ...(input.ResourceAwsEc2InstanceImageId !== undefined && { + ResourceAwsEc2InstanceImageId: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsEc2InstanceImageId, + context + ) + }), + ...(input.ResourceAwsEc2InstanceIpV4Addresses !== undefined && { + ResourceAwsEc2InstanceIpV4Addresses: serializeAws_restJson1_1IpFilterList( + input.ResourceAwsEc2InstanceIpV4Addresses, + context + ) + }), + ...(input.ResourceAwsEc2InstanceIpV6Addresses !== undefined && { + ResourceAwsEc2InstanceIpV6Addresses: serializeAws_restJson1_1IpFilterList( + input.ResourceAwsEc2InstanceIpV6Addresses, + context + ) + }), + ...(input.ResourceAwsEc2InstanceKeyName !== undefined && { + ResourceAwsEc2InstanceKeyName: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsEc2InstanceKeyName, + context + ) + }), + ...(input.ResourceAwsEc2InstanceLaunchedAt !== undefined && { + ResourceAwsEc2InstanceLaunchedAt: serializeAws_restJson1_1DateFilterList( + input.ResourceAwsEc2InstanceLaunchedAt, + context + ) + }), + ...(input.ResourceAwsEc2InstanceSubnetId !== undefined && { + ResourceAwsEc2InstanceSubnetId: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsEc2InstanceSubnetId, + context + ) + }), + ...(input.ResourceAwsEc2InstanceType !== undefined && { + ResourceAwsEc2InstanceType: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsEc2InstanceType, + context + ) + }), + ...(input.ResourceAwsEc2InstanceVpcId !== undefined && { + ResourceAwsEc2InstanceVpcId: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsEc2InstanceVpcId, + context + ) + }), + ...(input.ResourceAwsIamAccessKeyCreatedAt !== undefined && { + ResourceAwsIamAccessKeyCreatedAt: serializeAws_restJson1_1DateFilterList( + input.ResourceAwsIamAccessKeyCreatedAt, + context + ) + }), + ...(input.ResourceAwsIamAccessKeyStatus !== undefined && { + ResourceAwsIamAccessKeyStatus: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsIamAccessKeyStatus, + context + ) + }), + ...(input.ResourceAwsIamAccessKeyUserName !== undefined && { + ResourceAwsIamAccessKeyUserName: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsIamAccessKeyUserName, + context + ) + }), + ...(input.ResourceAwsS3BucketOwnerId !== undefined && { + ResourceAwsS3BucketOwnerId: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsS3BucketOwnerId, + context + ) + }), + ...(input.ResourceAwsS3BucketOwnerName !== undefined && { + ResourceAwsS3BucketOwnerName: serializeAws_restJson1_1StringFilterList( + input.ResourceAwsS3BucketOwnerName, + context + ) + }), + ...(input.ResourceContainerImageId !== undefined && { + ResourceContainerImageId: serializeAws_restJson1_1StringFilterList( + input.ResourceContainerImageId, + context + ) + }), + ...(input.ResourceContainerImageName !== undefined && { + ResourceContainerImageName: serializeAws_restJson1_1StringFilterList( + input.ResourceContainerImageName, + context + ) + }), + ...(input.ResourceContainerLaunchedAt !== undefined && { + ResourceContainerLaunchedAt: serializeAws_restJson1_1DateFilterList( + input.ResourceContainerLaunchedAt, + context + ) + }), + ...(input.ResourceContainerName !== undefined && { + ResourceContainerName: serializeAws_restJson1_1StringFilterList( + input.ResourceContainerName, + context + ) + }), + ...(input.ResourceDetailsOther !== undefined && { + ResourceDetailsOther: serializeAws_restJson1_1MapFilterList( + input.ResourceDetailsOther, + context + ) + }), + ...(input.ResourceId !== undefined && { + ResourceId: serializeAws_restJson1_1StringFilterList( + input.ResourceId, + context + ) + }), + ...(input.ResourcePartition !== undefined && { + ResourcePartition: serializeAws_restJson1_1StringFilterList( + input.ResourcePartition, + context + ) + }), + ...(input.ResourceRegion !== undefined && { + ResourceRegion: serializeAws_restJson1_1StringFilterList( + input.ResourceRegion, + context + ) + }), + ...(input.ResourceTags !== undefined && { + ResourceTags: serializeAws_restJson1_1MapFilterList( + input.ResourceTags, + context + ) + }), + ...(input.ResourceType !== undefined && { + ResourceType: serializeAws_restJson1_1StringFilterList( + input.ResourceType, + context + ) + }), + ...(input.SeverityLabel !== undefined && { + SeverityLabel: serializeAws_restJson1_1StringFilterList( + input.SeverityLabel, + context + ) + }), + ...(input.SeverityNormalized !== undefined && { + SeverityNormalized: serializeAws_restJson1_1NumberFilterList( + input.SeverityNormalized, + context + ) + }), + ...(input.SeverityProduct !== undefined && { + SeverityProduct: serializeAws_restJson1_1NumberFilterList( + input.SeverityProduct, + context + ) + }), + ...(input.SourceUrl !== undefined && { + SourceUrl: serializeAws_restJson1_1StringFilterList( + input.SourceUrl, + context + ) + }), + ...(input.ThreatIntelIndicatorCategory !== undefined && { + ThreatIntelIndicatorCategory: serializeAws_restJson1_1StringFilterList( + input.ThreatIntelIndicatorCategory, + context + ) + }), + ...(input.ThreatIntelIndicatorLastObservedAt !== undefined && { + ThreatIntelIndicatorLastObservedAt: serializeAws_restJson1_1DateFilterList( + input.ThreatIntelIndicatorLastObservedAt, + context + ) + }), + ...(input.ThreatIntelIndicatorSource !== undefined && { + ThreatIntelIndicatorSource: serializeAws_restJson1_1StringFilterList( + input.ThreatIntelIndicatorSource, + context + ) + }), + ...(input.ThreatIntelIndicatorSourceUrl !== undefined && { + ThreatIntelIndicatorSourceUrl: serializeAws_restJson1_1StringFilterList( + input.ThreatIntelIndicatorSourceUrl, + context + ) + }), + ...(input.ThreatIntelIndicatorType !== undefined && { + ThreatIntelIndicatorType: serializeAws_restJson1_1StringFilterList( + input.ThreatIntelIndicatorType, + context + ) + }), + ...(input.ThreatIntelIndicatorValue !== undefined && { + ThreatIntelIndicatorValue: serializeAws_restJson1_1StringFilterList( + input.ThreatIntelIndicatorValue, + context + ) + }), + ...(input.Title !== undefined && { + Title: serializeAws_restJson1_1StringFilterList(input.Title, context) + }), + ...(input.Type !== undefined && { + Type: serializeAws_restJson1_1StringFilterList(input.Type, context) + }), + ...(input.UpdatedAt !== undefined && { + UpdatedAt: serializeAws_restJson1_1DateFilterList( + input.UpdatedAt, + context + ) + }), + ...(input.UserDefinedFields !== undefined && { + UserDefinedFields: serializeAws_restJson1_1MapFilterList( + input.UserDefinedFields, + context + ) + }), + ...(input.VerificationState !== undefined && { + VerificationState: serializeAws_restJson1_1StringFilterList( + input.VerificationState, + context + ) + }), + ...(input.WorkflowState !== undefined && { + WorkflowState: serializeAws_restJson1_1StringFilterList( + input.WorkflowState, + context + ) + }) + }; }; const serializeAws_restJson1_1AwsSecurityFindingList = ( @@ -7003,39 +6747,29 @@ const serializeAws_restJson1_1AwsSnsTopicDetails = ( input: AwsSnsTopicDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.KmsMasterKeyId !== undefined) { - bodyParams["KmsMasterKeyId"] = input.KmsMasterKeyId; - } - if (input.Owner !== undefined) { - bodyParams["Owner"] = input.Owner; - } - if (input.Subscription !== undefined) { - bodyParams[ - "Subscription" - ] = serializeAws_restJson1_1AwsSnsTopicSubscriptionList( - input.Subscription, - context - ); - } - if (input.TopicName !== undefined) { - bodyParams["TopicName"] = input.TopicName; - } - return bodyParams; + return { + ...(input.KmsMasterKeyId !== undefined && { + KmsMasterKeyId: input.KmsMasterKeyId + }), + ...(input.Owner !== undefined && { Owner: input.Owner }), + ...(input.Subscription !== undefined && { + Subscription: serializeAws_restJson1_1AwsSnsTopicSubscriptionList( + input.Subscription, + context + ) + }), + ...(input.TopicName !== undefined && { TopicName: input.TopicName }) + }; }; const serializeAws_restJson1_1AwsSnsTopicSubscription = ( input: AwsSnsTopicSubscription, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Endpoint !== undefined) { - bodyParams["Endpoint"] = input.Endpoint; - } - if (input.Protocol !== undefined) { - bodyParams["Protocol"] = input.Protocol; - } - return bodyParams; + return { + ...(input.Endpoint !== undefined && { Endpoint: input.Endpoint }), + ...(input.Protocol !== undefined && { Protocol: input.Protocol }) + }; }; const serializeAws_restJson1_1AwsSnsTopicSubscriptionList = ( @@ -7051,72 +6785,52 @@ const serializeAws_restJson1_1AwsSqsQueueDetails = ( input: AwsSqsQueueDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeadLetterTargetArn !== undefined) { - bodyParams["DeadLetterTargetArn"] = input.DeadLetterTargetArn; - } - if (input.KmsDataKeyReusePeriodSeconds !== undefined) { - bodyParams["KmsDataKeyReusePeriodSeconds"] = - input.KmsDataKeyReusePeriodSeconds; - } - if (input.KmsMasterKeyId !== undefined) { - bodyParams["KmsMasterKeyId"] = input.KmsMasterKeyId; - } - if (input.QueueName !== undefined) { - bodyParams["QueueName"] = input.QueueName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1Compliance = ( input: Compliance, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + return { + ...(input.Status !== undefined && { Status: input.Status }) + }; }; const serializeAws_restJson1_1ContainerDetails = ( input: ContainerDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ImageId !== undefined) { - bodyParams["ImageId"] = input.ImageId; - } - if (input.ImageName !== undefined) { - bodyParams["ImageName"] = input.ImageName; - } - if (input.LaunchedAt !== undefined) { - bodyParams["LaunchedAt"] = input.LaunchedAt; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1DateFilter = ( input: DateFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DateRange !== undefined) { - bodyParams["DateRange"] = serializeAws_restJson1_1DateRange( - input.DateRange, - context - ); - } - if (input.End !== undefined) { - bodyParams["End"] = input.End; - } - if (input.Start !== undefined) { - bodyParams["Start"] = input.Start; - } - return bodyParams; + return { + ...(input.DateRange !== undefined && { + DateRange: serializeAws_restJson1_1DateRange(input.DateRange, context) + }), + ...(input.End !== undefined && { End: input.End }), + ...(input.Start !== undefined && { Start: input.Start }) + }; }; const serializeAws_restJson1_1DateFilterList = ( @@ -7130,14 +6844,10 @@ const serializeAws_restJson1_1DateRange = ( input: DateRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Unit !== undefined) { - bodyParams["Unit"] = input.Unit; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Unit !== undefined && { Unit: input.Unit }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1FieldMap = ( @@ -7154,11 +6864,9 @@ const serializeAws_restJson1_1IpFilter = ( input: IpFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Cidr !== undefined) { - bodyParams["Cidr"] = input.Cidr; - } - return bodyParams; + return { + ...(input.Cidr !== undefined && { Cidr: input.Cidr }) + }; }; const serializeAws_restJson1_1IpFilterList = ( @@ -7172,11 +6880,9 @@ const serializeAws_restJson1_1KeywordFilter = ( input: KeywordFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1KeywordFilterList = ( @@ -7192,34 +6898,22 @@ const serializeAws_restJson1_1LoadBalancerState = ( input: LoadBalancerState, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Code !== undefined) { - bodyParams["Code"] = input.Code; - } - if (input.Reason !== undefined) { - bodyParams["Reason"] = input.Reason; - } - return bodyParams; + return { + ...(input.Code !== undefined && { Code: input.Code }), + ...(input.Reason !== undefined && { Reason: input.Reason }) + }; }; const serializeAws_restJson1_1Malware = ( input: Malware, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1MalwareList = ( @@ -7233,17 +6927,11 @@ const serializeAws_restJson1_1MapFilter = ( input: MapFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Comparison !== undefined) { - bodyParams["Comparison"] = input.Comparison; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Comparison !== undefined && { Comparison: input.Comparison }), + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1MapFilterList = ( @@ -7257,41 +6945,29 @@ const serializeAws_restJson1_1Network = ( input: Network, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DestinationDomain !== undefined) { - bodyParams["DestinationDomain"] = input.DestinationDomain; - } - if (input.DestinationIpV4 !== undefined) { - bodyParams["DestinationIpV4"] = input.DestinationIpV4; - } - if (input.DestinationIpV6 !== undefined) { - bodyParams["DestinationIpV6"] = input.DestinationIpV6; - } - if (input.DestinationPort !== undefined) { - bodyParams["DestinationPort"] = input.DestinationPort; - } - if (input.Direction !== undefined) { - bodyParams["Direction"] = input.Direction; - } - if (input.Protocol !== undefined) { - bodyParams["Protocol"] = input.Protocol; - } - if (input.SourceDomain !== undefined) { - bodyParams["SourceDomain"] = input.SourceDomain; - } - if (input.SourceIpV4 !== undefined) { - bodyParams["SourceIpV4"] = input.SourceIpV4; - } - if (input.SourceIpV6 !== undefined) { - bodyParams["SourceIpV6"] = input.SourceIpV6; - } - if (input.SourceMac !== undefined) { - bodyParams["SourceMac"] = input.SourceMac; - } - if (input.SourcePort !== undefined) { - bodyParams["SourcePort"] = input.SourcePort; - } - return bodyParams; + 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.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 }) + }; }; const serializeAws_restJson1_1NonEmptyStringList = ( @@ -7305,48 +6981,32 @@ const serializeAws_restJson1_1Note = ( input: Note, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - if (input.UpdatedAt !== undefined) { - bodyParams["UpdatedAt"] = input.UpdatedAt; - } - if (input.UpdatedBy !== undefined) { - bodyParams["UpdatedBy"] = input.UpdatedBy; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }), + ...(input.UpdatedAt !== undefined && { UpdatedAt: input.UpdatedAt }), + ...(input.UpdatedBy !== undefined && { UpdatedBy: input.UpdatedBy }) + }; }; const serializeAws_restJson1_1NoteUpdate = ( input: NoteUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - if (input.UpdatedBy !== undefined) { - bodyParams["UpdatedBy"] = input.UpdatedBy; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }), + ...(input.UpdatedBy !== undefined && { UpdatedBy: input.UpdatedBy }) + }; }; const serializeAws_restJson1_1NumberFilter = ( input: NumberFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Eq !== undefined) { - bodyParams["Eq"] = input.Eq; - } - if (input.Gte !== undefined) { - bodyParams["Gte"] = input.Gte; - } - if (input.Lte !== undefined) { - bodyParams["Lte"] = input.Lte; - } - return bodyParams; + return { + ...(input.Eq !== undefined && { Eq: input.Eq }), + ...(input.Gte !== undefined && { Gte: input.Gte }), + ...(input.Lte !== undefined && { Lte: input.Lte }) + }; }; const serializeAws_restJson1_1NumberFilterList = ( @@ -7362,54 +7022,36 @@ const serializeAws_restJson1_1ProcessDetails = ( input: ProcessDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LaunchedAt !== undefined) { - bodyParams["LaunchedAt"] = input.LaunchedAt; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ParentPid !== undefined) { - bodyParams["ParentPid"] = input.ParentPid; - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - if (input.Pid !== undefined) { - bodyParams["Pid"] = input.Pid; - } - if (input.TerminatedAt !== undefined) { - bodyParams["TerminatedAt"] = input.TerminatedAt; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1Recommendation = ( input: Recommendation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + return { + ...(input.Text !== undefined && { Text: input.Text }), + ...(input.Url !== undefined && { Url: input.Url }) + }; }; const serializeAws_restJson1_1RelatedFinding = ( input: RelatedFinding, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.ProductArn !== undefined) { - bodyParams["ProductArn"] = input.ProductArn; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.ProductArn !== undefined && { ProductArn: input.ProductArn }) + }; }; const serializeAws_restJson1_1RelatedFindingList = ( @@ -7425,133 +7067,109 @@ const serializeAws_restJson1_1Remediation = ( input: Remediation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Recommendation !== undefined) { - bodyParams["Recommendation"] = serializeAws_restJson1_1Recommendation( - input.Recommendation, - context - ); - } - return bodyParams; + return { + ...(input.Recommendation !== undefined && { + Recommendation: serializeAws_restJson1_1Recommendation( + input.Recommendation, + context + ) + }) + }; }; const serializeAws_restJson1_1Resource = ( input: Resource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Details !== undefined) { - bodyParams["Details"] = serializeAws_restJson1_1ResourceDetails( - input.Details, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Partition !== undefined) { - bodyParams["Partition"] = input.Partition; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_restJson1_1FieldMap(input.Tags, context); - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Details !== undefined && { + Details: serializeAws_restJson1_1ResourceDetails(input.Details, context) + }), + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Partition !== undefined && { Partition: input.Partition }), + ...(input.Region !== undefined && { Region: input.Region }), + ...(input.Tags !== undefined && { + Tags: serializeAws_restJson1_1FieldMap(input.Tags, context) + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1ResourceDetails = ( input: ResourceDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsCloudFrontDistribution !== undefined) { - bodyParams[ - "AwsCloudFrontDistribution" - ] = serializeAws_restJson1_1AwsCloudFrontDistributionDetails( - input.AwsCloudFrontDistribution, - context - ); - } - if (input.AwsEc2Instance !== undefined) { - bodyParams[ - "AwsEc2Instance" - ] = serializeAws_restJson1_1AwsEc2InstanceDetails( - input.AwsEc2Instance, - context - ); - } - if (input.AwsElbv2LoadBalancer !== undefined) { - bodyParams[ - "AwsElbv2LoadBalancer" - ] = serializeAws_restJson1_1AwsElbv2LoadBalancerDetails( - input.AwsElbv2LoadBalancer, - context - ); - } - if (input.AwsIamAccessKey !== undefined) { - bodyParams[ - "AwsIamAccessKey" - ] = serializeAws_restJson1_1AwsIamAccessKeyDetails( - input.AwsIamAccessKey, - context - ); - } - if (input.AwsIamRole !== undefined) { - bodyParams["AwsIamRole"] = serializeAws_restJson1_1AwsIamRoleDetails( - input.AwsIamRole, - context - ); - } - if (input.AwsKmsKey !== undefined) { - bodyParams["AwsKmsKey"] = serializeAws_restJson1_1AwsKmsKeyDetails( - input.AwsKmsKey, - context - ); - } - if (input.AwsLambdaFunction !== undefined) { - bodyParams[ - "AwsLambdaFunction" - ] = serializeAws_restJson1_1AwsLambdaFunctionDetails( - input.AwsLambdaFunction, - context - ); - } - if (input.AwsS3Bucket !== undefined) { - bodyParams["AwsS3Bucket"] = serializeAws_restJson1_1AwsS3BucketDetails( - input.AwsS3Bucket, - context - ); - } - if (input.AwsSnsTopic !== undefined) { - bodyParams["AwsSnsTopic"] = serializeAws_restJson1_1AwsSnsTopicDetails( - input.AwsSnsTopic, - context - ); - } - if (input.AwsSqsQueue !== undefined) { - bodyParams["AwsSqsQueue"] = serializeAws_restJson1_1AwsSqsQueueDetails( - input.AwsSqsQueue, - context - ); - } - if (input.Container !== undefined) { - bodyParams["Container"] = serializeAws_restJson1_1ContainerDetails( - input.Container, - context - ); - } - if (input.Other !== undefined) { - bodyParams["Other"] = serializeAws_restJson1_1FieldMap( - input.Other, - context - ); - } - return bodyParams; + return { + ...(input.AwsCloudFrontDistribution !== undefined && { + AwsCloudFrontDistribution: serializeAws_restJson1_1AwsCloudFrontDistributionDetails( + input.AwsCloudFrontDistribution, + context + ) + }), + ...(input.AwsEc2Instance !== undefined && { + AwsEc2Instance: serializeAws_restJson1_1AwsEc2InstanceDetails( + input.AwsEc2Instance, + context + ) + }), + ...(input.AwsElbv2LoadBalancer !== undefined && { + AwsElbv2LoadBalancer: serializeAws_restJson1_1AwsElbv2LoadBalancerDetails( + input.AwsElbv2LoadBalancer, + context + ) + }), + ...(input.AwsIamAccessKey !== undefined && { + AwsIamAccessKey: serializeAws_restJson1_1AwsIamAccessKeyDetails( + input.AwsIamAccessKey, + context + ) + }), + ...(input.AwsIamRole !== undefined && { + AwsIamRole: serializeAws_restJson1_1AwsIamRoleDetails( + input.AwsIamRole, + context + ) + }), + ...(input.AwsKmsKey !== undefined && { + AwsKmsKey: serializeAws_restJson1_1AwsKmsKeyDetails( + input.AwsKmsKey, + context + ) + }), + ...(input.AwsLambdaFunction !== undefined && { + AwsLambdaFunction: serializeAws_restJson1_1AwsLambdaFunctionDetails( + input.AwsLambdaFunction, + context + ) + }), + ...(input.AwsS3Bucket !== undefined && { + AwsS3Bucket: serializeAws_restJson1_1AwsS3BucketDetails( + input.AwsS3Bucket, + context + ) + }), + ...(input.AwsSnsTopic !== undefined && { + AwsSnsTopic: serializeAws_restJson1_1AwsSnsTopicDetails( + input.AwsSnsTopic, + context + ) + }), + ...(input.AwsSqsQueue !== undefined && { + AwsSqsQueue: serializeAws_restJson1_1AwsSqsQueueDetails( + input.AwsSqsQueue, + context + ) + }), + ...(input.Container !== undefined && { + Container: serializeAws_restJson1_1ContainerDetails( + input.Container, + context + ) + }), + ...(input.Other !== undefined && { + Other: serializeAws_restJson1_1FieldMap(input.Other, context) + }) + }; }; const serializeAws_restJson1_1ResourceList = ( @@ -7572,14 +7190,10 @@ const serializeAws_restJson1_1Severity = ( input: Severity, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Normalized !== undefined) { - bodyParams["Normalized"] = input.Normalized; - } - if (input.Product !== undefined) { - bodyParams["Product"] = input.Product; - } - return bodyParams; + return { + ...(input.Normalized !== undefined && { Normalized: input.Normalized }), + ...(input.Product !== undefined && { Product: input.Product }) + }; }; const serializeAws_restJson1_1SortCriteria = ( @@ -7595,14 +7209,10 @@ const serializeAws_restJson1_1SortCriterion = ( input: SortCriterion, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Field !== undefined) { - bodyParams["Field"] = input.Field; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + return { + ...(input.Field !== undefined && { Field: input.Field }), + ...(input.SortOrder !== undefined && { SortOrder: input.SortOrder }) + }; }; const serializeAws_restJson1_1StandardsInputParameterMap = ( @@ -7626,19 +7236,17 @@ const serializeAws_restJson1_1StandardsSubscriptionRequest = ( input: StandardsSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StandardsArn !== undefined) { - bodyParams["StandardsArn"] = input.StandardsArn; - } - if (input.StandardsInput !== undefined) { - bodyParams[ - "StandardsInput" - ] = serializeAws_restJson1_1StandardsInputParameterMap( - input.StandardsInput, - context - ); - } - return bodyParams; + return { + ...(input.StandardsArn !== undefined && { + StandardsArn: input.StandardsArn + }), + ...(input.StandardsInput !== undefined && { + StandardsInput: serializeAws_restJson1_1StandardsInputParameterMap( + input.StandardsInput, + context + ) + }) + }; }; const serializeAws_restJson1_1StandardsSubscriptionRequests = ( @@ -7654,14 +7262,10 @@ const serializeAws_restJson1_1StringFilter = ( input: StringFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Comparison !== undefined) { - bodyParams["Comparison"] = input.Comparison; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Comparison !== undefined && { Comparison: input.Comparison }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1StringFilterList = ( @@ -7694,26 +7298,16 @@ const serializeAws_restJson1_1ThreatIntelIndicator = ( input: ThreatIntelIndicator, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Category !== undefined) { - bodyParams["Category"] = input.Category; - } - if (input.LastObservedAt !== undefined) { - bodyParams["LastObservedAt"] = input.LastObservedAt; - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.SourceUrl !== undefined) { - bodyParams["SourceUrl"] = input.SourceUrl; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + 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 }) + }; }; const serializeAws_restJson1_1ThreatIntelIndicatorList = ( diff --git a/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1_1.ts b/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1_1.ts index fe196cd844ea..40c5d8febc6c 100644 --- a/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1_1.ts +++ b/clients/client-serverlessapplicationrepository/protocols/Aws_restJson1_1.ts @@ -2522,84 +2522,65 @@ const serializeAws_restJson1_1ApplicationPolicyStatement = ( input: ApplicationPolicyStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Actions !== undefined) { - bodyParams["actions"] = serializeAws_restJson1_1__listOf__string( - input.Actions, - context - ); - } - if (input.Principals !== undefined) { - bodyParams["principals"] = serializeAws_restJson1_1__listOf__string( - input.Principals, - context - ); - } - if (input.StatementId !== undefined) { - bodyParams["statementId"] = input.StatementId; - } - return bodyParams; + return { + ...(input.Actions !== undefined && { + actions: serializeAws_restJson1_1__listOf__string(input.Actions, context) + }), + ...(input.Principals !== undefined && { + principals: serializeAws_restJson1_1__listOf__string( + input.Principals, + context + ) + }), + ...(input.StatementId !== undefined && { statementId: input.StatementId }) + }; }; const serializeAws_restJson1_1ParameterValue = ( input: ParameterValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { name: input.Name }), + ...(input.Value !== undefined && { value: input.Value }) + }; }; const serializeAws_restJson1_1RollbackConfiguration = ( input: RollbackConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MonitoringTimeInMinutes !== undefined) { - bodyParams["monitoringTimeInMinutes"] = input.MonitoringTimeInMinutes; - } - if (input.RollbackTriggers !== undefined) { - bodyParams[ - "rollbackTriggers" - ] = serializeAws_restJson1_1__listOfRollbackTrigger( - input.RollbackTriggers, - context - ); - } - return bodyParams; + return { + ...(input.MonitoringTimeInMinutes !== undefined && { + monitoringTimeInMinutes: input.MonitoringTimeInMinutes + }), + ...(input.RollbackTriggers !== undefined && { + rollbackTriggers: serializeAws_restJson1_1__listOfRollbackTrigger( + input.RollbackTriggers, + context + ) + }) + }; }; const serializeAws_restJson1_1RollbackTrigger = ( input: RollbackTrigger, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["arn"] = input.Arn; - } - if (input.Type !== undefined) { - bodyParams["type"] = input.Type; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { arn: input.Arn }), + ...(input.Type !== undefined && { type: input.Type }) + }; }; const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { key: input.Key }), + ...(input.Value !== undefined && { value: input.Value }) + }; }; const serializeAws_restJson1_1__listOfApplicationPolicyStatement = ( diff --git a/clients/client-service-catalog/protocols/Aws_json1_1.ts b/clients/client-service-catalog/protocols/Aws_json1_1.ts index 54306877f480..ea2defbcff12 100644 --- a/clients/client-service-catalog/protocols/Aws_json1_1.ts +++ b/clients/client-service-catalog/protocols/Aws_json1_1.ts @@ -8455,169 +8455,122 @@ const serializeAws_json1_1AssociateTagOptionWithResourceInput = ( input: AssociateTagOptionWithResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagOptionId !== undefined) { - bodyParams["TagOptionId"] = input.TagOptionId; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagOptionId !== undefined && { TagOptionId: input.TagOptionId }) + }; }; const serializeAws_json1_1CreateTagOptionInput = ( input: CreateTagOptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1DeleteTagOptionInput = ( input: DeleteTagOptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeTagOptionInput = ( input: DescribeTagOptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DisassociateTagOptionFromResourceInput = ( input: DisassociateTagOptionFromResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagOptionId !== undefined) { - bodyParams["TagOptionId"] = input.TagOptionId; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagOptionId !== undefined && { TagOptionId: input.TagOptionId }) + }; }; const serializeAws_json1_1ListResourcesForTagOptionInput = ( input: ListResourcesForTagOptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.TagOptionId !== undefined) { - bodyParams["TagOptionId"] = input.TagOptionId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListTagOptionsFilters = ( input: ListTagOptionsFilters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Active !== undefined) { - bodyParams["Active"] = input.Active; - } - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Active !== undefined && { Active: input.Active }), + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ListTagOptionsInput = ( input: ListTagOptionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ListTagOptionsFilters( - input.Filters, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1ListTagOptionsFilters(input.Filters, context) + }), + ...(input.PageSize !== undefined && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && { PageToken: input.PageToken }) + }; }; const serializeAws_json1_1UpdateTagOptionInput = ( input: UpdateTagOptionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Active !== undefined) { - bodyParams["Active"] = input.Active; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Active !== undefined && { Active: input.Active }), + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1AcceptPortfolioShareInput = ( input: AcceptPortfolioShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.PortfolioShareType !== undefined) { - bodyParams["PortfolioShareType"] = input.PortfolioShareType; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.PortfolioShareType !== undefined && { + PortfolioShareType: input.PortfolioShareType + }) + }; }; const serializeAws_json1_1AccessLevelFilter = ( input: AccessLevelFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1AddTags = ( @@ -8631,112 +8584,96 @@ const serializeAws_json1_1AssociateBudgetWithResourceInput = ( input: AssociateBudgetWithResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1AssociatePrincipalWithPortfolioInput = ( input: AssociatePrincipalWithPortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.PrincipalARN !== undefined) { - bodyParams["PrincipalARN"] = input.PrincipalARN; - } - if (input.PrincipalType !== undefined) { - bodyParams["PrincipalType"] = input.PrincipalType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1AssociateProductWithPortfolioInput = ( input: AssociateProductWithPortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.SourcePortfolioId !== undefined) { - bodyParams["SourcePortfolioId"] = input.SourcePortfolioId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1AssociateServiceActionWithProvisioningArtifactInput = ( input: AssociateServiceActionWithProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.ServiceActionId !== undefined) { - bodyParams["ServiceActionId"] = input.ServiceActionId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1BatchAssociateServiceActionWithProvisioningArtifactInput = ( input: BatchAssociateServiceActionWithProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ServiceActionAssociations !== undefined) { - bodyParams[ - "ServiceActionAssociations" - ] = serializeAws_json1_1ServiceActionAssociations( - input.ServiceActionAssociations, - context - ); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.ServiceActionAssociations !== undefined && { + ServiceActionAssociations: serializeAws_json1_1ServiceActionAssociations( + input.ServiceActionAssociations, + context + ) + }) + }; }; const serializeAws_json1_1BatchDisassociateServiceActionFromProvisioningArtifactInput = ( input: BatchDisassociateServiceActionFromProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ServiceActionAssociations !== undefined) { - bodyParams[ - "ServiceActionAssociations" - ] = serializeAws_json1_1ServiceActionAssociations( - input.ServiceActionAssociations, - context - ); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.ServiceActionAssociations !== undefined && { + ServiceActionAssociations: serializeAws_json1_1ServiceActionAssociations( + input.ServiceActionAssociations, + context + ) + }) + }; }; const serializeAws_json1_1CopyOptions = ( @@ -8750,754 +8687,588 @@ const serializeAws_json1_1CopyProductInput = ( input: CopyProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.CopyOptions !== undefined) { - bodyParams["CopyOptions"] = serializeAws_json1_1CopyOptions( - input.CopyOptions, - context - ); - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.SourceProductArn !== undefined) { - bodyParams["SourceProductArn"] = input.SourceProductArn; - } - if (input.SourceProvisioningArtifactIdentifiers !== undefined) { - bodyParams[ - "SourceProvisioningArtifactIdentifiers" - ] = serializeAws_json1_1SourceProvisioningArtifactProperties( - input.SourceProvisioningArtifactIdentifiers, - context - ); - } - if (input.TargetProductId !== undefined) { - bodyParams["TargetProductId"] = input.TargetProductId; - } - if (input.TargetProductName !== undefined) { - bodyParams["TargetProductName"] = input.TargetProductName; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.CopyOptions !== undefined && { + 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 + }) + }; }; const serializeAws_json1_1CreateConstraintInput = ( input: CreateConstraintInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = input.Parameters; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Description !== undefined && { 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 }) + }; }; const serializeAws_json1_1CreatePortfolioInput = ( input: CreatePortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1AddTags(input.Tags, context); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.DisplayName !== undefined && { DisplayName: input.DisplayName }), + IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), + ...(input.ProviderName !== undefined && { + ProviderName: input.ProviderName + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1AddTags(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreatePortfolioShareInput = ( input: CreatePortfolioShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.OrganizationNode !== undefined) { - bodyParams["OrganizationNode"] = serializeAws_json1_1OrganizationNode( - input.OrganizationNode, - context - ); - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateProductInput = ( input: CreateProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Distributor !== undefined) { - bodyParams["Distributor"] = input.Distributor; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Owner !== undefined) { - bodyParams["Owner"] = input.Owner; - } - if (input.ProductType !== undefined) { - bodyParams["ProductType"] = input.ProductType; - } - if (input.ProvisioningArtifactParameters !== undefined) { - bodyParams[ - "ProvisioningArtifactParameters" - ] = serializeAws_json1_1ProvisioningArtifactProperties( - input.ProvisioningArtifactParameters, - context - ); - } - if (input.SupportDescription !== undefined) { - bodyParams["SupportDescription"] = input.SupportDescription; - } - if (input.SupportEmail !== undefined) { - bodyParams["SupportEmail"] = input.SupportEmail; - } - if (input.SupportUrl !== undefined) { - bodyParams["SupportUrl"] = input.SupportUrl; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1AddTags(input.Tags, context); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Distributor !== undefined && { 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) + }) + }; }; const serializeAws_json1_1CreateProvisionedProductPlanInput = ( input: CreateProvisionedProductPlanInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.NotificationArns !== undefined) { - bodyParams["NotificationArns"] = serializeAws_json1_1NotificationArns( - input.NotificationArns, - context - ); - } - if (input.PathId !== undefined) { - bodyParams["PathId"] = input.PathId; - } - if (input.PlanName !== undefined) { - bodyParams["PlanName"] = input.PlanName; - } - if (input.PlanType !== undefined) { - bodyParams["PlanType"] = input.PlanType; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisionedProductName !== undefined) { - bodyParams["ProvisionedProductName"] = input.ProvisionedProductName; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.ProvisioningParameters !== undefined) { - bodyParams[ - "ProvisioningParameters" - ] = serializeAws_json1_1UpdateProvisioningParameters( - input.ProvisioningParameters, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + 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) + }) + }; }; const serializeAws_json1_1CreateProvisioningArtifactInput = ( input: CreateProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.Parameters !== undefined) { - bodyParams[ - "Parameters" - ] = serializeAws_json1_1ProvisioningArtifactProperties( - input.Parameters, - context - ); - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_1ProvisioningArtifactProperties( + input.Parameters, + context + ) + }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }) + }; }; const serializeAws_json1_1CreateServiceActionInput = ( input: CreateServiceActionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Definition !== undefined) { - bodyParams["Definition"] = serializeAws_json1_1ServiceActionDefinitionMap( - input.Definition, - context - ); - } - if (input.DefinitionType !== undefined) { - bodyParams["DefinitionType"] = input.DefinitionType; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }), + IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteConstraintInput = ( input: DeleteConstraintInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DeletePortfolioInput = ( input: DeletePortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DeletePortfolioShareInput = ( input: DeletePortfolioShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AccountId !== undefined) { - bodyParams["AccountId"] = input.AccountId; - } - if (input.OrganizationNode !== undefined) { - bodyParams["OrganizationNode"] = serializeAws_json1_1OrganizationNode( - input.OrganizationNode, - context - ); - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteProductInput = ( input: DeleteProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DeleteProvisionedProductPlanInput = ( input: DeleteProvisionedProductPlanInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.IgnoreErrors !== undefined) { - bodyParams["IgnoreErrors"] = input.IgnoreErrors; - } - if (input.PlanId !== undefined) { - bodyParams["PlanId"] = input.PlanId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.IgnoreErrors !== undefined && { + IgnoreErrors: input.IgnoreErrors + }), + ...(input.PlanId !== undefined && { PlanId: input.PlanId }) + }; }; const serializeAws_json1_1DeleteProvisioningArtifactInput = ( input: DeleteProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && { + ProvisioningArtifactId: input.ProvisioningArtifactId + }) + }; }; const serializeAws_json1_1DeleteServiceActionInput = ( input: DeleteServiceActionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeConstraintInput = ( input: DescribeConstraintInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeCopyProductStatusInput = ( input: DescribeCopyProductStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.CopyProductToken !== undefined) { - bodyParams["CopyProductToken"] = input.CopyProductToken; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.CopyProductToken !== undefined && { + CopyProductToken: input.CopyProductToken + }) + }; }; const serializeAws_json1_1DescribePortfolioInput = ( input: DescribePortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribePortfolioShareStatusInput = ( input: DescribePortfolioShareStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PortfolioShareToken !== undefined) { - bodyParams["PortfolioShareToken"] = input.PortfolioShareToken; - } - return bodyParams; + return { + ...(input.PortfolioShareToken !== undefined && { + PortfolioShareToken: input.PortfolioShareToken + }) + }; }; const serializeAws_json1_1DescribeProductAsAdminInput = ( input: DescribeProductAsAdminInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeProductInput = ( input: DescribeProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeProductViewInput = ( input: DescribeProductViewInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeProvisionedProductInput = ( input: DescribeProvisionedProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DescribeProvisionedProductPlanInput = ( input: DescribeProvisionedProductPlanInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.PlanId !== undefined) { - bodyParams["PlanId"] = input.PlanId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeProvisioningArtifactInput = ( input: DescribeProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.Verbose !== undefined) { - bodyParams["Verbose"] = input.Verbose; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && { + ProvisioningArtifactId: input.ProvisioningArtifactId + }), + ...(input.Verbose !== undefined && { Verbose: input.Verbose }) + }; }; const serializeAws_json1_1DescribeProvisioningParametersInput = ( input: DescribeProvisioningParametersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PathId !== undefined) { - bodyParams["PathId"] = input.PathId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PathId !== undefined && { PathId: input.PathId }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && { + ProvisioningArtifactId: input.ProvisioningArtifactId + }) + }; }; const serializeAws_json1_1DescribeRecordInput = ( input: DescribeRecordInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeServiceActionExecutionParametersInput = ( input: DescribeServiceActionExecutionParametersInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ProvisionedProductId !== undefined) { - bodyParams["ProvisionedProductId"] = input.ProvisionedProductId; - } - if (input.ServiceActionId !== undefined) { - bodyParams["ServiceActionId"] = input.ServiceActionId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.ProvisionedProductId !== undefined && { + ProvisionedProductId: input.ProvisionedProductId + }), + ...(input.ServiceActionId !== undefined && { + ServiceActionId: input.ServiceActionId + }) + }; }; const serializeAws_json1_1DescribeServiceActionInput = ( input: DescribeServiceActionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DisableAWSOrganizationsAccessInput = ( input: DisableAWSOrganizationsAccessInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DisassociateBudgetFromResourceInput = ( input: DisassociateBudgetFromResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BudgetName !== undefined) { - bodyParams["BudgetName"] = input.BudgetName; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.BudgetName !== undefined && { BudgetName: input.BudgetName }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1DisassociatePrincipalFromPortfolioInput = ( input: DisassociatePrincipalFromPortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.PrincipalARN !== undefined) { - bodyParams["PrincipalARN"] = input.PrincipalARN; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.PrincipalARN !== undefined && { + PrincipalARN: input.PrincipalARN + }) + }; }; const serializeAws_json1_1DisassociateProductFromPortfolioInput = ( input: DisassociateProductFromPortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }) + }; }; const serializeAws_json1_1DisassociateServiceActionFromProvisioningArtifactInput = ( input: DisassociateServiceActionFromProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.ServiceActionId !== undefined) { - bodyParams["ServiceActionId"] = input.ServiceActionId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1EnableAWSOrganizationsAccessInput = ( input: EnableAWSOrganizationsAccessInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ExecuteProvisionedProductPlanInput = ( input: ExecuteProvisionedProductPlanInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.PlanId !== undefined) { - bodyParams["PlanId"] = input.PlanId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), + ...(input.PlanId !== undefined && { PlanId: input.PlanId }) + }; }; const serializeAws_json1_1ExecuteProvisionedProductServiceActionInput = ( input: ExecuteProvisionedProductServiceActionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ExecuteToken === undefined) { - input.ExecuteToken = generateIdempotencyToken(); - } - if (input.ExecuteToken !== undefined) { - bodyParams["ExecuteToken"] = input.ExecuteToken; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1ExecutionParameterMap( - input.Parameters, - context - ); - } - if (input.ProvisionedProductId !== undefined) { - bodyParams["ProvisionedProductId"] = input.ProvisionedProductId; - } - if (input.ServiceActionId !== undefined) { - bodyParams["ServiceActionId"] = input.ServiceActionId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + 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 + }) + }; }; const serializeAws_json1_1ExecutionParameterMap = ( @@ -9524,350 +9295,267 @@ const serializeAws_json1_1GetAWSOrganizationsAccessStatusInput = ( input: GetAWSOrganizationsAccessStatusInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ListAcceptedPortfolioSharesInput = ( input: ListAcceptedPortfolioSharesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.PortfolioShareType !== undefined) { - bodyParams["PortfolioShareType"] = input.PortfolioShareType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListBudgetsForResourceInput = ( input: ListBudgetsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListConstraintsForPortfolioInput = ( input: ListConstraintsForPortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListLaunchPathsInput = ( - input: ListLaunchPathsInput, - context: __SerdeContext -): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListOrganizationPortfolioAccessInput = ( input: ListOrganizationPortfolioAccessInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.OrganizationNodeType !== undefined) { - bodyParams["OrganizationNodeType"] = input.OrganizationNodeType; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListPortfolioAccessInput = ( input: ListPortfolioAccessInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }) + }; }; const serializeAws_json1_1ListPortfoliosForProductInput = ( input: ListPortfoliosForProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListPortfoliosInput = ( input: ListPortfoliosInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PageSize !== undefined && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && { PageToken: input.PageToken }) + }; }; const serializeAws_json1_1ListPrincipalsForPortfolioInput = ( input: ListPrincipalsForPortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListProvisionedProductPlansInput = ( input: ListProvisionedProductPlansInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AccessLevelFilter !== undefined) { - bodyParams["AccessLevelFilter"] = serializeAws_json1_1AccessLevelFilter( - input.AccessLevelFilter, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ProvisionProductId !== undefined) { - bodyParams["ProvisionProductId"] = input.ProvisionProductId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListProvisioningArtifactsForServiceActionInput = ( input: ListProvisioningArtifactsForServiceActionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ServiceActionId !== undefined) { - bodyParams["ServiceActionId"] = input.ServiceActionId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListProvisioningArtifactsInput = ( input: ListProvisioningArtifactsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }) + }; }; const serializeAws_json1_1ListRecordHistoryInput = ( input: ListRecordHistoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AccessLevelFilter !== undefined) { - bodyParams["AccessLevelFilter"] = serializeAws_json1_1AccessLevelFilter( - input.AccessLevelFilter, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.SearchFilter !== undefined) { - bodyParams[ - "SearchFilter" - ] = serializeAws_json1_1ListRecordHistorySearchFilter( - input.SearchFilter, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ListRecordHistorySearchFilter = ( input: ListRecordHistorySearchFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ListServiceActionsForProvisioningArtifactInput = ( input: ListServiceActionsForProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListServiceActionsInput = ( input: ListServiceActionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PageSize !== undefined && { PageSize: input.PageSize }), + ...(input.PageToken !== undefined && { PageToken: input.PageToken }) + }; }; const serializeAws_json1_1ListStackInstancesForProvisionedProductInput = ( input: ListStackInstancesForProvisionedProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.ProvisionedProductId !== undefined) { - bodyParams["ProvisionedProductId"] = input.ProvisionedProductId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1NotificationArns = ( @@ -9881,14 +9569,10 @@ const serializeAws_json1_1OrganizationNode = ( input: OrganizationNode, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ProductViewFilterValues = ( @@ -9912,54 +9596,41 @@ const serializeAws_json1_1ProvisionProductInput = ( input: ProvisionProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.NotificationArns !== undefined) { - bodyParams["NotificationArns"] = serializeAws_json1_1NotificationArns( - input.NotificationArns, - context - ); - } - if (input.PathId !== undefined) { - bodyParams["PathId"] = input.PathId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisionToken === undefined) { - input.ProvisionToken = generateIdempotencyToken(); - } - if (input.ProvisionToken !== undefined) { - bodyParams["ProvisionToken"] = input.ProvisionToken; - } - if (input.ProvisionedProductName !== undefined) { - bodyParams["ProvisionedProductName"] = input.ProvisionedProductName; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.ProvisioningParameters !== undefined) { - bodyParams[ - "ProvisioningParameters" - ] = serializeAws_json1_1ProvisioningParameters( - input.ProvisioningParameters, - context - ); - } - if (input.ProvisioningPreferences !== undefined) { - bodyParams[ - "ProvisioningPreferences" - ] = serializeAws_json1_1ProvisioningPreferences( - input.ProvisioningPreferences, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.NotificationArns !== undefined && { + NotificationArns: serializeAws_json1_1NotificationArns( + input.NotificationArns, + context + ) + }), + ...(input.PathId !== undefined && { PathId: input.PathId }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ProvisionToken: input.ProvisionToken ?? generateIdempotencyToken(), + ...(input.ProvisionedProductName !== undefined && { + ProvisionedProductName: input.ProvisionedProductName + }), + ...(input.ProvisioningArtifactId !== undefined && { + ProvisioningArtifactId: input.ProvisioningArtifactId + }), + ...(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) + }) + }; }; const serializeAws_json1_1ProvisionedProductFilters = ( @@ -10006,40 +9677,27 @@ const serializeAws_json1_1ProvisioningArtifactProperties = ( input: ProvisioningArtifactProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisableTemplateValidation !== undefined) { - bodyParams["DisableTemplateValidation"] = input.DisableTemplateValidation; - } - if (input.Info !== undefined) { - bodyParams["Info"] = serializeAws_json1_1ProvisioningArtifactInfo( - input.Info, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ProvisioningParameter = ( input: ProvisioningParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1ProvisioningParameters = ( @@ -10055,192 +9713,149 @@ const serializeAws_json1_1ProvisioningPreferences = ( input: ProvisioningPreferences, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackSetAccounts !== undefined) { - bodyParams["StackSetAccounts"] = serializeAws_json1_1StackSetAccounts( - input.StackSetAccounts, - context - ); - } - if (input.StackSetFailureToleranceCount !== undefined) { - bodyParams["StackSetFailureToleranceCount"] = - input.StackSetFailureToleranceCount; - } - if (input.StackSetFailureTolerancePercentage !== undefined) { - bodyParams["StackSetFailureTolerancePercentage"] = - input.StackSetFailureTolerancePercentage; - } - if (input.StackSetMaxConcurrencyCount !== undefined) { - bodyParams["StackSetMaxConcurrencyCount"] = - input.StackSetMaxConcurrencyCount; - } - if (input.StackSetMaxConcurrencyPercentage !== undefined) { - bodyParams["StackSetMaxConcurrencyPercentage"] = - input.StackSetMaxConcurrencyPercentage; - } - if (input.StackSetRegions !== undefined) { - bodyParams["StackSetRegions"] = serializeAws_json1_1StackSetRegions( - input.StackSetRegions, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RejectPortfolioShareInput = ( input: RejectPortfolioShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.PortfolioShareType !== undefined) { - bodyParams["PortfolioShareType"] = input.PortfolioShareType; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PortfolioId !== undefined && { PortfolioId: input.PortfolioId }), + ...(input.PortfolioShareType !== undefined && { + PortfolioShareType: input.PortfolioShareType + }) + }; }; const serializeAws_json1_1ScanProvisionedProductsInput = ( input: ScanProvisionedProductsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AccessLevelFilter !== undefined) { - bodyParams["AccessLevelFilter"] = serializeAws_json1_1AccessLevelFilter( - input.AccessLevelFilter, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SearchProductsAsAdminInput = ( input: SearchProductsAsAdminInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ProductViewFilters( - input.Filters, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.PortfolioId !== undefined) { - bodyParams["PortfolioId"] = input.PortfolioId; - } - if (input.ProductSource !== undefined) { - bodyParams["ProductSource"] = input.ProductSource; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SearchProductsInput = ( input: SearchProductsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ProductViewFilters( - input.Filters, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1SearchProvisionedProductsInput = ( input: SearchProvisionedProductsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AccessLevelFilter !== undefined) { - bodyParams["AccessLevelFilter"] = serializeAws_json1_1AccessLevelFilter( - input.AccessLevelFilter, - context - ); - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ProvisionedProductFilters( - input.Filters, - context - ); - } - if (input.PageSize !== undefined) { - bodyParams["PageSize"] = input.PageSize; - } - if (input.PageToken !== undefined) { - bodyParams["PageToken"] = input.PageToken; - } - if (input.SortBy !== undefined) { - bodyParams["SortBy"] = input.SortBy; - } - if (input.SortOrder !== undefined) { - bodyParams["SortOrder"] = input.SortOrder; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ServiceActionAssociation = ( input: ServiceActionAssociation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.ServiceActionId !== undefined) { - bodyParams["ServiceActionId"] = input.ServiceActionId; - } - return bodyParams; + return { + ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.ProvisioningArtifactId !== undefined && { + ProvisioningArtifactId: input.ProvisioningArtifactId + }), + ...(input.ServiceActionId !== undefined && { + ServiceActionId: input.ServiceActionId + }) + }; }; const serializeAws_json1_1ServiceActionAssociations = ( @@ -10296,14 +9911,10 @@ const serializeAws_json1_1StackSetRegions = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -10324,247 +9935,178 @@ const serializeAws_json1_1TerminateProvisionedProductInput = ( input: TerminateProvisionedProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.IgnoreErrors !== undefined) { - bodyParams["IgnoreErrors"] = input.IgnoreErrors; - } - if (input.ProvisionedProductId !== undefined) { - bodyParams["ProvisionedProductId"] = input.ProvisionedProductId; - } - if (input.ProvisionedProductName !== undefined) { - bodyParams["ProvisionedProductName"] = input.ProvisionedProductName; - } - if (input.TerminateToken === undefined) { - input.TerminateToken = generateIdempotencyToken(); - } - if (input.TerminateToken !== undefined) { - bodyParams["TerminateToken"] = input.TerminateToken; - } - return bodyParams; + 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 + }), + TerminateToken: input.TerminateToken ?? generateIdempotencyToken() + }; }; const serializeAws_json1_1UpdateConstraintInput = ( input: UpdateConstraintInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = input.Parameters; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdatePortfolioInput = ( input: UpdatePortfolioInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AddTags !== undefined) { - bodyParams["AddTags"] = serializeAws_json1_1AddTags(input.AddTags, context); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.ProviderName !== undefined) { - bodyParams["ProviderName"] = input.ProviderName; - } - if (input.RemoveTags !== undefined) { - bodyParams["RemoveTags"] = serializeAws_json1_1TagKeys( - input.RemoveTags, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateProductInput = ( input: UpdateProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.AddTags !== undefined) { - bodyParams["AddTags"] = serializeAws_json1_1AddTags(input.AddTags, context); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Distributor !== undefined) { - bodyParams["Distributor"] = input.Distributor; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Owner !== undefined) { - bodyParams["Owner"] = input.Owner; - } - if (input.RemoveTags !== undefined) { - bodyParams["RemoveTags"] = serializeAws_json1_1TagKeys( - input.RemoveTags, - context - ); - } - if (input.SupportDescription !== undefined) { - bodyParams["SupportDescription"] = input.SupportDescription; - } - if (input.SupportEmail !== undefined) { - bodyParams["SupportEmail"] = input.SupportEmail; - } - if (input.SupportUrl !== undefined) { - bodyParams["SupportUrl"] = input.SupportUrl; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateProvisionedProductInput = ( input: UpdateProvisionedProductInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.PathId !== undefined) { - bodyParams["PathId"] = input.PathId; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisionedProductId !== undefined) { - bodyParams["ProvisionedProductId"] = input.ProvisionedProductId; - } - if (input.ProvisionedProductName !== undefined) { - bodyParams["ProvisionedProductName"] = input.ProvisionedProductName; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - if (input.ProvisioningParameters !== undefined) { - bodyParams[ - "ProvisioningParameters" - ] = serializeAws_json1_1UpdateProvisioningParameters( - input.ProvisioningParameters, - context - ); - } - if (input.ProvisioningPreferences !== undefined) { - bodyParams[ - "ProvisioningPreferences" - ] = serializeAws_json1_1UpdateProvisioningPreferences( - input.ProvisioningPreferences, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.UpdateToken === undefined) { - input.UpdateToken = generateIdempotencyToken(); - } - if (input.UpdateToken !== undefined) { - bodyParams["UpdateToken"] = input.UpdateToken; - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + ...(input.PathId !== undefined && { PathId: input.PathId }), + ...(input.ProductId !== undefined && { ProductId: input.ProductId }), + ...(input.ProvisionedProductId !== undefined && { + ProvisionedProductId: input.ProvisionedProductId + }), + ...(input.ProvisionedProductName !== undefined && { + ProvisionedProductName: input.ProvisionedProductName + }), + ...(input.ProvisioningArtifactId !== undefined && { + ProvisioningArtifactId: input.ProvisioningArtifactId + }), + ...(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) + }), + UpdateToken: input.UpdateToken ?? generateIdempotencyToken() + }; }; const serializeAws_json1_1UpdateProvisionedProductPropertiesInput = ( input: UpdateProvisionedProductPropertiesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.IdempotencyToken === undefined) { - input.IdempotencyToken = generateIdempotencyToken(); - } - if (input.IdempotencyToken !== undefined) { - bodyParams["IdempotencyToken"] = input.IdempotencyToken; - } - if (input.ProvisionedProductId !== undefined) { - bodyParams["ProvisionedProductId"] = input.ProvisionedProductId; - } - if (input.ProvisionedProductProperties !== undefined) { - bodyParams[ - "ProvisionedProductProperties" - ] = serializeAws_json1_1ProvisionedProductProperties( - input.ProvisionedProductProperties, - context - ); - } - return bodyParams; + return { + ...(input.AcceptLanguage !== undefined && { + AcceptLanguage: input.AcceptLanguage + }), + IdempotencyToken: input.IdempotencyToken ?? generateIdempotencyToken(), + ...(input.ProvisionedProductId !== undefined && { + ProvisionedProductId: input.ProvisionedProductId + }), + ...(input.ProvisionedProductProperties !== undefined && { + ProvisionedProductProperties: serializeAws_json1_1ProvisionedProductProperties( + input.ProvisionedProductProperties, + context + ) + }) + }; }; const serializeAws_json1_1UpdateProvisioningArtifactInput = ( input: UpdateProvisioningArtifactInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Active !== undefined) { - bodyParams["Active"] = input.Active; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Guidance !== undefined) { - bodyParams["Guidance"] = input.Guidance; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ProductId !== undefined) { - bodyParams["ProductId"] = input.ProductId; - } - if (input.ProvisioningArtifactId !== undefined) { - bodyParams["ProvisioningArtifactId"] = input.ProvisioningArtifactId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateProvisioningParameter = ( input: UpdateProvisioningParameter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.UsePreviousValue !== undefined) { - bodyParams["UsePreviousValue"] = input.UsePreviousValue; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.UsePreviousValue !== undefined && { + UsePreviousValue: input.UsePreviousValue + }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1UpdateProvisioningParameters = ( @@ -10580,65 +10122,56 @@ const serializeAws_json1_1UpdateProvisioningPreferences = ( input: UpdateProvisioningPreferences, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StackSetAccounts !== undefined) { - bodyParams["StackSetAccounts"] = serializeAws_json1_1StackSetAccounts( - input.StackSetAccounts, - context - ); - } - if (input.StackSetFailureToleranceCount !== undefined) { - bodyParams["StackSetFailureToleranceCount"] = - input.StackSetFailureToleranceCount; - } - if (input.StackSetFailureTolerancePercentage !== undefined) { - bodyParams["StackSetFailureTolerancePercentage"] = - input.StackSetFailureTolerancePercentage; - } - if (input.StackSetMaxConcurrencyCount !== undefined) { - bodyParams["StackSetMaxConcurrencyCount"] = - input.StackSetMaxConcurrencyCount; - } - if (input.StackSetMaxConcurrencyPercentage !== undefined) { - bodyParams["StackSetMaxConcurrencyPercentage"] = - input.StackSetMaxConcurrencyPercentage; - } - if (input.StackSetOperationType !== undefined) { - bodyParams["StackSetOperationType"] = input.StackSetOperationType; - } - if (input.StackSetRegions !== undefined) { - bodyParams["StackSetRegions"] = serializeAws_json1_1StackSetRegions( - input.StackSetRegions, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateServiceActionInput = ( input: UpdateServiceActionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AcceptLanguage !== undefined) { - bodyParams["AcceptLanguage"] = input.AcceptLanguage; - } - if (input.Definition !== undefined) { - bodyParams["Definition"] = serializeAws_json1_1ServiceActionDefinitionMap( - input.Definition, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AssociateTagOptionWithResourceOutput = ( diff --git a/clients/client-service-quotas/protocols/Aws_json1_1.ts b/clients/client-service-quotas/protocols/Aws_json1_1.ts index 0a20d7750ce2..79d810df0320 100644 --- a/clients/client-service-quotas/protocols/Aws_json1_1.ts +++ b/clients/client-service-quotas/protocols/Aws_json1_1.ts @@ -2778,245 +2778,168 @@ const serializeAws_json1_1AssociateServiceQuotaTemplateRequest = ( input: AssociateServiceQuotaTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DeleteServiceQuotaIncreaseRequestFromTemplateRequest = ( input: DeleteServiceQuotaIncreaseRequestFromTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), + ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const serializeAws_json1_1DisassociateServiceQuotaTemplateRequest = ( input: DisassociateServiceQuotaTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetAWSDefaultServiceQuotaRequest = ( input: GetAWSDefaultServiceQuotaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const serializeAws_json1_1GetAssociationForServiceQuotaTemplateRequest = ( input: GetAssociationForServiceQuotaTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetRequestedServiceQuotaChangeRequest = ( input: GetRequestedServiceQuotaChangeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RequestId !== undefined) { - bodyParams["RequestId"] = input.RequestId; - } - return bodyParams; + return { + ...(input.RequestId !== undefined && { RequestId: input.RequestId }) + }; }; const serializeAws_json1_1GetServiceQuotaIncreaseRequestFromTemplateRequest = ( input: GetServiceQuotaIncreaseRequestFromTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.AwsRegion !== undefined && { AwsRegion: input.AwsRegion }), + ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const serializeAws_json1_1GetServiceQuotaRequest = ( input: GetServiceQuotaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const serializeAws_json1_1ListAWSDefaultServiceQuotasRequest = ( input: ListAWSDefaultServiceQuotasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryByQuotaRequest = ( input: ListRequestedServiceQuotaChangeHistoryByQuotaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListRequestedServiceQuotaChangeHistoryRequest = ( input: ListRequestedServiceQuotaChangeHistoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListServiceQuotaIncreaseRequestsInTemplateRequest = ( input: ListServiceQuotaIncreaseRequestsInTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListServiceQuotasRequest = ( input: ListServiceQuotasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const serializeAws_json1_1ListServicesRequest = ( input: ListServicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1PutServiceQuotaIncreaseRequestIntoTemplateRequest = ( input: PutServiceQuotaIncreaseRequestIntoTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsRegion !== undefined) { - bodyParams["AwsRegion"] = input.AwsRegion; - } - if (input.DesiredValue !== undefined) { - bodyParams["DesiredValue"] = input.DesiredValue; - } - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RequestServiceQuotaIncreaseRequest = ( input: RequestServiceQuotaIncreaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DesiredValue !== undefined) { - bodyParams["DesiredValue"] = input.DesiredValue; - } - if (input.QuotaCode !== undefined) { - bodyParams["QuotaCode"] = input.QuotaCode; - } - if (input.ServiceCode !== undefined) { - bodyParams["ServiceCode"] = input.ServiceCode; - } - return bodyParams; + return { + ...(input.DesiredValue !== undefined && { + DesiredValue: input.DesiredValue + }), + ...(input.QuotaCode !== undefined && { QuotaCode: input.QuotaCode }), + ...(input.ServiceCode !== undefined && { ServiceCode: input.ServiceCode }) + }; }; const deserializeAws_json1_1AWSServiceAccessNotEnabledException = ( diff --git a/clients/client-servicediscovery/protocols/Aws_json1_1.ts b/clients/client-servicediscovery/protocols/Aws_json1_1.ts index c46f9f1a3e1f..f5f2290305a0 100644 --- a/clients/client-servicediscovery/protocols/Aws_json1_1.ts +++ b/clients/client-servicediscovery/protocols/Aws_json1_1.ts @@ -2342,216 +2342,147 @@ const serializeAws_json1_1CreateHttpNamespaceRequest = ( input: CreateHttpNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatorRequestId === undefined) { - input.CreatorRequestId = generateIdempotencyToken(); - } - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreatePrivateDnsNamespaceRequest = ( input: CreatePrivateDnsNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatorRequestId === undefined) { - input.CreatorRequestId = generateIdempotencyToken(); - } - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Vpc !== undefined) { - bodyParams["Vpc"] = input.Vpc; - } - return bodyParams; + return { + CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Vpc !== undefined && { Vpc: input.Vpc }) + }; }; const serializeAws_json1_1CreatePublicDnsNamespaceRequest = ( input: CreatePublicDnsNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatorRequestId === undefined) { - input.CreatorRequestId = generateIdempotencyToken(); - } - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), + ...(input.Description !== undefined && { Description: input.Description }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateServiceRequest = ( input: CreateServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CreatorRequestId === undefined) { - input.CreatorRequestId = generateIdempotencyToken(); - } - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DnsConfig !== undefined) { - bodyParams["DnsConfig"] = serializeAws_json1_1DnsConfig( - input.DnsConfig, - context - ); - } - if (input.HealthCheckConfig !== undefined) { - bodyParams["HealthCheckConfig"] = serializeAws_json1_1HealthCheckConfig( - input.HealthCheckConfig, - context - ); - } - if (input.HealthCheckCustomConfig !== undefined) { - bodyParams[ - "HealthCheckCustomConfig" - ] = serializeAws_json1_1HealthCheckCustomConfig( - input.HealthCheckCustomConfig, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NamespaceId !== undefined) { - bodyParams["NamespaceId"] = input.NamespaceId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteNamespaceRequest = ( input: DeleteNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DeleteServiceRequest = ( input: DeleteServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1DeregisterInstanceRequest = ( input: DeregisterInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.ServiceId !== undefined) { - bodyParams["ServiceId"] = input.ServiceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }) + }; }; const serializeAws_json1_1DiscoverInstancesRequest = ( input: DiscoverInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HealthStatus !== undefined) { - bodyParams["HealthStatus"] = input.HealthStatus; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NamespaceName !== undefined) { - bodyParams["NamespaceName"] = input.NamespaceName; - } - if (input.QueryParameters !== undefined) { - bodyParams["QueryParameters"] = serializeAws_json1_1Attributes( - input.QueryParameters, - context - ); - } - if (input.ServiceName !== undefined) { - bodyParams["ServiceName"] = input.ServiceName; - } - return bodyParams; + return { + ...(input.HealthStatus !== undefined && { + HealthStatus: input.HealthStatus + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NamespaceName !== undefined && { + NamespaceName: input.NamespaceName + }), + ...(input.QueryParameters !== undefined && { + QueryParameters: serializeAws_json1_1Attributes( + input.QueryParameters, + context + ) + }), + ...(input.ServiceName !== undefined && { ServiceName: input.ServiceName }) + }; }; const serializeAws_json1_1DnsConfig = ( input: DnsConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DnsRecords !== undefined) { - bodyParams["DnsRecords"] = serializeAws_json1_1DnsRecordList( - input.DnsRecords, - context - ); - } - if (input.NamespaceId !== undefined) { - bodyParams["NamespaceId"] = input.NamespaceId; - } - if (input.RoutingPolicy !== undefined) { - bodyParams["RoutingPolicy"] = input.RoutingPolicy; - } - return bodyParams; + return { + ...(input.DnsRecords !== undefined && { + DnsRecords: serializeAws_json1_1DnsRecordList(input.DnsRecords, context) + }), + ...(input.NamespaceId !== undefined && { NamespaceId: input.NamespaceId }), + ...(input.RoutingPolicy !== undefined && { + RoutingPolicy: input.RoutingPolicy + }) + }; }; const serializeAws_json1_1DnsConfigChange = ( input: DnsConfigChange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DnsRecords !== undefined) { - bodyParams["DnsRecords"] = serializeAws_json1_1DnsRecordList( - input.DnsRecords, - context - ); - } - return bodyParams; + return { + ...(input.DnsRecords !== undefined && { + DnsRecords: serializeAws_json1_1DnsRecordList(input.DnsRecords, context) + }) + }; }; const serializeAws_json1_1DnsRecord = ( input: DnsRecord, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TTL !== undefined) { - bodyParams["TTL"] = input.TTL; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.TTL !== undefined && { TTL: input.TTL }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1DnsRecordList = ( @@ -2572,98 +2503,77 @@ const serializeAws_json1_1GetInstanceRequest = ( input: GetInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.ServiceId !== undefined) { - bodyParams["ServiceId"] = input.ServiceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }) + }; }; const serializeAws_json1_1GetInstancesHealthStatusRequest = ( input: GetInstancesHealthStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Instances !== undefined) { - bodyParams["Instances"] = serializeAws_json1_1InstanceIdList( - input.Instances, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceId !== undefined) { - bodyParams["ServiceId"] = input.ServiceId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetNamespaceRequest = ( input: GetNamespaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1GetOperationRequest = ( input: GetOperationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OperationId !== undefined) { - bodyParams["OperationId"] = input.OperationId; - } - return bodyParams; + return { + ...(input.OperationId !== undefined && { OperationId: input.OperationId }) + }; }; const serializeAws_json1_1GetServiceRequest = ( input: GetServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }) + }; }; const serializeAws_json1_1HealthCheckConfig = ( input: HealthCheckConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FailureThreshold !== undefined) { - bodyParams["FailureThreshold"] = input.FailureThreshold; - } - if (input.ResourcePath !== undefined) { - bodyParams["ResourcePath"] = input.ResourcePath; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.FailureThreshold !== undefined && { + FailureThreshold: input.FailureThreshold + }), + ...(input.ResourcePath !== undefined && { + ResourcePath: input.ResourcePath + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1HealthCheckCustomConfig = ( input: HealthCheckCustomConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FailureThreshold !== undefined) { - bodyParams["FailureThreshold"] = input.FailureThreshold; - } - return bodyParams; + return { + ...(input.FailureThreshold !== undefined && { + FailureThreshold: input.FailureThreshold + }) + }; }; const serializeAws_json1_1InstanceIdList = ( @@ -2677,97 +2587,63 @@ const serializeAws_json1_1ListInstancesRequest = ( input: ListInstancesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServiceId !== undefined) { - bodyParams["ServiceId"] = input.ServiceId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }) + }; }; const serializeAws_json1_1ListNamespacesRequest = ( input: ListNamespacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1NamespaceFilters( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1NamespaceFilters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListOperationsRequest = ( input: ListOperationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1OperationFilters( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1OperationFilters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListServicesRequest = ( input: ListServicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ServiceFilters( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1ServiceFilters(input.Filters, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1NamespaceFilter = ( input: NamespaceFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = input.Condition; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Condition !== undefined && { Condition: input.Condition }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1NamespaceFilters = ( @@ -2783,20 +2659,13 @@ const serializeAws_json1_1OperationFilter = ( input: OperationFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = input.Condition; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Condition !== undefined && { Condition: input.Condition }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1OperationFilters = ( @@ -2812,69 +2681,45 @@ const serializeAws_json1_1RegisterInstanceRequest = ( input: RegisterInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_json1_1Attributes( - input.Attributes, - context - ); - } - if (input.CreatorRequestId === undefined) { - input.CreatorRequestId = generateIdempotencyToken(); - } - if (input.CreatorRequestId !== undefined) { - bodyParams["CreatorRequestId"] = input.CreatorRequestId; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.ServiceId !== undefined) { - bodyParams["ServiceId"] = input.ServiceId; - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_json1_1Attributes(input.Attributes, context) + }), + CreatorRequestId: input.CreatorRequestId ?? generateIdempotencyToken(), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }) + }; }; const serializeAws_json1_1ServiceChange = ( input: ServiceChange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.DnsConfig !== undefined) { - bodyParams["DnsConfig"] = serializeAws_json1_1DnsConfigChange( - input.DnsConfig, - context - ); - } - if (input.HealthCheckConfig !== undefined) { - bodyParams["HealthCheckConfig"] = serializeAws_json1_1HealthCheckConfig( - input.HealthCheckConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ServiceFilter = ( input: ServiceFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Condition !== undefined) { - bodyParams["Condition"] = input.Condition; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1FilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Condition !== undefined && { Condition: input.Condition }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1FilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1ServiceFilters = ( @@ -2888,34 +2733,23 @@ const serializeAws_json1_1UpdateInstanceCustomHealthStatusRequest = ( input: UpdateInstanceCustomHealthStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.ServiceId !== undefined) { - bodyParams["ServiceId"] = input.ServiceId; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.ServiceId !== undefined && { ServiceId: input.ServiceId }), + ...(input.Status !== undefined && { Status: input.Status }) + }; }; const serializeAws_json1_1UpdateServiceRequest = ( input: UpdateServiceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Service !== undefined) { - bodyParams["Service"] = serializeAws_json1_1ServiceChange( - input.Service, - context - ); - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Service !== undefined && { + Service: serializeAws_json1_1ServiceChange(input.Service, context) + }) + }; }; const deserializeAws_json1_1Attributes = ( diff --git a/clients/client-sesv2/protocols/Aws_restJson1_1.ts b/clients/client-sesv2/protocols/Aws_restJson1_1.ts index e6cf3c6daafd..e2b000dc32a6 100644 --- a/clients/client-sesv2/protocols/Aws_restJson1_1.ts +++ b/clients/client-sesv2/protocols/Aws_restJson1_1.ts @@ -6776,30 +6776,24 @@ const serializeAws_restJson1_1SuppressionOptions = ( input: SuppressionOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SuppressedReasons !== undefined) { - bodyParams[ - "SuppressedReasons" - ] = serializeAws_restJson1_1SuppressionListReasons( - input.SuppressedReasons, - context - ); - } - return bodyParams; + return { + ...(input.SuppressedReasons !== undefined && { + SuppressedReasons: serializeAws_restJson1_1SuppressionListReasons( + input.SuppressedReasons, + context + ) + }) + }; }; const serializeAws_restJson1_1Tag = ( input: Tag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TagList = ( @@ -6813,47 +6807,45 @@ const serializeAws_restJson1_1Body = ( input: Body, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Html !== undefined) { - bodyParams["Html"] = serializeAws_restJson1_1Content(input.Html, context); - } - if (input.Text !== undefined) { - bodyParams["Text"] = serializeAws_restJson1_1Content(input.Text, context); - } - return bodyParams; + return { + ...(input.Html !== undefined && { + Html: serializeAws_restJson1_1Content(input.Html, context) + }), + ...(input.Text !== undefined && { + Text: serializeAws_restJson1_1Content(input.Text, context) + }) + }; }; const serializeAws_restJson1_1CloudWatchDestination = ( input: CloudWatchDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DimensionConfigurations !== undefined) { - bodyParams[ - "DimensionConfigurations" - ] = serializeAws_restJson1_1CloudWatchDimensionConfigurations( - input.DimensionConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.DimensionConfigurations !== undefined && { + DimensionConfigurations: serializeAws_restJson1_1CloudWatchDimensionConfigurations( + input.DimensionConfigurations, + context + ) + }) + }; }; const serializeAws_restJson1_1CloudWatchDimensionConfiguration = ( input: CloudWatchDimensionConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultDimensionValue !== undefined) { - bodyParams["DefaultDimensionValue"] = input.DefaultDimensionValue; - } - if (input.DimensionName !== undefined) { - bodyParams["DimensionName"] = input.DimensionName; - } - if (input.DimensionValueSource !== undefined) { - bodyParams["DimensionValueSource"] = input.DimensionValueSource; - } - return bodyParams; + return { + ...(input.DefaultDimensionValue !== undefined && { + DefaultDimensionValue: input.DefaultDimensionValue + }), + ...(input.DimensionName !== undefined && { + DimensionName: input.DimensionName + }), + ...(input.DimensionValueSource !== undefined && { + DimensionValueSource: input.DimensionValueSource + }) + }; }; const serializeAws_restJson1_1CloudWatchDimensionConfigurations = ( @@ -6869,92 +6861,82 @@ const serializeAws_restJson1_1Content = ( input: Content, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Charset !== undefined) { - bodyParams["Charset"] = input.Charset; - } - if (input.Data !== undefined) { - bodyParams["Data"] = input.Data; - } - return bodyParams; + return { + ...(input.Charset !== undefined && { Charset: input.Charset }), + ...(input.Data !== undefined && { Data: input.Data }) + }; }; const serializeAws_restJson1_1DeliveryOptions = ( input: DeliveryOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SendingPoolName !== undefined) { - bodyParams["SendingPoolName"] = input.SendingPoolName; - } - if (input.TlsPolicy !== undefined) { - bodyParams["TlsPolicy"] = input.TlsPolicy; - } - return bodyParams; + return { + ...(input.SendingPoolName !== undefined && { + SendingPoolName: input.SendingPoolName + }), + ...(input.TlsPolicy !== undefined && { TlsPolicy: input.TlsPolicy }) + }; }; const serializeAws_restJson1_1Destination = ( input: Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BccAddresses !== undefined) { - bodyParams["BccAddresses"] = serializeAws_restJson1_1EmailAddressList( - input.BccAddresses, - context - ); - } - if (input.CcAddresses !== undefined) { - bodyParams["CcAddresses"] = serializeAws_restJson1_1EmailAddressList( - input.CcAddresses, - context - ); - } - if (input.ToAddresses !== undefined) { - bodyParams["ToAddresses"] = serializeAws_restJson1_1EmailAddressList( - input.ToAddresses, - context - ); - } - return bodyParams; + return { + ...(input.BccAddresses !== undefined && { + BccAddresses: serializeAws_restJson1_1EmailAddressList( + input.BccAddresses, + context + ) + }), + ...(input.CcAddresses !== undefined && { + CcAddresses: serializeAws_restJson1_1EmailAddressList( + input.CcAddresses, + context + ) + }), + ...(input.ToAddresses !== undefined && { + ToAddresses: serializeAws_restJson1_1EmailAddressList( + input.ToAddresses, + context + ) + }) + }; }; const serializeAws_restJson1_1DkimSigningAttributes = ( input: DkimSigningAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainSigningPrivateKey !== undefined) { - bodyParams["DomainSigningPrivateKey"] = input.DomainSigningPrivateKey; - } - if (input.DomainSigningSelector !== undefined) { - bodyParams["DomainSigningSelector"] = input.DomainSigningSelector; - } - return bodyParams; + return { + ...(input.DomainSigningPrivateKey !== undefined && { + DomainSigningPrivateKey: input.DomainSigningPrivateKey + }), + ...(input.DomainSigningSelector !== undefined && { + DomainSigningSelector: input.DomainSigningSelector + }) + }; }; const serializeAws_restJson1_1DomainDeliverabilityTrackingOption = ( input: DomainDeliverabilityTrackingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Domain !== undefined) { - bodyParams["Domain"] = input.Domain; - } - if (input.InboxPlacementTrackingOption !== undefined) { - bodyParams[ - "InboxPlacementTrackingOption" - ] = serializeAws_restJson1_1InboxPlacementTrackingOption( - input.InboxPlacementTrackingOption, - context - ); - } - if (input.SubscriptionStartDate !== undefined) { - bodyParams["SubscriptionStartDate"] = Math.round( - input.SubscriptionStartDate.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.Domain !== undefined && { Domain: input.Domain }), + ...(input.InboxPlacementTrackingOption !== undefined && { + InboxPlacementTrackingOption: serializeAws_restJson1_1InboxPlacementTrackingOption( + input.InboxPlacementTrackingOption, + context + ) + }), + ...(input.SubscriptionStartDate !== undefined && { + SubscriptionStartDate: Math.round( + input.SubscriptionStartDate.getTime() / 1000 + ) + }) + }; }; const serializeAws_restJson1_1DomainDeliverabilityTrackingOptions = ( @@ -6977,70 +6959,56 @@ const serializeAws_restJson1_1EmailContent = ( input: EmailContent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Raw !== undefined) { - bodyParams["Raw"] = serializeAws_restJson1_1RawMessage(input.Raw, context); - } - if (input.Simple !== undefined) { - bodyParams["Simple"] = serializeAws_restJson1_1Message( - input.Simple, - context - ); - } - if (input.Template !== undefined) { - bodyParams["Template"] = serializeAws_restJson1_1Template( - input.Template, - context - ); - } - return bodyParams; + return { + ...(input.Raw !== undefined && { + Raw: serializeAws_restJson1_1RawMessage(input.Raw, context) + }), + ...(input.Simple !== undefined && { + Simple: serializeAws_restJson1_1Message(input.Simple, context) + }), + ...(input.Template !== undefined && { + Template: serializeAws_restJson1_1Template(input.Template, context) + }) + }; }; const serializeAws_restJson1_1EventDestinationDefinition = ( input: EventDestinationDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchDestination !== undefined) { - bodyParams[ - "CloudWatchDestination" - ] = serializeAws_restJson1_1CloudWatchDestination( - input.CloudWatchDestination, - context - ); - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.KinesisFirehoseDestination !== undefined) { - bodyParams[ - "KinesisFirehoseDestination" - ] = serializeAws_restJson1_1KinesisFirehoseDestination( - input.KinesisFirehoseDestination, - context - ); - } - if (input.MatchingEventTypes !== undefined) { - bodyParams["MatchingEventTypes"] = serializeAws_restJson1_1EventTypes( - input.MatchingEventTypes, - context - ); - } - if (input.PinpointDestination !== undefined) { - bodyParams[ - "PinpointDestination" - ] = serializeAws_restJson1_1PinpointDestination( - input.PinpointDestination, - context - ); - } - if (input.SnsDestination !== undefined) { - bodyParams["SnsDestination"] = serializeAws_restJson1_1SnsDestination( - input.SnsDestination, - context - ); - } - return bodyParams; + return { + ...(input.CloudWatchDestination !== undefined && { + CloudWatchDestination: serializeAws_restJson1_1CloudWatchDestination( + input.CloudWatchDestination, + context + ) + }), + ...(input.Enabled !== undefined && { Enabled: input.Enabled }), + ...(input.KinesisFirehoseDestination !== undefined && { + KinesisFirehoseDestination: serializeAws_restJson1_1KinesisFirehoseDestination( + input.KinesisFirehoseDestination, + context + ) + }), + ...(input.MatchingEventTypes !== undefined && { + MatchingEventTypes: serializeAws_restJson1_1EventTypes( + input.MatchingEventTypes, + context + ) + }), + ...(input.PinpointDestination !== undefined && { + PinpointDestination: serializeAws_restJson1_1PinpointDestination( + input.PinpointDestination, + context + ) + }), + ...(input.SnsDestination !== undefined && { + SnsDestination: serializeAws_restJson1_1SnsDestination( + input.SnsDestination, + context + ) + }) + }; }; const serializeAws_restJson1_1EventTypes = ( @@ -7054,17 +7022,15 @@ const serializeAws_restJson1_1InboxPlacementTrackingOption = ( input: InboxPlacementTrackingOption, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Global !== undefined) { - bodyParams["Global"] = input.Global; - } - if (input.TrackedIsps !== undefined) { - bodyParams["TrackedIsps"] = serializeAws_restJson1_1IspNameList( - input.TrackedIsps, - context - ); - } - return bodyParams; + return { + ...(input.Global !== undefined && { Global: input.Global }), + ...(input.TrackedIsps !== undefined && { + TrackedIsps: serializeAws_restJson1_1IspNameList( + input.TrackedIsps, + context + ) + }) + }; }; const serializeAws_restJson1_1IspNameList = ( @@ -7078,45 +7044,36 @@ const serializeAws_restJson1_1KinesisFirehoseDestination = ( input: KinesisFirehoseDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeliveryStreamArn !== undefined) { - bodyParams["DeliveryStreamArn"] = input.DeliveryStreamArn; - } - if (input.IamRoleArn !== undefined) { - bodyParams["IamRoleArn"] = input.IamRoleArn; - } - return bodyParams; + return { + ...(input.DeliveryStreamArn !== undefined && { + DeliveryStreamArn: input.DeliveryStreamArn + }), + ...(input.IamRoleArn !== undefined && { IamRoleArn: input.IamRoleArn }) + }; }; const serializeAws_restJson1_1Message = ( input: Message, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Body !== undefined) { - bodyParams["Body"] = serializeAws_restJson1_1Body(input.Body, context); - } - if (input.Subject !== undefined) { - bodyParams["Subject"] = serializeAws_restJson1_1Content( - input.Subject, - context - ); - } - return bodyParams; + return { + ...(input.Body !== undefined && { + Body: serializeAws_restJson1_1Body(input.Body, context) + }), + ...(input.Subject !== undefined && { + Subject: serializeAws_restJson1_1Content(input.Subject, context) + }) + }; }; const serializeAws_restJson1_1MessageTag = ( input: MessageTag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1MessageTagList = ( @@ -7130,85 +7087,77 @@ const serializeAws_restJson1_1PinpointDestination = ( input: PinpointDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApplicationArn !== undefined) { - bodyParams["ApplicationArn"] = input.ApplicationArn; - } - return bodyParams; + return { + ...(input.ApplicationArn !== undefined && { + ApplicationArn: input.ApplicationArn + }) + }; }; const serializeAws_restJson1_1RawMessage = ( input: RawMessage, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = context.base64Encoder(input.Data); - } - return bodyParams; + return { + ...(input.Data !== undefined && { Data: context.base64Encoder(input.Data) }) + }; }; const serializeAws_restJson1_1ReputationOptions = ( input: ReputationOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LastFreshStart !== undefined) { - bodyParams["LastFreshStart"] = Math.round( - input.LastFreshStart.getTime() / 1000 - ); - } - if (input.ReputationMetricsEnabled !== undefined) { - bodyParams["ReputationMetricsEnabled"] = input.ReputationMetricsEnabled; - } - return bodyParams; + return { + ...(input.LastFreshStart !== undefined && { + LastFreshStart: Math.round(input.LastFreshStart.getTime() / 1000) + }), + ...(input.ReputationMetricsEnabled !== undefined && { + ReputationMetricsEnabled: input.ReputationMetricsEnabled + }) + }; }; const serializeAws_restJson1_1SendingOptions = ( input: SendingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SendingEnabled !== undefined) { - bodyParams["SendingEnabled"] = input.SendingEnabled; - } - return bodyParams; + return { + ...(input.SendingEnabled !== undefined && { + SendingEnabled: input.SendingEnabled + }) + }; }; const serializeAws_restJson1_1SnsDestination = ( input: SnsDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TopicArn !== undefined) { - bodyParams["TopicArn"] = input.TopicArn; - } - return bodyParams; + return { + ...(input.TopicArn !== undefined && { TopicArn: input.TopicArn }) + }; }; const serializeAws_restJson1_1Template = ( input: Template, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TemplateArn !== undefined) { - bodyParams["TemplateArn"] = input.TemplateArn; - } - if (input.TemplateData !== undefined) { - bodyParams["TemplateData"] = input.TemplateData; - } - return bodyParams; + return { + ...(input.TemplateArn !== undefined && { TemplateArn: input.TemplateArn }), + ...(input.TemplateData !== undefined && { + TemplateData: input.TemplateData + }) + }; }; const serializeAws_restJson1_1TrackingOptions = ( input: TrackingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomRedirectDomain !== undefined) { - bodyParams["CustomRedirectDomain"] = input.CustomRedirectDomain; - } - return bodyParams; + return { + ...(input.CustomRedirectDomain !== undefined && { + CustomRedirectDomain: input.CustomRedirectDomain + }) + }; }; const deserializeAws_restJson1_1SuppressionAttributes = ( diff --git a/clients/client-sfn/protocols/Aws_json1_0.ts b/clients/client-sfn/protocols/Aws_json1_0.ts index 77171b662060..0c4723e9fbc4 100644 --- a/clients/client-sfn/protocols/Aws_json1_0.ts +++ b/clients/client-sfn/protocols/Aws_json1_0.ts @@ -2757,27 +2757,23 @@ const serializeAws_json1_0CloudWatchLogsLogGroup = ( input: CloudWatchLogsLogGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.logGroupArn !== undefined) { - bodyParams["logGroupArn"] = input.logGroupArn; - } - return bodyParams; + return { + ...(input.logGroupArn !== undefined && { logGroupArn: input.logGroupArn }) + }; }; const serializeAws_json1_0LogDestination = ( input: LogDestination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cloudWatchLogsLogGroup !== undefined) { - bodyParams[ - "cloudWatchLogsLogGroup" - ] = serializeAws_json1_0CloudWatchLogsLogGroup( - input.cloudWatchLogsLogGroup, - context - ); - } - return bodyParams; + return { + ...(input.cloudWatchLogsLogGroup !== undefined && { + cloudWatchLogsLogGroup: serializeAws_json1_0CloudWatchLogsLogGroup( + input.cloudWatchLogsLogGroup, + context + ) + }) + }; }; const serializeAws_json1_0LogDestinationList = ( @@ -2791,311 +2787,247 @@ const serializeAws_json1_0LoggingConfiguration = ( input: LoggingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.destinations !== undefined) { - bodyParams["destinations"] = serializeAws_json1_0LogDestinationList( - input.destinations, - context - ); - } - if (input.includeExecutionData !== undefined) { - bodyParams["includeExecutionData"] = input.includeExecutionData; - } - if (input.level !== undefined) { - bodyParams["level"] = input.level; - } - return bodyParams; + return { + ...(input.destinations !== undefined && { + destinations: serializeAws_json1_0LogDestinationList( + input.destinations, + context + ) + }), + ...(input.includeExecutionData !== undefined && { + includeExecutionData: input.includeExecutionData + }), + ...(input.level !== undefined && { level: input.level }) + }; }; const serializeAws_json1_0CreateActivityInput = ( input: CreateActivityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_0TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_0TagList(input.tags, context) + }) + }; }; const serializeAws_json1_0CreateStateMachineInput = ( input: CreateStateMachineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.definition !== undefined) { - bodyParams["definition"] = input.definition; - } - if (input.loggingConfiguration !== undefined) { - bodyParams[ - "loggingConfiguration" - ] = serializeAws_json1_0LoggingConfiguration( - input.loggingConfiguration, - context - ); - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_0TagList(input.tags, context); - } - if (input.type !== undefined) { - bodyParams["type"] = input.type; - } - return bodyParams; + 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.type !== undefined && { type: input.type }) + }; }; const serializeAws_json1_0DeleteActivityInput = ( input: DeleteActivityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityArn !== undefined) { - bodyParams["activityArn"] = input.activityArn; - } - return bodyParams; + return { + ...(input.activityArn !== undefined && { activityArn: input.activityArn }) + }; }; const serializeAws_json1_0DeleteStateMachineInput = ( input: DeleteStateMachineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.stateMachineArn !== undefined) { - bodyParams["stateMachineArn"] = input.stateMachineArn; - } - return bodyParams; + return { + ...(input.stateMachineArn !== undefined && { + stateMachineArn: input.stateMachineArn + }) + }; }; const serializeAws_json1_0DescribeActivityInput = ( input: DescribeActivityInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityArn !== undefined) { - bodyParams["activityArn"] = input.activityArn; - } - return bodyParams; + return { + ...(input.activityArn !== undefined && { activityArn: input.activityArn }) + }; }; const serializeAws_json1_0DescribeExecutionInput = ( input: DescribeExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.executionArn !== undefined) { - bodyParams["executionArn"] = input.executionArn; - } - return bodyParams; + return { + ...(input.executionArn !== undefined && { + executionArn: input.executionArn + }) + }; }; const serializeAws_json1_0DescribeStateMachineForExecutionInput = ( input: DescribeStateMachineForExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.executionArn !== undefined) { - bodyParams["executionArn"] = input.executionArn; - } - return bodyParams; + return { + ...(input.executionArn !== undefined && { + executionArn: input.executionArn + }) + }; }; const serializeAws_json1_0DescribeStateMachineInput = ( input: DescribeStateMachineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.stateMachineArn !== undefined) { - bodyParams["stateMachineArn"] = input.stateMachineArn; - } - return bodyParams; + return { + ...(input.stateMachineArn !== undefined && { + stateMachineArn: input.stateMachineArn + }) + }; }; const serializeAws_json1_0GetActivityTaskInput = ( input: GetActivityTaskInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityArn !== undefined) { - bodyParams["activityArn"] = input.activityArn; - } - if (input.workerName !== undefined) { - bodyParams["workerName"] = input.workerName; - } - return bodyParams; + return { + ...(input.activityArn !== undefined && { activityArn: input.activityArn }), + ...(input.workerName !== undefined && { workerName: input.workerName }) + }; }; const serializeAws_json1_0GetExecutionHistoryInput = ( input: GetExecutionHistoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.executionArn !== undefined) { - bodyParams["executionArn"] = input.executionArn; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - return bodyParams; + return { + ...(input.executionArn !== undefined && { + executionArn: input.executionArn + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.reverseOrder !== undefined && { + reverseOrder: input.reverseOrder + }) + }; }; const serializeAws_json1_0ListActivitiesInput = ( input: ListActivitiesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_0ListExecutionsInput = ( input: ListExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.stateMachineArn !== undefined) { - bodyParams["stateMachineArn"] = input.stateMachineArn; - } - if (input.statusFilter !== undefined) { - bodyParams["statusFilter"] = input.statusFilter; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ListStateMachinesInput = ( input: ListStateMachinesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_0ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_0SendTaskFailureInput = ( input: SendTaskFailureInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cause !== undefined) { - bodyParams["cause"] = input.cause; - } - if (input.error !== undefined) { - bodyParams["error"] = input.error; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.cause !== undefined && { cause: input.cause }), + ...(input.error !== undefined && { error: input.error }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0SendTaskHeartbeatInput = ( input: SendTaskHeartbeatInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0SendTaskSuccessInput = ( input: SendTaskSuccessInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.output !== undefined) { - bodyParams["output"] = input.output; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.output !== undefined && { output: input.output }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0StartExecutionInput = ( input: StartExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.stateMachineArn !== undefined) { - bodyParams["stateMachineArn"] = input.stateMachineArn; - } - return bodyParams; + return { + ...(input.input !== undefined && { input: input.input }), + ...(input.name !== undefined && { name: input.name }), + ...(input.stateMachineArn !== undefined && { + stateMachineArn: input.stateMachineArn + }) + }; }; const serializeAws_json1_0StopExecutionInput = ( input: StopExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cause !== undefined) { - bodyParams["cause"] = input.cause; - } - if (input.error !== undefined) { - bodyParams["error"] = input.error; - } - if (input.executionArn !== undefined) { - bodyParams["executionArn"] = input.executionArn; - } - return bodyParams; + return { + ...(input.cause !== undefined && { cause: input.cause }), + ...(input.error !== undefined && { error: input.error }), + ...(input.executionArn !== undefined && { + executionArn: input.executionArn + }) + }; }; const serializeAws_json1_0Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_0TagKeyList = ( @@ -3116,56 +3048,43 @@ const serializeAws_json1_0TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_0TagList(input.tags, context); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_0TagList(input.tags, context) + }) + }; }; const serializeAws_json1_0UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_0TagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_0TagKeyList(input.tagKeys, context) + }) + }; }; const serializeAws_json1_0UpdateStateMachineInput = ( input: UpdateStateMachineInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.definition !== undefined) { - bodyParams["definition"] = input.definition; - } - if (input.loggingConfiguration !== undefined) { - bodyParams[ - "loggingConfiguration" - ] = serializeAws_json1_0LoggingConfiguration( - input.loggingConfiguration, - context - ); - } - if (input.roleArn !== undefined) { - bodyParams["roleArn"] = input.roleArn; - } - if (input.stateMachineArn !== undefined) { - bodyParams["stateMachineArn"] = input.stateMachineArn; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_0ActivityFailedEventDetails = ( diff --git a/clients/client-shield/protocols/Aws_json1_1.ts b/clients/client-shield/protocols/Aws_json1_1.ts index 3b53c95b12aa..5eda17e75dbc 100644 --- a/clients/client-shield/protocols/Aws_json1_1.ts +++ b/clients/client-shield/protocols/Aws_json1_1.ts @@ -2304,142 +2304,122 @@ const serializeAws_json1_1AssociateDRTLogBucketRequest = ( input: AssociateDRTLogBucketRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogBucket !== undefined) { - bodyParams["LogBucket"] = input.LogBucket; - } - return bodyParams; + return { + ...(input.LogBucket !== undefined && { LogBucket: input.LogBucket }) + }; }; const serializeAws_json1_1AssociateDRTRoleRequest = ( input: AssociateDRTRoleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - return bodyParams; + return { + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }) + }; }; const serializeAws_json1_1CreateProtectionRequest = ( input: CreateProtectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1CreateSubscriptionRequest = ( input: CreateSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DeleteProtectionRequest = ( input: DeleteProtectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProtectionId !== undefined) { - bodyParams["ProtectionId"] = input.ProtectionId; - } - return bodyParams; + return { + ...(input.ProtectionId !== undefined && { + ProtectionId: input.ProtectionId + }) + }; }; const serializeAws_json1_1DeleteSubscriptionRequest = ( input: DeleteSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeAttackRequest = ( input: DescribeAttackRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AttackId !== undefined) { - bodyParams["AttackId"] = input.AttackId; - } - return bodyParams; + return { + ...(input.AttackId !== undefined && { AttackId: input.AttackId }) + }; }; const serializeAws_json1_1DescribeDRTAccessRequest = ( input: DescribeDRTAccessRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeEmergencyContactSettingsRequest = ( input: DescribeEmergencyContactSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeProtectionRequest = ( input: DescribeProtectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ProtectionId !== undefined) { - bodyParams["ProtectionId"] = input.ProtectionId; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ProtectionId !== undefined && { + ProtectionId: input.ProtectionId + }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DescribeSubscriptionRequest = ( input: DescribeSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DisassociateDRTLogBucketRequest = ( input: DisassociateDRTLogBucketRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogBucket !== undefined) { - bodyParams["LogBucket"] = input.LogBucket; - } - return bodyParams; + return { + ...(input.LogBucket !== undefined && { LogBucket: input.LogBucket }) + }; }; const serializeAws_json1_1DisassociateDRTRoleRequest = ( input: DisassociateDRTRoleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1EmergencyContact = ( input: EmergencyContact, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EmailAddress !== undefined) { - bodyParams["EmailAddress"] = input.EmailAddress; - } - return bodyParams; + return { + ...(input.EmailAddress !== undefined && { + EmailAddress: input.EmailAddress + }) + }; }; const serializeAws_json1_1EmergencyContactList = ( @@ -2455,54 +2435,39 @@ const serializeAws_json1_1GetSubscriptionStateRequest = ( input: GetSubscriptionStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ListAttacksRequest = ( input: ListAttacksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = serializeAws_json1_1TimeRange( - input.EndTime, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceArns !== undefined) { - bodyParams["ResourceArns"] = serializeAws_json1_1ResourceArnFilterList( - input.ResourceArns, - context - ); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = serializeAws_json1_1TimeRange( - input.StartTime, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ListProtectionsRequest = ( input: ListProtectionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ResourceArnFilterList = ( @@ -2516,43 +2481,37 @@ const serializeAws_json1_1TimeRange = ( input: TimeRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FromInclusive !== undefined) { - bodyParams["FromInclusive"] = Math.round( - input.FromInclusive.getTime() / 1000 - ); - } - if (input.ToExclusive !== undefined) { - bodyParams["ToExclusive"] = Math.round(input.ToExclusive.getTime() / 1000); - } - return bodyParams; + return { + ...(input.FromInclusive !== undefined && { + FromInclusive: Math.round(input.FromInclusive.getTime() / 1000) + }), + ...(input.ToExclusive !== undefined && { + ToExclusive: Math.round(input.ToExclusive.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UpdateEmergencyContactSettingsRequest = ( input: UpdateEmergencyContactSettingsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EmergencyContactList !== undefined) { - bodyParams[ - "EmergencyContactList" - ] = serializeAws_json1_1EmergencyContactList( - input.EmergencyContactList, - context - ); - } - return bodyParams; + return { + ...(input.EmergencyContactList !== undefined && { + EmergencyContactList: serializeAws_json1_1EmergencyContactList( + input.EmergencyContactList, + context + ) + }) + }; }; const serializeAws_json1_1UpdateSubscriptionRequest = ( input: UpdateSubscriptionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoRenew !== undefined) { - bodyParams["AutoRenew"] = input.AutoRenew; - } - return bodyParams; + return { + ...(input.AutoRenew !== undefined && { AutoRenew: input.AutoRenew }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-signer/protocols/Aws_restJson1_1.ts b/clients/client-signer/protocols/Aws_restJson1_1.ts index 761608f41d1c..50eabfd11c85 100644 --- a/clients/client-signer/protocols/Aws_restJson1_1.ts +++ b/clients/client-signer/protocols/Aws_restJson1_1.ts @@ -1895,67 +1895,57 @@ const serializeAws_restJson1_1Destination = ( input: Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3 !== undefined) { - bodyParams["s3"] = serializeAws_restJson1_1S3Destination(input.s3, context); - } - return bodyParams; + return { + ...(input.s3 !== undefined && { + s3: serializeAws_restJson1_1S3Destination(input.s3, context) + }) + }; }; const serializeAws_restJson1_1S3Destination = ( input: S3Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - if (input.prefix !== undefined) { - bodyParams["prefix"] = input.prefix; - } - return bodyParams; + return { + ...(input.bucketName !== undefined && { bucketName: input.bucketName }), + ...(input.prefix !== undefined && { prefix: input.prefix }) + }; }; const serializeAws_restJson1_1S3Source = ( input: S3Source, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucketName !== undefined) { - bodyParams["bucketName"] = input.bucketName; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.bucketName !== undefined && { bucketName: input.bucketName }), + ...(input.key !== undefined && { key: input.key }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_restJson1_1SigningConfigurationOverrides = ( input: SigningConfigurationOverrides, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.encryptionAlgorithm !== undefined) { - bodyParams["encryptionAlgorithm"] = input.encryptionAlgorithm; - } - if (input.hashAlgorithm !== undefined) { - bodyParams["hashAlgorithm"] = input.hashAlgorithm; - } - return bodyParams; + return { + ...(input.encryptionAlgorithm !== undefined && { + encryptionAlgorithm: input.encryptionAlgorithm + }), + ...(input.hashAlgorithm !== undefined && { + hashAlgorithm: input.hashAlgorithm + }) + }; }; const serializeAws_restJson1_1SigningMaterial = ( input: SigningMaterial, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.certificateArn !== undefined) { - bodyParams["certificateArn"] = input.certificateArn; - } - return bodyParams; + return { + ...(input.certificateArn !== undefined && { + certificateArn: input.certificateArn + }) + }; }; const serializeAws_restJson1_1SigningParameters = ( @@ -1972,27 +1962,25 @@ const serializeAws_restJson1_1SigningPlatformOverrides = ( input: SigningPlatformOverrides, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.signingConfiguration !== undefined) { - bodyParams[ - "signingConfiguration" - ] = serializeAws_restJson1_1SigningConfigurationOverrides( - input.signingConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.signingConfiguration !== undefined && { + signingConfiguration: serializeAws_restJson1_1SigningConfigurationOverrides( + input.signingConfiguration, + context + ) + }) + }; }; const serializeAws_restJson1_1Source = ( input: Source, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3 !== undefined) { - bodyParams["s3"] = serializeAws_restJson1_1S3Source(input.s3, context); - } - return bodyParams; + return { + ...(input.s3 !== undefined && { + s3: serializeAws_restJson1_1S3Source(input.s3, context) + }) + }; }; const serializeAws_restJson1_1TagMap = ( diff --git a/clients/client-sms/protocols/Aws_json1_1.ts b/clients/client-sms/protocols/Aws_json1_1.ts index 5b37105c5743..cb2d9e634d76 100644 --- a/clients/client-sms/protocols/Aws_json1_1.ts +++ b/clients/client-sms/protocols/Aws_json1_1.ts @@ -3738,426 +3738,330 @@ const serializeAws_json1_1CreateAppRequest = ( input: CreateAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.clientToken !== undefined) { - bodyParams["clientToken"] = input.clientToken; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.roleName !== undefined) { - bodyParams["roleName"] = input.roleName; - } - if (input.serverGroups !== undefined) { - bodyParams["serverGroups"] = serializeAws_json1_1ServerGroups( - input.serverGroups, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateReplicationJobRequest = ( input: CreateReplicationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.encrypted !== undefined) { - bodyParams["encrypted"] = input.encrypted; - } - if (input.frequency !== undefined) { - bodyParams["frequency"] = input.frequency; - } - if (input.kmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.kmsKeyId; - } - if (input.licenseType !== undefined) { - bodyParams["licenseType"] = input.licenseType; - } - if (input.numberOfRecentAmisToKeep !== undefined) { - bodyParams["numberOfRecentAmisToKeep"] = input.numberOfRecentAmisToKeep; - } - if (input.roleName !== undefined) { - bodyParams["roleName"] = input.roleName; - } - if (input.runOnce !== undefined) { - bodyParams["runOnce"] = input.runOnce; - } - if (input.seedReplicationTime !== undefined) { - bodyParams["seedReplicationTime"] = Math.round( - input.seedReplicationTime.getTime() / 1000 - ); - } - if (input.serverId !== undefined) { - bodyParams["serverId"] = input.serverId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteAppLaunchConfigurationRequest = ( input: DeleteAppLaunchConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1DeleteAppReplicationConfigurationRequest = ( input: DeleteAppReplicationConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1DeleteAppRequest = ( input: DeleteAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - if (input.forceStopAppReplication !== undefined) { - bodyParams["forceStopAppReplication"] = input.forceStopAppReplication; - } - if (input.forceTerminateApp !== undefined) { - bodyParams["forceTerminateApp"] = input.forceTerminateApp; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }), + ...(input.forceStopAppReplication !== undefined && { + forceStopAppReplication: input.forceStopAppReplication + }), + ...(input.forceTerminateApp !== undefined && { + forceTerminateApp: input.forceTerminateApp + }) + }; }; const serializeAws_json1_1DeleteReplicationJobRequest = ( input: DeleteReplicationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.replicationJobId !== undefined) { - bodyParams["replicationJobId"] = input.replicationJobId; - } - return bodyParams; + return { + ...(input.replicationJobId !== undefined && { + replicationJobId: input.replicationJobId + }) + }; }; const serializeAws_json1_1DeleteServerCatalogRequest = ( input: DeleteServerCatalogRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DisassociateConnectorRequest = ( input: DisassociateConnectorRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.connectorId !== undefined) { - bodyParams["connectorId"] = input.connectorId; - } - return bodyParams; + return { + ...(input.connectorId !== undefined && { connectorId: input.connectorId }) + }; }; const serializeAws_json1_1GenerateChangeSetRequest = ( input: GenerateChangeSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - if (input.changesetFormat !== undefined) { - bodyParams["changesetFormat"] = input.changesetFormat; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }), + ...(input.changesetFormat !== undefined && { + changesetFormat: input.changesetFormat + }) + }; }; const serializeAws_json1_1GenerateTemplateRequest = ( input: GenerateTemplateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - if (input.templateFormat !== undefined) { - bodyParams["templateFormat"] = input.templateFormat; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }), + ...(input.templateFormat !== undefined && { + templateFormat: input.templateFormat + }) + }; }; const serializeAws_json1_1GetAppLaunchConfigurationRequest = ( input: GetAppLaunchConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1GetAppReplicationConfigurationRequest = ( input: GetAppReplicationConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1GetAppRequest = ( input: GetAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1GetConnectorsRequest = ( input: GetConnectorsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1GetReplicationJobsRequest = ( input: GetReplicationJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.replicationJobId !== undefined) { - bodyParams["replicationJobId"] = input.replicationJobId; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.replicationJobId !== undefined && { + replicationJobId: input.replicationJobId + }) + }; }; const serializeAws_json1_1GetReplicationRunsRequest = ( input: GetReplicationRunsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.replicationJobId !== undefined) { - bodyParams["replicationJobId"] = input.replicationJobId; - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.replicationJobId !== undefined && { + replicationJobId: input.replicationJobId + }) + }; }; const serializeAws_json1_1GetServersRequest = ( input: GetServersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - if (input.vmServerAddressList !== undefined) { - bodyParams["vmServerAddressList"] = serializeAws_json1_1VmServerAddressList( - input.vmServerAddressList, - context - ); - } - return bodyParams; + return { + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }), + ...(input.vmServerAddressList !== undefined && { + vmServerAddressList: serializeAws_json1_1VmServerAddressList( + input.vmServerAddressList, + context + ) + }) + }; }; const serializeAws_json1_1ImportServerCatalogRequest = ( input: ImportServerCatalogRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1LaunchAppRequest = ( input: LaunchAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1ListAppsRequest = ( input: ListAppsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appIds !== undefined) { - bodyParams["appIds"] = serializeAws_json1_1AppIds(input.appIds, context); - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + return { + ...(input.appIds !== undefined && { + appIds: serializeAws_json1_1AppIds(input.appIds, context) + }), + ...(input.maxResults !== undefined && { maxResults: input.maxResults }), + ...(input.nextToken !== undefined && { nextToken: input.nextToken }) + }; }; const serializeAws_json1_1PutAppLaunchConfigurationRequest = ( input: PutAppLaunchConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - if (input.roleName !== undefined) { - bodyParams["roleName"] = input.roleName; - } - if (input.serverGroupLaunchConfigurations !== undefined) { - bodyParams[ - "serverGroupLaunchConfigurations" - ] = serializeAws_json1_1ServerGroupLaunchConfigurations( - input.serverGroupLaunchConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }), + ...(input.roleName !== undefined && { roleName: input.roleName }), + ...(input.serverGroupLaunchConfigurations !== undefined && { + serverGroupLaunchConfigurations: serializeAws_json1_1ServerGroupLaunchConfigurations( + input.serverGroupLaunchConfigurations, + context + ) + }) + }; }; const serializeAws_json1_1PutAppReplicationConfigurationRequest = ( input: PutAppReplicationConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - if (input.serverGroupReplicationConfigurations !== undefined) { - bodyParams[ - "serverGroupReplicationConfigurations" - ] = serializeAws_json1_1ServerGroupReplicationConfigurations( - input.serverGroupReplicationConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }), + ...(input.serverGroupReplicationConfigurations !== undefined && { + serverGroupReplicationConfigurations: serializeAws_json1_1ServerGroupReplicationConfigurations( + input.serverGroupReplicationConfigurations, + context + ) + }) + }; }; const serializeAws_json1_1S3Location = ( input: S3Location, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bucket !== undefined) { - bodyParams["bucket"] = input.bucket; - } - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - return bodyParams; + return { + ...(input.bucket !== undefined && { bucket: input.bucket }), + ...(input.key !== undefined && { key: input.key }) + }; }; const serializeAws_json1_1Server = ( input: Server, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.replicationJobId !== undefined) { - bodyParams["replicationJobId"] = input.replicationJobId; - } - if (input.replicationJobTerminated !== undefined) { - bodyParams["replicationJobTerminated"] = input.replicationJobTerminated; - } - if (input.serverId !== undefined) { - bodyParams["serverId"] = input.serverId; - } - if (input.serverType !== undefined) { - bodyParams["serverType"] = input.serverType; - } - if (input.vmServer !== undefined) { - bodyParams["vmServer"] = serializeAws_json1_1VmServer( - input.vmServer, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1ServerGroup = ( input: ServerGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.serverGroupId !== undefined) { - bodyParams["serverGroupId"] = input.serverGroupId; - } - if (input.serverList !== undefined) { - bodyParams["serverList"] = serializeAws_json1_1ServerList( - input.serverList, - context - ); - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.serverGroupId !== undefined && { + serverGroupId: input.serverGroupId + }), + ...(input.serverList !== undefined && { + serverList: serializeAws_json1_1ServerList(input.serverList, context) + }) + }; }; const serializeAws_json1_1ServerGroupLaunchConfiguration = ( input: ServerGroupLaunchConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.launchOrder !== undefined) { - bodyParams["launchOrder"] = input.launchOrder; - } - if (input.serverGroupId !== undefined) { - bodyParams["serverGroupId"] = input.serverGroupId; - } - if (input.serverLaunchConfigurations !== undefined) { - bodyParams[ - "serverLaunchConfigurations" - ] = serializeAws_json1_1ServerLaunchConfigurations( - input.serverLaunchConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.launchOrder !== undefined && { launchOrder: input.launchOrder }), + ...(input.serverGroupId !== undefined && { + serverGroupId: input.serverGroupId + }), + ...(input.serverLaunchConfigurations !== undefined && { + serverLaunchConfigurations: serializeAws_json1_1ServerLaunchConfigurations( + input.serverLaunchConfigurations, + context + ) + }) + }; }; const serializeAws_json1_1ServerGroupLaunchConfigurations = ( @@ -4173,19 +4077,17 @@ const serializeAws_json1_1ServerGroupReplicationConfiguration = ( input: ServerGroupReplicationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.serverGroupId !== undefined) { - bodyParams["serverGroupId"] = input.serverGroupId; - } - if (input.serverReplicationConfigurations !== undefined) { - bodyParams[ - "serverReplicationConfigurations" - ] = serializeAws_json1_1ServerReplicationConfigurations( - input.serverReplicationConfigurations, - context - ); - } - return bodyParams; + return { + ...(input.serverGroupId !== undefined && { + serverGroupId: input.serverGroupId + }), + ...(input.serverReplicationConfigurations !== undefined && { + serverReplicationConfigurations: serializeAws_json1_1ServerReplicationConfigurations( + input.serverReplicationConfigurations, + context + ) + }) + }; }; const serializeAws_json1_1ServerGroupReplicationConfigurations = ( @@ -4208,38 +4110,27 @@ const serializeAws_json1_1ServerLaunchConfiguration = ( input: ServerLaunchConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.associatePublicIpAddress !== undefined) { - bodyParams["associatePublicIpAddress"] = input.associatePublicIpAddress; - } - if (input.ec2KeyName !== undefined) { - bodyParams["ec2KeyName"] = input.ec2KeyName; - } - if (input.instanceType !== undefined) { - bodyParams["instanceType"] = input.instanceType; - } - if (input.logicalId !== undefined) { - bodyParams["logicalId"] = input.logicalId; - } - if (input.securityGroup !== undefined) { - bodyParams["securityGroup"] = input.securityGroup; - } - if (input.server !== undefined) { - bodyParams["server"] = serializeAws_json1_1Server(input.server, context); - } - if (input.subnet !== undefined) { - bodyParams["subnet"] = input.subnet; - } - if (input.userData !== undefined) { - bodyParams["userData"] = serializeAws_json1_1UserData( - input.userData, - context - ); - } - if (input.vpc !== undefined) { - bodyParams["vpc"] = input.vpc; - } - return bodyParams; + return { + ...(input.associatePublicIpAddress !== undefined && { + associatePublicIpAddress: input.associatePublicIpAddress + }), + ...(input.ec2KeyName !== undefined && { ec2KeyName: input.ec2KeyName }), + ...(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 }) + }; }; const serializeAws_json1_1ServerLaunchConfigurations = ( @@ -4262,19 +4153,17 @@ const serializeAws_json1_1ServerReplicationConfiguration = ( input: ServerReplicationConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.server !== undefined) { - bodyParams["server"] = serializeAws_json1_1Server(input.server, context); - } - if (input.serverReplicationParameters !== undefined) { - bodyParams[ - "serverReplicationParameters" - ] = serializeAws_json1_1ServerReplicationParameters( - input.serverReplicationParameters, - context - ); - } - return bodyParams; + return { + ...(input.server !== undefined && { + server: serializeAws_json1_1Server(input.server, context) + }), + ...(input.serverReplicationParameters !== undefined && { + serverReplicationParameters: serializeAws_json1_1ServerReplicationParameters( + input.serverReplicationParameters, + context + ) + }) + }; }; const serializeAws_json1_1ServerReplicationConfigurations = ( @@ -4290,76 +4179,56 @@ const serializeAws_json1_1ServerReplicationParameters = ( input: ServerReplicationParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.encrypted !== undefined) { - bodyParams["encrypted"] = input.encrypted; - } - if (input.frequency !== undefined) { - bodyParams["frequency"] = input.frequency; - } - if (input.kmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.kmsKeyId; - } - if (input.licenseType !== undefined) { - bodyParams["licenseType"] = input.licenseType; - } - if (input.numberOfRecentAmisToKeep !== undefined) { - bodyParams["numberOfRecentAmisToKeep"] = input.numberOfRecentAmisToKeep; - } - if (input.runOnce !== undefined) { - bodyParams["runOnce"] = input.runOnce; - } - if (input.seedTime !== undefined) { - bodyParams["seedTime"] = Math.round(input.seedTime.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartAppReplicationRequest = ( input: StartAppReplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1StartOnDemandReplicationRunRequest = ( input: StartOnDemandReplicationRunRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.replicationJobId !== undefined) { - bodyParams["replicationJobId"] = input.replicationJobId; - } - return bodyParams; + return { + ...(input.description !== undefined && { description: input.description }), + ...(input.replicationJobId !== undefined && { + replicationJobId: input.replicationJobId + }) + }; }; const serializeAws_json1_1StopAppReplicationRequest = ( input: StopAppReplicationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1Tags = ( @@ -4373,131 +4242,98 @@ const serializeAws_json1_1TerminateAppRequest = ( input: TerminateAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - return bodyParams; + return { + ...(input.appId !== undefined && { appId: input.appId }) + }; }; const serializeAws_json1_1UpdateAppRequest = ( input: UpdateAppRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.appId !== undefined) { - bodyParams["appId"] = input.appId; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.roleName !== undefined) { - bodyParams["roleName"] = input.roleName; - } - if (input.serverGroups !== undefined) { - bodyParams["serverGroups"] = serializeAws_json1_1ServerGroups( - input.serverGroups, - context - ); - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_1Tags(input.tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateReplicationJobRequest = ( input: UpdateReplicationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.encrypted !== undefined) { - bodyParams["encrypted"] = input.encrypted; - } - if (input.frequency !== undefined) { - bodyParams["frequency"] = input.frequency; - } - if (input.kmsKeyId !== undefined) { - bodyParams["kmsKeyId"] = input.kmsKeyId; - } - if (input.licenseType !== undefined) { - bodyParams["licenseType"] = input.licenseType; - } - if (input.nextReplicationRunStartTime !== undefined) { - bodyParams["nextReplicationRunStartTime"] = Math.round( - input.nextReplicationRunStartTime.getTime() / 1000 - ); - } - if (input.numberOfRecentAmisToKeep !== undefined) { - bodyParams["numberOfRecentAmisToKeep"] = input.numberOfRecentAmisToKeep; - } - if (input.replicationJobId !== undefined) { - bodyParams["replicationJobId"] = input.replicationJobId; - } - if (input.roleName !== undefined) { - bodyParams["roleName"] = input.roleName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UserData = ( input: UserData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.s3Location !== undefined) { - bodyParams["s3Location"] = serializeAws_json1_1S3Location( - input.s3Location, - context - ); - } - return bodyParams; + return { + ...(input.s3Location !== undefined && { + s3Location: serializeAws_json1_1S3Location(input.s3Location, context) + }) + }; }; const serializeAws_json1_1VmServer = ( input: VmServer, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.vmManagerName !== undefined) { - bodyParams["vmManagerName"] = input.vmManagerName; - } - if (input.vmManagerType !== undefined) { - bodyParams["vmManagerType"] = input.vmManagerType; - } - if (input.vmName !== undefined) { - bodyParams["vmName"] = input.vmName; - } - if (input.vmPath !== undefined) { - bodyParams["vmPath"] = input.vmPath; - } - if (input.vmServerAddress !== undefined) { - bodyParams["vmServerAddress"] = serializeAws_json1_1VmServerAddress( - input.vmServerAddress, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1VmServerAddress = ( input: VmServerAddress, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.vmId !== undefined) { - bodyParams["vmId"] = input.vmId; - } - if (input.vmManagerId !== undefined) { - bodyParams["vmManagerId"] = input.vmManagerId; - } - return bodyParams; + return { + ...(input.vmId !== undefined && { vmId: input.vmId }), + ...(input.vmManagerId !== undefined && { vmManagerId: input.vmManagerId }) + }; }; const serializeAws_json1_1VmServerAddressList = ( diff --git a/clients/client-snowball/protocols/Aws_json1_1.ts b/clients/client-snowball/protocols/Aws_json1_1.ts index 4fa4c2fe19b7..59744b6ab494 100644 --- a/clients/client-snowball/protocols/Aws_json1_1.ts +++ b/clients/client-snowball/protocols/Aws_json1_1.ts @@ -2027,238 +2027,172 @@ const serializeAws_json1_1Address = ( input: Address, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressId !== undefined) { - bodyParams["AddressId"] = input.AddressId; - } - if (input.City !== undefined) { - bodyParams["City"] = input.City; - } - if (input.Company !== undefined) { - bodyParams["Company"] = input.Company; - } - if (input.Country !== undefined) { - bodyParams["Country"] = input.Country; - } - if (input.IsRestricted !== undefined) { - bodyParams["IsRestricted"] = input.IsRestricted; - } - if (input.Landmark !== undefined) { - bodyParams["Landmark"] = input.Landmark; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PhoneNumber !== undefined) { - bodyParams["PhoneNumber"] = input.PhoneNumber; - } - if (input.PostalCode !== undefined) { - bodyParams["PostalCode"] = input.PostalCode; - } - if (input.PrefectureOrDistrict !== undefined) { - bodyParams["PrefectureOrDistrict"] = input.PrefectureOrDistrict; - } - if (input.StateOrProvince !== undefined) { - bodyParams["StateOrProvince"] = input.StateOrProvince; - } - if (input.Street1 !== undefined) { - bodyParams["Street1"] = input.Street1; - } - if (input.Street2 !== undefined) { - bodyParams["Street2"] = input.Street2; - } - if (input.Street3 !== undefined) { - bodyParams["Street3"] = input.Street3; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CancelClusterRequest = ( input: CancelClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }) + }; }; const serializeAws_json1_1CancelJobRequest = ( input: CancelJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1CreateAddressRequest = ( input: CreateAddressRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Address !== undefined) { - bodyParams["Address"] = serializeAws_json1_1Address(input.Address, context); - } - return bodyParams; + return { + ...(input.Address !== undefined && { + Address: serializeAws_json1_1Address(input.Address, context) + }) + }; }; const serializeAws_json1_1CreateClusterRequest = ( input: CreateClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressId !== undefined) { - bodyParams["AddressId"] = input.AddressId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ForwardingAddressId !== undefined) { - bodyParams["ForwardingAddressId"] = input.ForwardingAddressId; - } - if (input.JobType !== undefined) { - bodyParams["JobType"] = input.JobType; - } - if (input.KmsKeyARN !== undefined) { - bodyParams["KmsKeyARN"] = input.KmsKeyARN; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1JobResource( - input.Resources, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.ShippingOption !== undefined) { - bodyParams["ShippingOption"] = input.ShippingOption; - } - if (input.SnowballType !== undefined) { - bodyParams["SnowballType"] = input.SnowballType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateJobRequest = ( input: CreateJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressId !== undefined) { - bodyParams["AddressId"] = input.AddressId; - } - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ForwardingAddressId !== undefined) { - bodyParams["ForwardingAddressId"] = input.ForwardingAddressId; - } - if (input.JobType !== undefined) { - bodyParams["JobType"] = input.JobType; - } - if (input.KmsKeyARN !== undefined) { - bodyParams["KmsKeyARN"] = input.KmsKeyARN; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1JobResource( - input.Resources, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.ShippingOption !== undefined) { - bodyParams["ShippingOption"] = input.ShippingOption; - } - if (input.SnowballCapacityPreference !== undefined) { - bodyParams["SnowballCapacityPreference"] = input.SnowballCapacityPreference; - } - if (input.SnowballType !== undefined) { - bodyParams["SnowballType"] = input.SnowballType; - } - return bodyParams; + 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.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 + }) + }; }; const serializeAws_json1_1DescribeAddressRequest = ( input: DescribeAddressRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressId !== undefined) { - bodyParams["AddressId"] = input.AddressId; - } - return bodyParams; + return { + ...(input.AddressId !== undefined && { AddressId: input.AddressId }) + }; }; const serializeAws_json1_1DescribeAddressesRequest = ( input: DescribeAddressesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeClusterRequest = ( input: DescribeClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }) + }; }; const serializeAws_json1_1DescribeJobRequest = ( input: DescribeJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1Ec2AmiResource = ( input: Ec2AmiResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AmiId !== undefined) { - bodyParams["AmiId"] = input.AmiId; - } - if (input.SnowballAmiId !== undefined) { - bodyParams["SnowballAmiId"] = input.SnowballAmiId; - } - return bodyParams; + return { + ...(input.AmiId !== undefined && { AmiId: input.AmiId }), + ...(input.SnowballAmiId !== undefined && { + SnowballAmiId: input.SnowballAmiId + }) + }; }; const serializeAws_json1_1Ec2AmiResourceList = ( @@ -2272,11 +2206,11 @@ const serializeAws_json1_1EventTriggerDefinition = ( input: EventTriggerDefinition, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventResourceARN !== undefined) { - bodyParams["EventResourceARN"] = input.EventResourceARN; - } - return bodyParams; + return { + ...(input.EventResourceARN !== undefined && { + EventResourceARN: input.EventResourceARN + }) + }; }; const serializeAws_json1_1EventTriggerDefinitionList = ( @@ -2292,67 +2226,60 @@ const serializeAws_json1_1GetJobManifestRequest = ( input: GetJobManifestRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1GetJobUnlockCodeRequest = ( input: GetJobUnlockCodeRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1GetSnowballUsageRequest = ( input: GetSnowballUsageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetSoftwareUpdatesRequest = ( input: GetSoftwareUpdatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1JobResource = ( input: JobResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ec2AmiResources !== undefined) { - bodyParams["Ec2AmiResources"] = serializeAws_json1_1Ec2AmiResourceList( - input.Ec2AmiResources, - context - ); - } - if (input.LambdaResources !== undefined) { - bodyParams["LambdaResources"] = serializeAws_json1_1LambdaResourceList( - input.LambdaResources, - context - ); - } - if (input.S3Resources !== undefined) { - bodyParams["S3Resources"] = serializeAws_json1_1S3ResourceList( - input.S3Resources, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1JobStateList = ( @@ -2366,33 +2293,25 @@ const serializeAws_json1_1KeyRange = ( input: KeyRange, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BeginMarker !== undefined) { - bodyParams["BeginMarker"] = input.BeginMarker; - } - if (input.EndMarker !== undefined) { - bodyParams["EndMarker"] = input.EndMarker; - } - return bodyParams; + return { + ...(input.BeginMarker !== undefined && { BeginMarker: input.BeginMarker }), + ...(input.EndMarker !== undefined && { EndMarker: input.EndMarker }) + }; }; const serializeAws_json1_1LambdaResource = ( input: LambdaResource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EventTriggers !== undefined) { - bodyParams[ - "EventTriggers" - ] = serializeAws_json1_1EventTriggerDefinitionList( - input.EventTriggers, - context - ); - } - if (input.LambdaArn !== undefined) { - bodyParams["LambdaArn"] = input.LambdaArn; - } - return bodyParams; + return { + ...(input.EventTriggers !== undefined && { + EventTriggers: serializeAws_json1_1EventTriggerDefinitionList( + input.EventTriggers, + context + ) + }), + ...(input.LambdaArn !== undefined && { LambdaArn: input.LambdaArn }) + }; }; const serializeAws_json1_1LambdaResourceList = ( @@ -2406,96 +2325,69 @@ const serializeAws_json1_1ListClusterJobsRequest = ( input: ListClusterJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ClusterId !== undefined && { ClusterId: input.ClusterId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListClustersRequest = ( input: ListClustersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListCompatibleImagesRequest = ( input: ListCompatibleImagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListJobsRequest = ( input: ListJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1Notification = ( input: Notification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobStatesToNotify !== undefined) { - bodyParams["JobStatesToNotify"] = serializeAws_json1_1JobStateList( - input.JobStatesToNotify, - context - ); - } - if (input.NotifyAll !== undefined) { - bodyParams["NotifyAll"] = input.NotifyAll; - } - if (input.SnsTopicARN !== undefined) { - bodyParams["SnsTopicARN"] = input.SnsTopicARN; - } - return bodyParams; + return { + ...(input.JobStatesToNotify !== undefined && { + JobStatesToNotify: serializeAws_json1_1JobStateList( + input.JobStatesToNotify, + context + ) + }), + ...(input.NotifyAll !== undefined && { NotifyAll: input.NotifyAll }), + ...(input.SnsTopicARN !== undefined && { SnsTopicARN: input.SnsTopicARN }) + }; }; const serializeAws_json1_1S3Resource = ( input: S3Resource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BucketArn !== undefined) { - bodyParams["BucketArn"] = input.BucketArn; - } - if (input.KeyRange !== undefined) { - bodyParams["KeyRange"] = serializeAws_json1_1KeyRange( - input.KeyRange, - context - ); - } - return bodyParams; + return { + ...(input.BucketArn !== undefined && { BucketArn: input.BucketArn }), + ...(input.KeyRange !== undefined && { + KeyRange: serializeAws_json1_1KeyRange(input.KeyRange, context) + }) + }; }; const serializeAws_json1_1S3ResourceList = ( @@ -2509,79 +2401,57 @@ const serializeAws_json1_1UpdateClusterRequest = ( input: UpdateClusterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressId !== undefined) { - bodyParams["AddressId"] = input.AddressId; - } - if (input.ClusterId !== undefined) { - bodyParams["ClusterId"] = input.ClusterId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ForwardingAddressId !== undefined) { - bodyParams["ForwardingAddressId"] = input.ForwardingAddressId; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1JobResource( - input.Resources, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.ShippingOption !== undefined) { - bodyParams["ShippingOption"] = input.ShippingOption; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateJobRequest = ( input: UpdateJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressId !== undefined) { - bodyParams["AddressId"] = input.AddressId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ForwardingAddressId !== undefined) { - bodyParams["ForwardingAddressId"] = input.ForwardingAddressId; - } - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.Notification !== undefined) { - bodyParams["Notification"] = serializeAws_json1_1Notification( - input.Notification, - context - ); - } - if (input.Resources !== undefined) { - bodyParams["Resources"] = serializeAws_json1_1JobResource( - input.Resources, - context - ); - } - if (input.RoleARN !== undefined) { - bodyParams["RoleARN"] = input.RoleARN; - } - if (input.ShippingOption !== undefined) { - bodyParams["ShippingOption"] = input.ShippingOption; - } - if (input.SnowballCapacityPreference !== undefined) { - bodyParams["SnowballCapacityPreference"] = input.SnowballCapacityPreference; - } - return bodyParams; + 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 + }) + }; }; const deserializeAws_json1_1Address = ( diff --git a/clients/client-ssm/protocols/Aws_json1_1.ts b/clients/client-ssm/protocols/Aws_json1_1.ts index bdf5cc9ab892..75bce4d020f0 100644 --- a/clients/client-ssm/protocols/Aws_json1_1.ts +++ b/clients/client-ssm/protocols/Aws_json1_1.ts @@ -16138,34 +16138,26 @@ const serializeAws_json1_1AddTagsToResourceRequest = ( input: AddTagsToResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1AssociationExecutionFilter = ( input: AssociationExecutionFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1AssociationExecutionFilterList = ( @@ -16181,14 +16173,10 @@ const serializeAws_json1_1AssociationExecutionTargetsFilter = ( input: AssociationExecutionTargetsFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1AssociationExecutionTargetsFilterList = ( @@ -16204,14 +16192,10 @@ const serializeAws_json1_1AssociationFilter = ( input: AssociationFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1AssociationFilterList = ( @@ -16234,40 +16218,29 @@ const serializeAws_json1_1AssociationStatus = ( input: AssociationStatus, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdditionalInfo !== undefined) { - bodyParams["AdditionalInfo"] = input.AdditionalInfo; - } - if (input.Date !== undefined) { - bodyParams["Date"] = Math.round(input.Date.getTime() / 1000); - } - if (input.Message !== undefined) { - bodyParams["Message"] = input.Message; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1AttachmentsSource = ( input: AttachmentsSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1AttachmentsSourceValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1AttachmentsSourceValues(input.Values, context) + }) + }; }; const serializeAws_json1_1AttachmentsSourceList = ( @@ -16290,19 +16263,15 @@ const serializeAws_json1_1AutomationExecutionFilter = ( input: AutomationExecutionFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams[ - "Values" - ] = serializeAws_json1_1AutomationExecutionFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1AutomationExecutionFilterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1AutomationExecutionFilterList = ( @@ -16352,56 +16321,50 @@ const serializeAws_json1_1CancelCommandRequest = ( input: CancelCommandRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommandId !== undefined) { - bodyParams["CommandId"] = input.CommandId; - } - if (input.InstanceIds !== undefined) { - bodyParams["InstanceIds"] = serializeAws_json1_1InstanceIdList( - input.InstanceIds, - context - ); - } - return bodyParams; + return { + ...(input.CommandId !== undefined && { CommandId: input.CommandId }), + ...(input.InstanceIds !== undefined && { + InstanceIds: serializeAws_json1_1InstanceIdList( + input.InstanceIds, + context + ) + }) + }; }; const serializeAws_json1_1CancelMaintenanceWindowExecutionRequest = ( input: CancelMaintenanceWindowExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WindowExecutionId !== undefined) { - bodyParams["WindowExecutionId"] = input.WindowExecutionId; - } - return bodyParams; + return { + ...(input.WindowExecutionId !== undefined && { + WindowExecutionId: input.WindowExecutionId + }) + }; }; const serializeAws_json1_1CloudWatchOutputConfig = ( input: CloudWatchOutputConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogGroupName !== undefined) { - bodyParams["CloudWatchLogGroupName"] = input.CloudWatchLogGroupName; - } - if (input.CloudWatchOutputEnabled !== undefined) { - bodyParams["CloudWatchOutputEnabled"] = input.CloudWatchOutputEnabled; - } - return bodyParams; + return { + ...(input.CloudWatchLogGroupName !== undefined && { + CloudWatchLogGroupName: input.CloudWatchLogGroupName + }), + ...(input.CloudWatchOutputEnabled !== undefined && { + CloudWatchOutputEnabled: input.CloudWatchOutputEnabled + }) + }; }; const serializeAws_json1_1CommandFilter = ( input: CommandFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1CommandFilterList = ( @@ -16415,19 +16378,15 @@ const serializeAws_json1_1ComplianceExecutionSummary = ( input: ComplianceExecutionSummary, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExecutionId !== undefined) { - bodyParams["ExecutionId"] = input.ExecutionId; - } - if (input.ExecutionTime !== undefined) { - bodyParams["ExecutionTime"] = Math.round( - input.ExecutionTime.getTime() / 1000 - ); - } - if (input.ExecutionType !== undefined) { - bodyParams["ExecutionType"] = input.ExecutionType; - } - return bodyParams; + return { + ...(input.ExecutionId !== undefined && { ExecutionId: input.ExecutionId }), + ...(input.ExecutionTime !== undefined && { + ExecutionTime: Math.round(input.ExecutionTime.getTime() / 1000) + }), + ...(input.ExecutionType !== undefined && { + ExecutionType: input.ExecutionType + }) + }; }; const serializeAws_json1_1ComplianceItemDetails = ( @@ -16444,26 +16403,15 @@ const serializeAws_json1_1ComplianceItemEntry = ( input: ComplianceItemEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Details !== undefined) { - bodyParams["Details"] = serializeAws_json1_1ComplianceItemDetails( - input.Details, - context - ); - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Severity !== undefined) { - bodyParams["Severity"] = input.Severity; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ComplianceItemEntryList = ( @@ -16493,20 +16441,16 @@ const serializeAws_json1_1ComplianceStringFilter = ( input: ComplianceStringFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ComplianceStringFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1ComplianceStringFilterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1ComplianceStringFilterList = ( @@ -16529,44 +16473,36 @@ const serializeAws_json1_1CreateActivationRequest = ( input: CreateActivationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultInstanceName !== undefined) { - bodyParams["DefaultInstanceName"] = input.DefaultInstanceName; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.ExpirationDate !== undefined) { - bodyParams["ExpirationDate"] = Math.round( - input.ExpirationDate.getTime() / 1000 - ); - } - if (input.IamRole !== undefined) { - bodyParams["IamRole"] = input.IamRole; - } - if (input.RegistrationLimit !== undefined) { - bodyParams["RegistrationLimit"] = input.RegistrationLimit; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateAssociationBatchRequest = ( input: CreateAssociationBatchRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Entries !== undefined) { - bodyParams[ - "Entries" - ] = serializeAws_json1_1CreateAssociationBatchRequestEntries( - input.Entries, - context - ); - } - return bodyParams; + return { + ...(input.Entries !== undefined && { + Entries: serializeAws_json1_1CreateAssociationBatchRequestEntries( + input.Entries, + context + ) + }) + }; }; const serializeAws_json1_1CreateAssociationBatchRequestEntries = ( @@ -16582,538 +16518,406 @@ const serializeAws_json1_1CreateAssociationBatchRequestEntry = ( input: CreateAssociationBatchRequestEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationName !== undefined) { - bodyParams["AssociationName"] = input.AssociationName; - } - if (input.AutomationTargetParameterName !== undefined) { - bodyParams["AutomationTargetParameterName"] = - input.AutomationTargetParameterName; - } - if (input.ComplianceSeverity !== undefined) { - bodyParams["ComplianceSeverity"] = input.ComplianceSeverity; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OutputLocation !== undefined) { - bodyParams[ - "OutputLocation" - ] = serializeAws_json1_1InstanceAssociationOutputLocation( - input.OutputLocation, - context - ); - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1Parameters( - input.Parameters, - context - ); - } - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - return bodyParams; + return { + ...(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.Targets !== undefined && { + Targets: serializeAws_json1_1Targets(input.Targets, context) + }) + }; }; const serializeAws_json1_1CreateAssociationRequest = ( input: CreateAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationName !== undefined) { - bodyParams["AssociationName"] = input.AssociationName; - } - if (input.AutomationTargetParameterName !== undefined) { - bodyParams["AutomationTargetParameterName"] = - input.AutomationTargetParameterName; - } - if (input.ComplianceSeverity !== undefined) { - bodyParams["ComplianceSeverity"] = input.ComplianceSeverity; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OutputLocation !== undefined) { - bodyParams[ - "OutputLocation" - ] = serializeAws_json1_1InstanceAssociationOutputLocation( - input.OutputLocation, - context - ); - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1Parameters( - input.Parameters, - context - ); - } - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - return bodyParams; + return { + ...(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.Targets !== undefined && { + Targets: serializeAws_json1_1Targets(input.Targets, context) + }) + }; }; const serializeAws_json1_1CreateDocumentRequest = ( input: CreateDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attachments !== undefined) { - bodyParams["Attachments"] = serializeAws_json1_1AttachmentsSourceList( - input.Attachments, - context - ); - } - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - if (input.DocumentFormat !== undefined) { - bodyParams["DocumentFormat"] = input.DocumentFormat; - } - if (input.DocumentType !== undefined) { - bodyParams["DocumentType"] = input.DocumentType; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Requires !== undefined) { - bodyParams["Requires"] = serializeAws_json1_1DocumentRequiresList( - input.Requires, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TargetType !== undefined) { - bodyParams["TargetType"] = input.TargetType; - } - if (input.VersionName !== undefined) { - bodyParams["VersionName"] = input.VersionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreateMaintenanceWindowRequest = ( input: CreateMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowUnassociatedTargets !== undefined) { - bodyParams["AllowUnassociatedTargets"] = input.AllowUnassociatedTargets; - } - if (input.ClientToken === undefined) { - input.ClientToken = generateIdempotencyToken(); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.Cutoff !== undefined) { - bodyParams["Cutoff"] = input.Cutoff; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.EndDate !== undefined) { - bodyParams["EndDate"] = input.EndDate; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.ScheduleTimezone !== undefined) { - bodyParams["ScheduleTimezone"] = input.ScheduleTimezone; - } - if (input.StartDate !== undefined) { - bodyParams["StartDate"] = input.StartDate; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.AllowUnassociatedTargets !== undefined && { + 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.ScheduleTimezone !== undefined && { + ScheduleTimezone: input.ScheduleTimezone + }), + ...(input.StartDate !== undefined && { StartDate: input.StartDate }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateOpsItemRequest = ( input: CreateOpsItemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Category !== undefined) { - bodyParams["Category"] = input.Category; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Notifications !== undefined) { - bodyParams["Notifications"] = serializeAws_json1_1OpsItemNotifications( - input.Notifications, - context - ); - } - if (input.OperationalData !== undefined) { - bodyParams["OperationalData"] = serializeAws_json1_1OpsItemOperationalData( - input.OperationalData, - context - ); - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.RelatedOpsItems !== undefined) { - bodyParams["RelatedOpsItems"] = serializeAws_json1_1RelatedOpsItems( - input.RelatedOpsItems, - context - ); - } - if (input.Severity !== undefined) { - bodyParams["Severity"] = input.Severity; - } - if (input.Source !== undefined) { - bodyParams["Source"] = input.Source; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CreatePatchBaselineRequest = ( input: CreatePatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApprovalRules !== undefined) { - bodyParams["ApprovalRules"] = serializeAws_json1_1PatchRuleGroup( - input.ApprovalRules, - context - ); - } - if (input.ApprovedPatches !== undefined) { - bodyParams["ApprovedPatches"] = serializeAws_json1_1PatchIdList( - input.ApprovedPatches, - context - ); - } - if (input.ApprovedPatchesComplianceLevel !== undefined) { - bodyParams["ApprovedPatchesComplianceLevel"] = - input.ApprovedPatchesComplianceLevel; - } - if (input.ApprovedPatchesEnableNonSecurity !== undefined) { - bodyParams["ApprovedPatchesEnableNonSecurity"] = - input.ApprovedPatchesEnableNonSecurity; - } - if (input.ClientToken === undefined) { - input.ClientToken = generateIdempotencyToken(); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GlobalFilters !== undefined) { - bodyParams["GlobalFilters"] = serializeAws_json1_1PatchFilterGroup( - input.GlobalFilters, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OperatingSystem !== undefined) { - bodyParams["OperatingSystem"] = input.OperatingSystem; - } - if (input.RejectedPatches !== undefined) { - bodyParams["RejectedPatches"] = serializeAws_json1_1PatchIdList( - input.RejectedPatches, - context - ); - } - if (input.RejectedPatchesAction !== undefined) { - bodyParams["RejectedPatchesAction"] = input.RejectedPatchesAction; - } - if (input.Sources !== undefined) { - bodyParams["Sources"] = serializeAws_json1_1PatchSourceList( - input.Sources, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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 + }), + 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) + }) + }; }; const serializeAws_json1_1CreateResourceDataSyncRequest = ( input: CreateResourceDataSyncRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Destination !== undefined) { - bodyParams[ - "S3Destination" - ] = serializeAws_json1_1ResourceDataSyncS3Destination( - input.S3Destination, - context - ); - } - if (input.SyncName !== undefined) { - bodyParams["SyncName"] = input.SyncName; - } - if (input.SyncSource !== undefined) { - bodyParams["SyncSource"] = serializeAws_json1_1ResourceDataSyncSource( - input.SyncSource, - context - ); - } - if (input.SyncType !== undefined) { - bodyParams["SyncType"] = input.SyncType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteActivationRequest = ( input: DeleteActivationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActivationId !== undefined) { - bodyParams["ActivationId"] = input.ActivationId; - } - return bodyParams; + return { + ...(input.ActivationId !== undefined && { + ActivationId: input.ActivationId + }) + }; }; const serializeAws_json1_1DeleteAssociationRequest = ( input: DeleteAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationId !== undefined) { - bodyParams["AssociationId"] = input.AssociationId; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.AssociationId !== undefined && { + AssociationId: input.AssociationId + }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteDocumentRequest = ( input: DeleteDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.Force !== undefined) { - bodyParams["Force"] = input.Force; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.VersionName !== undefined) { - bodyParams["VersionName"] = input.VersionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteInventoryRequest = ( input: DeleteInventoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken === undefined) { - input.ClientToken = generateIdempotencyToken(); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.DryRun !== undefined) { - bodyParams["DryRun"] = input.DryRun; - } - if (input.SchemaDeleteOption !== undefined) { - bodyParams["SchemaDeleteOption"] = input.SchemaDeleteOption; - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + return { + ClientToken: input.ClientToken ?? generateIdempotencyToken(), + ...(input.DryRun !== undefined && { DryRun: input.DryRun }), + ...(input.SchemaDeleteOption !== undefined && { + SchemaDeleteOption: input.SchemaDeleteOption + }), + ...(input.TypeName !== undefined && { TypeName: input.TypeName }) + }; }; const serializeAws_json1_1DeleteMaintenanceWindowRequest = ( input: DeleteMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + return { + ...(input.WindowId !== undefined && { WindowId: input.WindowId }) + }; }; const serializeAws_json1_1DeleteParameterRequest = ( input: DeleteParameterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteParametersRequest = ( input: DeleteParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1ParameterNameList( - input.Names, - context - ); - } - return bodyParams; + return { + ...(input.Names !== undefined && { + Names: serializeAws_json1_1ParameterNameList(input.Names, context) + }) + }; }; const serializeAws_json1_1DeletePatchBaselineRequest = ( input: DeletePatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - return bodyParams; + return { + ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }) + }; }; const serializeAws_json1_1DeleteResourceDataSyncRequest = ( input: DeleteResourceDataSyncRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SyncName !== undefined) { - bodyParams["SyncName"] = input.SyncName; - } - if (input.SyncType !== undefined) { - bodyParams["SyncType"] = input.SyncType; - } - return bodyParams; + return { + ...(input.SyncName !== undefined && { SyncName: input.SyncName }), + ...(input.SyncType !== undefined && { SyncType: input.SyncType }) + }; }; const serializeAws_json1_1DeregisterManagedInstanceRequest = ( input: DeregisterManagedInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1DeregisterPatchBaselineForPatchGroupRequest = ( input: DeregisterPatchBaselineForPatchGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - if (input.PatchGroup !== undefined) { - bodyParams["PatchGroup"] = input.PatchGroup; - } - return bodyParams; + return { + ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), + ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }) + }; }; const serializeAws_json1_1DeregisterTargetFromMaintenanceWindowRequest = ( input: DeregisterTargetFromMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Safe !== undefined) { - bodyParams["Safe"] = input.Safe; - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - if (input.WindowTargetId !== undefined) { - bodyParams["WindowTargetId"] = input.WindowTargetId; - } - return bodyParams; + return { + ...(input.Safe !== undefined && { Safe: input.Safe }), + ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.WindowTargetId !== undefined && { + WindowTargetId: input.WindowTargetId + }) + }; }; const serializeAws_json1_1DeregisterTaskFromMaintenanceWindowRequest = ( input: DeregisterTaskFromMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - if (input.WindowTaskId !== undefined) { - bodyParams["WindowTaskId"] = input.WindowTaskId; - } - return bodyParams; + return { + ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.WindowTaskId !== undefined && { + WindowTaskId: input.WindowTaskId + }) + }; }; const serializeAws_json1_1DescribeActivationsFilter = ( input: DescribeActivationsFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FilterKey !== undefined) { - bodyParams["FilterKey"] = input.FilterKey; - } - if (input.FilterValues !== undefined) { - bodyParams["FilterValues"] = serializeAws_json1_1StringList( - input.FilterValues, - context - ); - } - return bodyParams; + return { + ...(input.FilterKey !== undefined && { FilterKey: input.FilterKey }), + ...(input.FilterValues !== undefined && { + FilterValues: serializeAws_json1_1StringList(input.FilterValues, context) + }) + }; }; const serializeAws_json1_1DescribeActivationsFilterList = ( @@ -17129,698 +16933,526 @@ const serializeAws_json1_1DescribeActivationsRequest = ( input: DescribeActivationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1DescribeActivationsFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1DescribeActivationsFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeAssociationExecutionTargetsRequest = ( input: DescribeAssociationExecutionTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationId !== undefined) { - bodyParams["AssociationId"] = input.AssociationId; - } - if (input.ExecutionId !== undefined) { - bodyParams["ExecutionId"] = input.ExecutionId; - } - if (input.Filters !== undefined) { - bodyParams[ - "Filters" - ] = serializeAws_json1_1AssociationExecutionTargetsFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeAssociationExecutionsRequest = ( input: DescribeAssociationExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationId !== undefined) { - bodyParams["AssociationId"] = input.AssociationId; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1AssociationExecutionFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeAssociationRequest = ( input: DescribeAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationId !== undefined) { - bodyParams["AssociationId"] = input.AssociationId; - } - if (input.AssociationVersion !== undefined) { - bodyParams["AssociationVersion"] = input.AssociationVersion; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeAutomationExecutionsRequest = ( input: DescribeAutomationExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1AutomationExecutionFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1AutomationExecutionFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeAutomationStepExecutionsRequest = ( input: DescribeAutomationStepExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomationExecutionId !== undefined) { - bodyParams["AutomationExecutionId"] = input.AutomationExecutionId; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1StepExecutionFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ReverseOrder !== undefined) { - bodyParams["ReverseOrder"] = input.ReverseOrder; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeAvailablePatchesRequest = ( input: DescribeAvailablePatchesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1PatchOrchestratorFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1PatchOrchestratorFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeDocumentPermissionRequest = ( input: DescribeDocumentPermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PermissionType !== undefined) { - bodyParams["PermissionType"] = input.PermissionType; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.PermissionType !== undefined && { + PermissionType: input.PermissionType + }) + }; }; const serializeAws_json1_1DescribeDocumentRequest = ( input: DescribeDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.VersionName !== undefined) { - bodyParams["VersionName"] = input.VersionName; - } - return bodyParams; + return { + ...(input.DocumentVersion !== undefined && { + DocumentVersion: input.DocumentVersion + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.VersionName !== undefined && { VersionName: input.VersionName }) + }; }; const serializeAws_json1_1DescribeEffectiveInstanceAssociationsRequest = ( input: DescribeEffectiveInstanceAssociationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeEffectivePatchesForPatchBaselineRequest = ( input: DescribeEffectivePatchesForPatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeInstanceAssociationsStatusRequest = ( input: DescribeInstanceAssociationsStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeInstanceInformationRequest = ( input: DescribeInstanceInformationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams[ - "Filters" - ] = serializeAws_json1_1InstanceInformationStringFilterList( - input.Filters, - context - ); - } - if (input.InstanceInformationFilterList !== undefined) { - bodyParams[ - "InstanceInformationFilterList" - ] = serializeAws_json1_1InstanceInformationFilterList( - input.InstanceInformationFilterList, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeInstancePatchStatesForPatchGroupRequest = ( input: DescribeInstancePatchStatesForPatchGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1InstancePatchStateFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.PatchGroup !== undefined) { - bodyParams["PatchGroup"] = input.PatchGroup; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeInstancePatchStatesRequest = ( input: DescribeInstancePatchStatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceIds !== undefined) { - bodyParams["InstanceIds"] = serializeAws_json1_1InstanceIdList( - input.InstanceIds, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.InstanceIds !== undefined && { + InstanceIds: serializeAws_json1_1InstanceIdList( + input.InstanceIds, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeInstancePatchesRequest = ( input: DescribeInstancePatchesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1PatchOrchestratorFilterList( - input.Filters, - context - ); - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeInventoryDeletionsRequest = ( input: DescribeInventoryDeletionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeletionId !== undefined) { - bodyParams["DeletionId"] = input.DeletionId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DeletionId !== undefined && { DeletionId: input.DeletionId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowExecutionTaskInvocationsRequest = ( input: DescribeMaintenanceWindowExecutionTaskInvocationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1MaintenanceWindowFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TaskId !== undefined) { - bodyParams["TaskId"] = input.TaskId; - } - if (input.WindowExecutionId !== undefined) { - bodyParams["WindowExecutionId"] = input.WindowExecutionId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowExecutionTasksRequest = ( input: DescribeMaintenanceWindowExecutionTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1MaintenanceWindowFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WindowExecutionId !== undefined) { - bodyParams["WindowExecutionId"] = input.WindowExecutionId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowExecutionsRequest = ( input: DescribeMaintenanceWindowExecutionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1MaintenanceWindowFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowScheduleRequest = ( input: DescribeMaintenanceWindowScheduleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1PatchOrchestratorFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowTargetsRequest = ( input: DescribeMaintenanceWindowTargetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1MaintenanceWindowFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowTasksRequest = ( input: DescribeMaintenanceWindowTasksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1MaintenanceWindowFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowsForTargetRequest = ( input: DescribeMaintenanceWindowsForTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeMaintenanceWindowsRequest = ( input: DescribeMaintenanceWindowsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1MaintenanceWindowFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1MaintenanceWindowFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeOpsItemsRequest = ( input: DescribeOpsItemsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OpsItemFilters !== undefined) { - bodyParams["OpsItemFilters"] = serializeAws_json1_1OpsItemFilters( - input.OpsItemFilters, - context - ); - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OpsItemFilters !== undefined && { + OpsItemFilters: serializeAws_json1_1OpsItemFilters( + input.OpsItemFilters, + context + ) + }) + }; }; const serializeAws_json1_1DescribeParametersRequest = ( input: DescribeParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ParametersFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParameterFilters !== undefined) { - bodyParams[ - "ParameterFilters" - ] = serializeAws_json1_1ParameterStringFilterList( - input.ParameterFilters, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DescribePatchBaselinesRequest = ( input: DescribePatchBaselinesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1PatchOrchestratorFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1PatchOrchestratorFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribePatchGroupStateRequest = ( input: DescribePatchGroupStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PatchGroup !== undefined) { - bodyParams["PatchGroup"] = input.PatchGroup; - } - return bodyParams; + return { + ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }) + }; }; const serializeAws_json1_1DescribePatchGroupsRequest = ( input: DescribePatchGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1PatchOrchestratorFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1PatchOrchestratorFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribePatchPropertiesRequest = ( input: DescribePatchPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OperatingSystem !== undefined) { - bodyParams["OperatingSystem"] = input.OperatingSystem; - } - if (input.PatchSet !== undefined) { - bodyParams["PatchSet"] = input.PatchSet; - } - if (input.Property !== undefined) { - bodyParams["Property"] = input.Property; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeSessionsRequest = ( input: DescribeSessionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1SessionFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.State !== undefined) { - bodyParams["State"] = input.State; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DocumentFilter = ( input: DocumentFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1DocumentFilterList = ( @@ -17834,17 +17466,15 @@ const serializeAws_json1_1DocumentKeyValuesFilter = ( input: DocumentKeyValuesFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1DocumentKeyValuesFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1DocumentKeyValuesFilterValues( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1DocumentKeyValuesFilterList = ( @@ -17867,14 +17497,10 @@ const serializeAws_json1_1DocumentRequires = ( input: DocumentRequires, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1DocumentRequiresList = ( @@ -17890,401 +17516,320 @@ const serializeAws_json1_1GetAutomationExecutionRequest = ( input: GetAutomationExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomationExecutionId !== undefined) { - bodyParams["AutomationExecutionId"] = input.AutomationExecutionId; - } - return bodyParams; + return { + ...(input.AutomationExecutionId !== undefined && { + AutomationExecutionId: input.AutomationExecutionId + }) + }; }; const serializeAws_json1_1GetCalendarStateRequest = ( input: GetCalendarStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AtTime !== undefined) { - bodyParams["AtTime"] = input.AtTime; - } - if (input.CalendarNames !== undefined) { - bodyParams["CalendarNames"] = serializeAws_json1_1CalendarNameOrARNList( - input.CalendarNames, - context - ); - } - return bodyParams; + return { + ...(input.AtTime !== undefined && { AtTime: input.AtTime }), + ...(input.CalendarNames !== undefined && { + CalendarNames: serializeAws_json1_1CalendarNameOrARNList( + input.CalendarNames, + context + ) + }) + }; }; const serializeAws_json1_1GetCommandInvocationRequest = ( input: GetCommandInvocationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommandId !== undefined) { - bodyParams["CommandId"] = input.CommandId; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.PluginName !== undefined) { - bodyParams["PluginName"] = input.PluginName; - } - return bodyParams; + return { + ...(input.CommandId !== undefined && { CommandId: input.CommandId }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.PluginName !== undefined && { PluginName: input.PluginName }) + }; }; const serializeAws_json1_1GetConnectionStatusRequest = ( input: GetConnectionStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Target !== undefined) { - bodyParams["Target"] = input.Target; - } - return bodyParams; + return { + ...(input.Target !== undefined && { Target: input.Target }) + }; }; const serializeAws_json1_1GetDefaultPatchBaselineRequest = ( input: GetDefaultPatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OperatingSystem !== undefined) { - bodyParams["OperatingSystem"] = input.OperatingSystem; - } - return bodyParams; + return { + ...(input.OperatingSystem !== undefined && { + OperatingSystem: input.OperatingSystem + }) + }; }; const serializeAws_json1_1GetDeployablePatchSnapshotForInstanceRequest = ( input: GetDeployablePatchSnapshotForInstanceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.SnapshotId !== undefined) { - bodyParams["SnapshotId"] = input.SnapshotId; - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.SnapshotId !== undefined && { SnapshotId: input.SnapshotId }) + }; }; const serializeAws_json1_1GetDocumentRequest = ( input: GetDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentFormat !== undefined) { - bodyParams["DocumentFormat"] = input.DocumentFormat; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.VersionName !== undefined) { - bodyParams["VersionName"] = input.VersionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetInventoryRequest = ( input: GetInventoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Aggregators !== undefined) { - bodyParams["Aggregators"] = serializeAws_json1_1InventoryAggregatorList( - input.Aggregators, - context - ); - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1InventoryFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResultAttributes !== undefined) { - bodyParams["ResultAttributes"] = serializeAws_json1_1ResultAttributeList( - input.ResultAttributes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1GetInventorySchemaRequest = ( input: GetInventorySchemaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Aggregator !== undefined) { - bodyParams["Aggregator"] = input.Aggregator; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SubType !== undefined) { - bodyParams["SubType"] = input.SubType; - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetMaintenanceWindowExecutionRequest = ( input: GetMaintenanceWindowExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WindowExecutionId !== undefined) { - bodyParams["WindowExecutionId"] = input.WindowExecutionId; - } - return bodyParams; + return { + ...(input.WindowExecutionId !== undefined && { + WindowExecutionId: input.WindowExecutionId + }) + }; }; const serializeAws_json1_1GetMaintenanceWindowExecutionTaskInvocationRequest = ( input: GetMaintenanceWindowExecutionTaskInvocationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InvocationId !== undefined) { - bodyParams["InvocationId"] = input.InvocationId; - } - if (input.TaskId !== undefined) { - bodyParams["TaskId"] = input.TaskId; - } - if (input.WindowExecutionId !== undefined) { - bodyParams["WindowExecutionId"] = input.WindowExecutionId; - } - return bodyParams; + return { + ...(input.InvocationId !== undefined && { + InvocationId: input.InvocationId + }), + ...(input.TaskId !== undefined && { TaskId: input.TaskId }), + ...(input.WindowExecutionId !== undefined && { + WindowExecutionId: input.WindowExecutionId + }) + }; }; const serializeAws_json1_1GetMaintenanceWindowExecutionTaskRequest = ( input: GetMaintenanceWindowExecutionTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TaskId !== undefined) { - bodyParams["TaskId"] = input.TaskId; - } - if (input.WindowExecutionId !== undefined) { - bodyParams["WindowExecutionId"] = input.WindowExecutionId; - } - return bodyParams; + return { + ...(input.TaskId !== undefined && { TaskId: input.TaskId }), + ...(input.WindowExecutionId !== undefined && { + WindowExecutionId: input.WindowExecutionId + }) + }; }; const serializeAws_json1_1GetMaintenanceWindowRequest = ( input: GetMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + return { + ...(input.WindowId !== undefined && { WindowId: input.WindowId }) + }; }; const serializeAws_json1_1GetMaintenanceWindowTaskRequest = ( input: GetMaintenanceWindowTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - if (input.WindowTaskId !== undefined) { - bodyParams["WindowTaskId"] = input.WindowTaskId; - } - return bodyParams; + return { + ...(input.WindowId !== undefined && { WindowId: input.WindowId }), + ...(input.WindowTaskId !== undefined && { + WindowTaskId: input.WindowTaskId + }) + }; }; const serializeAws_json1_1GetOpsItemRequest = ( input: GetOpsItemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OpsItemId !== undefined) { - bodyParams["OpsItemId"] = input.OpsItemId; - } - return bodyParams; + return { + ...(input.OpsItemId !== undefined && { OpsItemId: input.OpsItemId }) + }; }; const serializeAws_json1_1GetOpsSummaryRequest = ( input: GetOpsSummaryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Aggregators !== undefined) { - bodyParams["Aggregators"] = serializeAws_json1_1OpsAggregatorList( - input.Aggregators, - context - ); - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1OpsFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResultAttributes !== undefined) { - bodyParams["ResultAttributes"] = serializeAws_json1_1OpsResultAttributeList( - input.ResultAttributes, - context - ); - } - if (input.SyncName !== undefined) { - bodyParams["SyncName"] = input.SyncName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetParameterHistoryRequest = ( input: GetParameterHistoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WithDecryption !== undefined) { - bodyParams["WithDecryption"] = input.WithDecryption; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetParameterRequest = ( input: GetParameterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.WithDecryption !== undefined) { - bodyParams["WithDecryption"] = input.WithDecryption; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.WithDecryption !== undefined && { + WithDecryption: input.WithDecryption + }) + }; }; const serializeAws_json1_1GetParametersByPathRequest = ( input: GetParametersByPathRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ParameterFilters !== undefined) { - bodyParams[ - "ParameterFilters" - ] = serializeAws_json1_1ParameterStringFilterList( - input.ParameterFilters, - context - ); - } - if (input.Path !== undefined) { - bodyParams["Path"] = input.Path; - } - if (input.Recursive !== undefined) { - bodyParams["Recursive"] = input.Recursive; - } - if (input.WithDecryption !== undefined) { - bodyParams["WithDecryption"] = input.WithDecryption; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1GetParametersRequest = ( input: GetParametersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Names !== undefined) { - bodyParams["Names"] = serializeAws_json1_1ParameterNameList( - input.Names, - context - ); - } - if (input.WithDecryption !== undefined) { - bodyParams["WithDecryption"] = input.WithDecryption; - } - return bodyParams; + return { + ...(input.Names !== undefined && { + Names: serializeAws_json1_1ParameterNameList(input.Names, context) + }), + ...(input.WithDecryption !== undefined && { + WithDecryption: input.WithDecryption + }) + }; }; const serializeAws_json1_1GetPatchBaselineForPatchGroupRequest = ( input: GetPatchBaselineForPatchGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OperatingSystem !== undefined) { - bodyParams["OperatingSystem"] = input.OperatingSystem; - } - if (input.PatchGroup !== undefined) { - bodyParams["PatchGroup"] = input.PatchGroup; - } - return bodyParams; + return { + ...(input.OperatingSystem !== undefined && { + OperatingSystem: input.OperatingSystem + }), + ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }) + }; }; const serializeAws_json1_1GetPatchBaselineRequest = ( input: GetPatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - return bodyParams; + return { + ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }) + }; }; const serializeAws_json1_1GetServiceSettingRequest = ( input: GetServiceSettingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SettingId !== undefined) { - bodyParams["SettingId"] = input.SettingId; - } - return bodyParams; + return { + ...(input.SettingId !== undefined && { SettingId: input.SettingId }) + }; }; const serializeAws_json1_1InstanceAssociationOutputLocation = ( input: InstanceAssociationOutputLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Location !== undefined) { - bodyParams["S3Location"] = serializeAws_json1_1S3OutputLocation( - input.S3Location, - context - ); - } - return bodyParams; + return { + ...(input.S3Location !== undefined && { + S3Location: serializeAws_json1_1S3OutputLocation( + input.S3Location, + context + ) + }) + }; }; const serializeAws_json1_1InstanceIdList = ( @@ -18298,19 +17843,15 @@ const serializeAws_json1_1InstanceInformationFilter = ( input: InstanceInformationFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.valueSet !== undefined) { - bodyParams[ - "valueSet" - ] = serializeAws_json1_1InstanceInformationFilterValueSet( - input.valueSet, - context - ); - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.valueSet !== undefined && { + valueSet: serializeAws_json1_1InstanceInformationFilterValueSet( + input.valueSet, + context + ) + }) + }; }; const serializeAws_json1_1InstanceInformationFilterList = ( @@ -18333,19 +17874,15 @@ const serializeAws_json1_1InstanceInformationStringFilter = ( input: InstanceInformationStringFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams[ - "Values" - ] = serializeAws_json1_1InstanceInformationFilterValueSet( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1InstanceInformationFilterValueSet( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1InstanceInformationStringFilterList = ( @@ -18361,20 +17898,16 @@ const serializeAws_json1_1InstancePatchStateFilter = ( input: InstancePatchStateFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1InstancePatchStateFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1InstancePatchStateFilterValues( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1InstancePatchStateFilterList = ( @@ -18397,23 +17930,18 @@ const serializeAws_json1_1InventoryAggregator = ( input: InventoryAggregator, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Aggregators !== undefined) { - bodyParams["Aggregators"] = serializeAws_json1_1InventoryAggregatorList( - input.Aggregators, - context - ); - } - if (input.Expression !== undefined) { - bodyParams["Expression"] = input.Expression; - } - if (input.Groups !== undefined) { - bodyParams["Groups"] = serializeAws_json1_1InventoryGroupList( - input.Groups, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1InventoryAggregatorList = ( @@ -18429,20 +17957,16 @@ const serializeAws_json1_1InventoryFilter = ( input: InventoryFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1InventoryFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1InventoryFilterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1InventoryFilterList = ( @@ -18465,17 +17989,12 @@ const serializeAws_json1_1InventoryGroup = ( input: InventoryGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1InventoryFilterList( - input.Filters, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1InventoryFilterList(input.Filters, context) + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1InventoryGroupList = ( @@ -18489,32 +18008,26 @@ const serializeAws_json1_1InventoryItem = ( input: InventoryItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CaptureTime !== undefined) { - bodyParams["CaptureTime"] = input.CaptureTime; - } - if (input.Content !== undefined) { - bodyParams["Content"] = serializeAws_json1_1InventoryItemEntryList( - input.Content, - context - ); - } - if (input.ContentHash !== undefined) { - bodyParams["ContentHash"] = input.ContentHash; - } - if (input.Context !== undefined) { - bodyParams["Context"] = serializeAws_json1_1InventoryItemContentContext( - input.Context, - context - ); - } - if (input.SchemaVersion !== undefined) { - bodyParams["SchemaVersion"] = input.SchemaVersion; - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1InventoryItemContentContext = ( @@ -18564,339 +18077,251 @@ const serializeAws_json1_1LabelParameterVersionRequest = ( input: LabelParameterVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Labels !== undefined) { - bodyParams["Labels"] = serializeAws_json1_1ParameterLabelList( - input.Labels, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.ParameterVersion !== undefined) { - bodyParams["ParameterVersion"] = input.ParameterVersion; - } - return bodyParams; + return { + ...(input.Labels !== undefined && { + Labels: serializeAws_json1_1ParameterLabelList(input.Labels, context) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.ParameterVersion !== undefined && { + ParameterVersion: input.ParameterVersion + }) + }; }; const serializeAws_json1_1ListAssociationVersionsRequest = ( input: ListAssociationVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationId !== undefined) { - bodyParams["AssociationId"] = input.AssociationId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.AssociationId !== undefined && { + AssociationId: input.AssociationId + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListAssociationsRequest = ( input: ListAssociationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationFilterList !== undefined) { - bodyParams[ - "AssociationFilterList" - ] = serializeAws_json1_1AssociationFilterList( - input.AssociationFilterList, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.AssociationFilterList !== undefined && { + AssociationFilterList: serializeAws_json1_1AssociationFilterList( + input.AssociationFilterList, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListCommandInvocationsRequest = ( input: ListCommandInvocationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommandId !== undefined) { - bodyParams["CommandId"] = input.CommandId; - } - if (input.Details !== undefined) { - bodyParams["Details"] = input.Details; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1CommandFilterList( - input.Filters, - context - ); - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListCommandsRequest = ( input: ListCommandsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CommandId !== undefined) { - bodyParams["CommandId"] = input.CommandId; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1CommandFilterList( - input.Filters, - context - ); - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListComplianceItemsRequest = ( input: ListComplianceItemsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ComplianceStringFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ResourceIds !== undefined) { - bodyParams["ResourceIds"] = serializeAws_json1_1ComplianceResourceIdList( - input.ResourceIds, - context - ); - } - if (input.ResourceTypes !== undefined) { - bodyParams[ - "ResourceTypes" - ] = serializeAws_json1_1ComplianceResourceTypeList( - input.ResourceTypes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ListComplianceSummariesRequest = ( input: ListComplianceSummariesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ComplianceStringFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1ComplianceStringFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDocumentVersionsRequest = ( input: ListDocumentVersionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListDocumentsRequest = ( input: ListDocumentsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentFilterList !== undefined) { - bodyParams["DocumentFilterList"] = serializeAws_json1_1DocumentFilterList( - input.DocumentFilterList, - context - ); - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1DocumentKeyValuesFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListInventoryEntriesRequest = ( input: ListInventoryEntriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1InventoryFilterList( - input.Filters, - context - ); - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListResourceComplianceSummariesRequest = ( input: ListResourceComplianceSummariesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1ComplianceStringFilterList( - input.Filters, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filters !== undefined && { + Filters: serializeAws_json1_1ComplianceStringFilterList( + input.Filters, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListResourceDataSyncRequest = ( input: ListResourceDataSyncRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.SyncType !== undefined) { - bodyParams["SyncType"] = input.SyncType; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.SyncType !== undefined && { SyncType: input.SyncType }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }) + }; }; const serializeAws_json1_1LoggingInfo = ( input: LoggingInfo, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3BucketName !== undefined) { - bodyParams["S3BucketName"] = input.S3BucketName; - } - if (input.S3KeyPrefix !== undefined) { - bodyParams["S3KeyPrefix"] = input.S3KeyPrefix; - } - if (input.S3Region !== undefined) { - bodyParams["S3Region"] = input.S3Region; - } - return bodyParams; + return { + ...(input.S3BucketName !== undefined && { + S3BucketName: input.S3BucketName + }), + ...(input.S3KeyPrefix !== undefined && { S3KeyPrefix: input.S3KeyPrefix }), + ...(input.S3Region !== undefined && { S3Region: input.S3Region }) + }; }; const serializeAws_json1_1MaintenanceWindowAutomationParameters = ( input: MaintenanceWindowAutomationParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1AutomationParameterMap( - input.Parameters, - context - ); - } - return bodyParams; + return { + ...(input.DocumentVersion !== undefined && { + DocumentVersion: input.DocumentVersion + }), + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_1AutomationParameterMap( + input.Parameters, + context + ) + }) + }; }; const serializeAws_json1_1MaintenanceWindowFilter = ( input: MaintenanceWindowFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1MaintenanceWindowFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1MaintenanceWindowFilterValues( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1MaintenanceWindowFilterList = ( @@ -18919,139 +18344,116 @@ const serializeAws_json1_1MaintenanceWindowLambdaParameters = ( input: MaintenanceWindowLambdaParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientContext !== undefined) { - bodyParams["ClientContext"] = input.ClientContext; - } - if (input.Payload !== undefined) { - bodyParams["Payload"] = context.base64Encoder(input.Payload); - } - if (input.Qualifier !== undefined) { - bodyParams["Qualifier"] = input.Qualifier; - } - return bodyParams; + return { + ...(input.ClientContext !== undefined && { + ClientContext: input.ClientContext + }), + ...(input.Payload !== undefined && { + Payload: context.base64Encoder(input.Payload) + }), + ...(input.Qualifier !== undefined && { Qualifier: input.Qualifier }) + }; }; const serializeAws_json1_1MaintenanceWindowRunCommandParameters = ( input: MaintenanceWindowRunCommandParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchOutputConfig !== undefined) { - bodyParams[ - "CloudWatchOutputConfig" - ] = serializeAws_json1_1CloudWatchOutputConfig( - input.CloudWatchOutputConfig, - context - ); - } - if (input.Comment !== undefined) { - bodyParams["Comment"] = input.Comment; - } - if (input.DocumentHash !== undefined) { - bodyParams["DocumentHash"] = input.DocumentHash; - } - if (input.DocumentHashType !== undefined) { - bodyParams["DocumentHashType"] = input.DocumentHashType; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.NotificationConfig !== undefined) { - bodyParams["NotificationConfig"] = serializeAws_json1_1NotificationConfig( - input.NotificationConfig, - context - ); - } - if (input.OutputS3BucketName !== undefined) { - bodyParams["OutputS3BucketName"] = input.OutputS3BucketName; - } - if (input.OutputS3KeyPrefix !== undefined) { - bodyParams["OutputS3KeyPrefix"] = input.OutputS3KeyPrefix; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1Parameters( - input.Parameters, - context - ); - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.TimeoutSeconds !== undefined) { - bodyParams["TimeoutSeconds"] = input.TimeoutSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1MaintenanceWindowStepFunctionsParameters = ( input: MaintenanceWindowStepFunctionsParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Input !== undefined) { - bodyParams["Input"] = input.Input; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Input !== undefined && { Input: input.Input }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1MaintenanceWindowTaskInvocationParameters = ( input: MaintenanceWindowTaskInvocationParameters, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Automation !== undefined) { - bodyParams[ - "Automation" - ] = serializeAws_json1_1MaintenanceWindowAutomationParameters( - input.Automation, - context - ); - } - if (input.Lambda !== undefined) { - bodyParams[ - "Lambda" - ] = serializeAws_json1_1MaintenanceWindowLambdaParameters( - input.Lambda, - context - ); - } - if (input.RunCommand !== undefined) { - bodyParams[ - "RunCommand" - ] = serializeAws_json1_1MaintenanceWindowRunCommandParameters( - input.RunCommand, - context - ); - } - if (input.StepFunctions !== undefined) { - bodyParams[ - "StepFunctions" - ] = serializeAws_json1_1MaintenanceWindowStepFunctionsParameters( - input.StepFunctions, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1MaintenanceWindowTaskParameterValueExpression = ( input: MaintenanceWindowTaskParameterValueExpression, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Values !== undefined) { - bodyParams[ - "Values" - ] = serializeAws_json1_1MaintenanceWindowTaskParameterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Values !== undefined && { + Values: serializeAws_json1_1MaintenanceWindowTaskParameterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1MaintenanceWindowTaskParameterValueList = ( @@ -19080,51 +18482,47 @@ const serializeAws_json1_1ModifyDocumentPermissionRequest = ( input: ModifyDocumentPermissionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AccountIdsToAdd !== undefined) { - bodyParams["AccountIdsToAdd"] = serializeAws_json1_1AccountIdList( - input.AccountIdsToAdd, - context - ); - } - if (input.AccountIdsToRemove !== undefined) { - bodyParams["AccountIdsToRemove"] = serializeAws_json1_1AccountIdList( - input.AccountIdsToRemove, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.PermissionType !== undefined) { - bodyParams["PermissionType"] = input.PermissionType; - } - if (input.SharedDocumentVersion !== undefined) { - bodyParams["SharedDocumentVersion"] = input.SharedDocumentVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1NotificationConfig = ( input: NotificationConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NotificationArn !== undefined) { - bodyParams["NotificationArn"] = input.NotificationArn; - } - if (input.NotificationEvents !== undefined) { - bodyParams[ - "NotificationEvents" - ] = serializeAws_json1_1NotificationEventList( - input.NotificationEvents, - context - ); - } - if (input.NotificationType !== undefined) { - bodyParams["NotificationType"] = input.NotificationType; - } - return bodyParams; + return { + ...(input.NotificationArn !== undefined && { + NotificationArn: input.NotificationArn + }), + ...(input.NotificationEvents !== undefined && { + NotificationEvents: serializeAws_json1_1NotificationEventList( + input.NotificationEvents, + context + ) + }), + ...(input.NotificationType !== undefined && { + NotificationType: input.NotificationType + }) + }; }; const serializeAws_json1_1NotificationEventList = ( @@ -19138,35 +18536,27 @@ const serializeAws_json1_1OpsAggregator = ( input: OpsAggregator, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AggregatorType !== undefined) { - bodyParams["AggregatorType"] = input.AggregatorType; - } - if (input.Aggregators !== undefined) { - bodyParams["Aggregators"] = serializeAws_json1_1OpsAggregatorList( - input.Aggregators, - context - ); - } - if (input.AttributeName !== undefined) { - bodyParams["AttributeName"] = input.AttributeName; - } - if (input.Filters !== undefined) { - bodyParams["Filters"] = serializeAws_json1_1OpsFilterList( - input.Filters, - context - ); - } - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1OpsAggregatorValueMap( - input.Values, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1OpsAggregatorList = ( @@ -19190,20 +18580,13 @@ const serializeAws_json1_1OpsFilter = ( input: OpsFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1OpsFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1OpsFilterValueList(input.Values, context) + }) + }; }; const serializeAws_json1_1OpsFilterList = ( @@ -19224,34 +18607,23 @@ const serializeAws_json1_1OpsItemDataValue = ( input: OpsItemDataValue, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1OpsItemFilter = ( input: OpsItemFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Operator !== undefined) { - bodyParams["Operator"] = input.Operator; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1OpsItemFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Operator !== undefined && { Operator: input.Operator }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1OpsItemFilterValues(input.Values, context) + }) + }; }; const serializeAws_json1_1OpsItemFilterValues = ( @@ -19272,11 +18644,9 @@ const serializeAws_json1_1OpsItemNotification = ( input: OpsItemNotification, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }) + }; }; const serializeAws_json1_1OpsItemNotifications = ( @@ -19309,11 +18679,9 @@ const serializeAws_json1_1OpsResultAttribute = ( input: OpsResultAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + return { + ...(input.TypeName !== undefined && { TypeName: input.TypeName }) + }; }; const serializeAws_json1_1OpsResultAttributeList = ( @@ -19343,20 +18711,16 @@ const serializeAws_json1_1ParameterStringFilter = ( input: ParameterStringFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Option !== undefined) { - bodyParams["Option"] = input.Option; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ParameterStringFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Option !== undefined && { Option: input.Option }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1ParameterStringFilterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1ParameterStringFilterList = ( @@ -19396,17 +18760,15 @@ const serializeAws_json1_1ParametersFilter = ( input: ParametersFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1ParametersFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1ParametersFilterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1ParametersFilterList = ( @@ -19429,31 +18791,26 @@ const serializeAws_json1_1PatchFilter = ( input: PatchFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1PatchFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1PatchFilterValueList(input.Values, context) + }) + }; }; const serializeAws_json1_1PatchFilterGroup = ( input: PatchFilterGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PatchFilters !== undefined) { - bodyParams["PatchFilters"] = serializeAws_json1_1PatchFilterList( - input.PatchFilters, - context - ); - } - return bodyParams; + return { + ...(input.PatchFilters !== undefined && { + PatchFilters: serializeAws_json1_1PatchFilterList( + input.PatchFilters, + context + ) + }) + }; }; const serializeAws_json1_1PatchFilterList = ( @@ -19481,17 +18838,15 @@ const serializeAws_json1_1PatchOrchestratorFilter = ( input: PatchOrchestratorFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1PatchOrchestratorFilterValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1PatchOrchestratorFilterValues( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1PatchOrchestratorFilterList = ( @@ -19514,37 +18869,34 @@ const serializeAws_json1_1PatchRule = ( input: PatchRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApproveAfterDays !== undefined) { - bodyParams["ApproveAfterDays"] = input.ApproveAfterDays; - } - if (input.ComplianceLevel !== undefined) { - bodyParams["ComplianceLevel"] = input.ComplianceLevel; - } - if (input.EnableNonSecurity !== undefined) { - bodyParams["EnableNonSecurity"] = input.EnableNonSecurity; - } - if (input.PatchFilterGroup !== undefined) { - bodyParams["PatchFilterGroup"] = serializeAws_json1_1PatchFilterGroup( - input.PatchFilterGroup, - context - ); - } - return bodyParams; + return { + ...(input.ApproveAfterDays !== undefined && { + ApproveAfterDays: input.ApproveAfterDays + }), + ...(input.ComplianceLevel !== undefined && { + ComplianceLevel: input.ComplianceLevel + }), + ...(input.EnableNonSecurity !== undefined && { + EnableNonSecurity: input.EnableNonSecurity + }), + ...(input.PatchFilterGroup !== undefined && { + PatchFilterGroup: serializeAws_json1_1PatchFilterGroup( + input.PatchFilterGroup, + context + ) + }) + }; }; const serializeAws_json1_1PatchRuleGroup = ( input: PatchRuleGroup, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PatchRules !== undefined) { - bodyParams["PatchRules"] = serializeAws_json1_1PatchRuleList( - input.PatchRules, - context - ); - } - return bodyParams; + return { + ...(input.PatchRules !== undefined && { + PatchRules: serializeAws_json1_1PatchRuleList(input.PatchRules, context) + }) + }; }; const serializeAws_json1_1PatchRuleList = ( @@ -19558,20 +18910,18 @@ const serializeAws_json1_1PatchSource = ( input: PatchSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Configuration !== undefined) { - bodyParams["Configuration"] = input.Configuration; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Products !== undefined) { - bodyParams["Products"] = serializeAws_json1_1PatchSourceProductList( - input.Products, - context - ); - } - return bodyParams; + return { + ...(input.Configuration !== undefined && { + Configuration: input.Configuration + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Products !== undefined && { + Products: serializeAws_json1_1PatchSourceProductList( + input.Products, + context + ) + }) + }; }; const serializeAws_json1_1PatchSourceList = ( @@ -19592,89 +18942,61 @@ const serializeAws_json1_1PutComplianceItemsRequest = ( input: PutComplianceItemsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComplianceType !== undefined) { - bodyParams["ComplianceType"] = input.ComplianceType; - } - if (input.ExecutionSummary !== undefined) { - bodyParams[ - "ExecutionSummary" - ] = serializeAws_json1_1ComplianceExecutionSummary( - input.ExecutionSummary, - context - ); - } - if (input.ItemContentHash !== undefined) { - bodyParams["ItemContentHash"] = input.ItemContentHash; - } - if (input.Items !== undefined) { - bodyParams["Items"] = serializeAws_json1_1ComplianceItemEntryList( - input.Items, - context - ); - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1PutInventoryRequest = ( input: PutInventoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.Items !== undefined) { - bodyParams["Items"] = serializeAws_json1_1InventoryItemList( - input.Items, - context - ); - } - return bodyParams; + return { + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Items !== undefined && { + Items: serializeAws_json1_1InventoryItemList(input.Items, context) + }) + }; }; const serializeAws_json1_1PutParameterRequest = ( input: PutParameterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowedPattern !== undefined) { - bodyParams["AllowedPattern"] = input.AllowedPattern; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.KeyId !== undefined) { - bodyParams["KeyId"] = input.KeyId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Overwrite !== undefined) { - bodyParams["Overwrite"] = input.Overwrite; - } - if (input.Policies !== undefined) { - bodyParams["Policies"] = input.Policies; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.Tier !== undefined) { - bodyParams["Tier"] = input.Tier; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.AllowedPattern !== undefined && { + AllowedPattern: input.AllowedPattern + }), + ...(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 }) + }; }; const serializeAws_json1_1Regions = ( @@ -19688,134 +19010,89 @@ const serializeAws_json1_1RegisterDefaultPatchBaselineRequest = ( input: RegisterDefaultPatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - return bodyParams; + return { + ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }) + }; }; const serializeAws_json1_1RegisterPatchBaselineForPatchGroupRequest = ( input: RegisterPatchBaselineForPatchGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - if (input.PatchGroup !== undefined) { - bodyParams["PatchGroup"] = input.PatchGroup; - } - return bodyParams; + return { + ...(input.BaselineId !== undefined && { BaselineId: input.BaselineId }), + ...(input.PatchGroup !== undefined && { PatchGroup: input.PatchGroup }) + }; }; const serializeAws_json1_1RegisterTargetWithMaintenanceWindowRequest = ( input: RegisterTargetWithMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken === undefined) { - input.ClientToken = generateIdempotencyToken(); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OwnerInformation !== undefined) { - bodyParams["OwnerInformation"] = input.OwnerInformation; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RegisterTaskWithMaintenanceWindowRequest = ( input: RegisterTaskWithMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken === undefined) { - input.ClientToken = generateIdempotencyToken(); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.LoggingInfo !== undefined) { - bodyParams["LoggingInfo"] = serializeAws_json1_1LoggingInfo( - input.LoggingInfo, - context - ); - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - if (input.TaskInvocationParameters !== undefined) { - bodyParams[ - "TaskInvocationParameters" - ] = serializeAws_json1_1MaintenanceWindowTaskInvocationParameters( - input.TaskInvocationParameters, - context - ); - } - if (input.TaskParameters !== undefined) { - bodyParams[ - "TaskParameters" - ] = serializeAws_json1_1MaintenanceWindowTaskParameters( - input.TaskParameters, - context - ); - } - if (input.TaskType !== undefined) { - bodyParams["TaskType"] = input.TaskType; - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1RelatedOpsItem = ( input: RelatedOpsItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OpsItemId !== undefined) { - bodyParams["OpsItemId"] = input.OpsItemId; - } - return bodyParams; + return { + ...(input.OpsItemId !== undefined && { OpsItemId: input.OpsItemId }) + }; }; const serializeAws_json1_1RelatedOpsItems = ( @@ -19829,58 +19106,52 @@ const serializeAws_json1_1RemoveTagsFromResourceRequest = ( input: RemoveTagsFromResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1KeyList(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1KeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1ResetServiceSettingRequest = ( input: ResetServiceSettingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SettingId !== undefined) { - bodyParams["SettingId"] = input.SettingId; - } - return bodyParams; + return { + ...(input.SettingId !== undefined && { SettingId: input.SettingId }) + }; }; const serializeAws_json1_1ResourceDataSyncAwsOrganizationsSource = ( input: ResourceDataSyncAwsOrganizationsSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationSourceType !== undefined) { - bodyParams["OrganizationSourceType"] = input.OrganizationSourceType; - } - if (input.OrganizationalUnits !== undefined) { - bodyParams[ - "OrganizationalUnits" - ] = serializeAws_json1_1ResourceDataSyncOrganizationalUnitList( - input.OrganizationalUnits, - context - ); - } - return bodyParams; + return { + ...(input.OrganizationSourceType !== undefined && { + OrganizationSourceType: input.OrganizationSourceType + }), + ...(input.OrganizationalUnits !== undefined && { + OrganizationalUnits: serializeAws_json1_1ResourceDataSyncOrganizationalUnitList( + input.OrganizationalUnits, + context + ) + }) + }; }; const serializeAws_json1_1ResourceDataSyncOrganizationalUnit = ( input: ResourceDataSyncOrganizationalUnit, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationalUnitId !== undefined) { - bodyParams["OrganizationalUnitId"] = input.OrganizationalUnitId; - } - return bodyParams; + return { + ...(input.OrganizationalUnitId !== undefined && { + OrganizationalUnitId: input.OrganizationalUnitId + }) + }; }; const serializeAws_json1_1ResourceDataSyncOrganizationalUnitList = ( @@ -19896,53 +19167,39 @@ const serializeAws_json1_1ResourceDataSyncS3Destination = ( input: ResourceDataSyncS3Destination, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AWSKMSKeyARN !== undefined) { - bodyParams["AWSKMSKeyARN"] = input.AWSKMSKeyARN; - } - if (input.BucketName !== undefined) { - bodyParams["BucketName"] = input.BucketName; - } - if (input.Prefix !== undefined) { - bodyParams["Prefix"] = input.Prefix; - } - if (input.Region !== undefined) { - bodyParams["Region"] = input.Region; - } - if (input.SyncFormat !== undefined) { - bodyParams["SyncFormat"] = input.SyncFormat; - } - return bodyParams; + return { + ...(input.AWSKMSKeyARN !== undefined && { + AWSKMSKeyARN: input.AWSKMSKeyARN + }), + ...(input.BucketName !== undefined && { BucketName: input.BucketName }), + ...(input.Prefix !== undefined && { Prefix: input.Prefix }), + ...(input.Region !== undefined && { Region: input.Region }), + ...(input.SyncFormat !== undefined && { SyncFormat: input.SyncFormat }) + }; }; const serializeAws_json1_1ResourceDataSyncSource = ( input: ResourceDataSyncSource, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AwsOrganizationsSource !== undefined) { - bodyParams[ - "AwsOrganizationsSource" - ] = serializeAws_json1_1ResourceDataSyncAwsOrganizationsSource( - input.AwsOrganizationsSource, - context - ); - } - if (input.IncludeFutureRegions !== undefined) { - bodyParams["IncludeFutureRegions"] = input.IncludeFutureRegions; - } - if (input.SourceRegions !== undefined) { - bodyParams[ - "SourceRegions" - ] = serializeAws_json1_1ResourceDataSyncSourceRegionList( - input.SourceRegions, - context - ); - } - if (input.SourceType !== undefined) { - bodyParams["SourceType"] = input.SourceType; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ResourceDataSyncSourceRegionList = ( @@ -19956,11 +19213,9 @@ const serializeAws_json1_1ResultAttribute = ( input: ResultAttribute, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TypeName !== undefined) { - bodyParams["TypeName"] = input.TypeName; - } - return bodyParams; + return { + ...(input.TypeName !== undefined && { TypeName: input.TypeName }) + }; }; const serializeAws_json1_1ResultAttributeList = ( @@ -19976,135 +19231,118 @@ const serializeAws_json1_1ResumeSessionRequest = ( input: ResumeSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SessionId !== undefined) { - bodyParams["SessionId"] = input.SessionId; - } - return bodyParams; + return { + ...(input.SessionId !== undefined && { SessionId: input.SessionId }) + }; }; const serializeAws_json1_1S3OutputLocation = ( input: S3OutputLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OutputS3BucketName !== undefined) { - bodyParams["OutputS3BucketName"] = input.OutputS3BucketName; - } - if (input.OutputS3KeyPrefix !== undefined) { - bodyParams["OutputS3KeyPrefix"] = input.OutputS3KeyPrefix; - } - if (input.OutputS3Region !== undefined) { - bodyParams["OutputS3Region"] = input.OutputS3Region; - } - return bodyParams; + return { + ...(input.OutputS3BucketName !== undefined && { + OutputS3BucketName: input.OutputS3BucketName + }), + ...(input.OutputS3KeyPrefix !== undefined && { + OutputS3KeyPrefix: input.OutputS3KeyPrefix + }), + ...(input.OutputS3Region !== undefined && { + OutputS3Region: input.OutputS3Region + }) + }; }; const serializeAws_json1_1SendAutomationSignalRequest = ( input: SendAutomationSignalRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomationExecutionId !== undefined) { - bodyParams["AutomationExecutionId"] = input.AutomationExecutionId; - } - if (input.Payload !== undefined) { - bodyParams["Payload"] = serializeAws_json1_1AutomationParameterMap( - input.Payload, - context - ); - } - if (input.SignalType !== undefined) { - bodyParams["SignalType"] = input.SignalType; - } - return bodyParams; + return { + ...(input.AutomationExecutionId !== undefined && { + AutomationExecutionId: input.AutomationExecutionId + }), + ...(input.Payload !== undefined && { + Payload: serializeAws_json1_1AutomationParameterMap( + input.Payload, + context + ) + }), + ...(input.SignalType !== undefined && { SignalType: input.SignalType }) + }; }; const serializeAws_json1_1SendCommandRequest = ( input: SendCommandRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchOutputConfig !== undefined) { - bodyParams[ - "CloudWatchOutputConfig" - ] = serializeAws_json1_1CloudWatchOutputConfig( - input.CloudWatchOutputConfig, - context - ); - } - if (input.Comment !== undefined) { - bodyParams["Comment"] = input.Comment; - } - if (input.DocumentHash !== undefined) { - bodyParams["DocumentHash"] = input.DocumentHash; - } - if (input.DocumentHashType !== undefined) { - bodyParams["DocumentHashType"] = input.DocumentHashType; - } - if (input.DocumentName !== undefined) { - bodyParams["DocumentName"] = input.DocumentName; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.InstanceIds !== undefined) { - bodyParams["InstanceIds"] = serializeAws_json1_1InstanceIdList( - input.InstanceIds, - context - ); - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.NotificationConfig !== undefined) { - bodyParams["NotificationConfig"] = serializeAws_json1_1NotificationConfig( - input.NotificationConfig, - context - ); - } - if (input.OutputS3BucketName !== undefined) { - bodyParams["OutputS3BucketName"] = input.OutputS3BucketName; - } - if (input.OutputS3KeyPrefix !== undefined) { - bodyParams["OutputS3KeyPrefix"] = input.OutputS3KeyPrefix; - } - if (input.OutputS3Region !== undefined) { - bodyParams["OutputS3Region"] = input.OutputS3Region; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1Parameters( - input.Parameters, - context - ); - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - if (input.TimeoutSeconds !== undefined) { - bodyParams["TimeoutSeconds"] = input.TimeoutSeconds; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1SessionFilter = ( input: SessionFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_1SessionFilterList = ( @@ -20138,104 +19376,91 @@ const serializeAws_json1_1StartAssociationsOnceRequest = ( input: StartAssociationsOnceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationIds !== undefined) { - bodyParams["AssociationIds"] = serializeAws_json1_1AssociationIdList( - input.AssociationIds, - context - ); - } - return bodyParams; + return { + ...(input.AssociationIds !== undefined && { + AssociationIds: serializeAws_json1_1AssociationIdList( + input.AssociationIds, + context + ) + }) + }; }; const serializeAws_json1_1StartAutomationExecutionRequest = ( input: StartAutomationExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.DocumentName !== undefined) { - bodyParams["DocumentName"] = input.DocumentName; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.Mode !== undefined) { - bodyParams["Mode"] = input.Mode; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1AutomationParameterMap( - input.Parameters, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.TargetLocations !== undefined) { - bodyParams["TargetLocations"] = serializeAws_json1_1TargetLocations( - input.TargetLocations, - context - ); - } - if (input.TargetMaps !== undefined) { - bodyParams["TargetMaps"] = serializeAws_json1_1TargetMaps( - input.TargetMaps, - context - ); - } - if (input.TargetParameterName !== undefined) { - bodyParams["TargetParameterName"] = input.TargetParameterName; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1StartSessionRequest = ( input: StartSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentName !== undefined) { - bodyParams["DocumentName"] = input.DocumentName; - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1SessionManagerParameters( - input.Parameters, - context - ); - } - if (input.Target !== undefined) { - bodyParams["Target"] = input.Target; - } - return bodyParams; + return { + ...(input.DocumentName !== undefined && { + DocumentName: input.DocumentName + }), + ...(input.Parameters !== undefined && { + Parameters: serializeAws_json1_1SessionManagerParameters( + input.Parameters, + context + ) + }), + ...(input.Target !== undefined && { Target: input.Target }) + }; }; const serializeAws_json1_1StepExecutionFilter = ( input: StepExecutionFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1StepExecutionFilterValueList( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1StepExecutionFilterValueList( + input.Values, + context + ) + }) + }; }; const serializeAws_json1_1StepExecutionFilterList = ( @@ -20258,14 +19483,12 @@ const serializeAws_json1_1StopAutomationExecutionRequest = ( input: StopAutomationExecutionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutomationExecutionId !== undefined) { - bodyParams["AutomationExecutionId"] = input.AutomationExecutionId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.AutomationExecutionId !== undefined && { + AutomationExecutionId: input.AutomationExecutionId + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1StringList = ( @@ -20276,14 +19499,10 @@ const serializeAws_json1_1StringList = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagList = ( @@ -20297,44 +19516,35 @@ const serializeAws_json1_1Target = ( input: Target, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Values !== undefined) { - bodyParams["Values"] = serializeAws_json1_1TargetValues( - input.Values, - context - ); - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Values !== undefined && { + Values: serializeAws_json1_1TargetValues(input.Values, context) + }) + }; }; const serializeAws_json1_1TargetLocation = ( input: TargetLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Accounts !== undefined) { - bodyParams["Accounts"] = serializeAws_json1_1Accounts( - input.Accounts, - context - ); - } - if (input.ExecutionRoleName !== undefined) { - bodyParams["ExecutionRoleName"] = input.ExecutionRoleName; - } - if (input.Regions !== undefined) { - bodyParams["Regions"] = serializeAws_json1_1Regions(input.Regions, context); - } - if (input.TargetLocationMaxConcurrency !== undefined) { - bodyParams["TargetLocationMaxConcurrency"] = - input.TargetLocationMaxConcurrency; - } - if (input.TargetLocationMaxErrors !== undefined) { - bodyParams["TargetLocationMaxErrors"] = input.TargetLocationMaxErrors; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1TargetLocations = ( @@ -20386,433 +19596,319 @@ const serializeAws_json1_1TerminateSessionRequest = ( input: TerminateSessionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SessionId !== undefined) { - bodyParams["SessionId"] = input.SessionId; - } - return bodyParams; + return { + ...(input.SessionId !== undefined && { SessionId: input.SessionId }) + }; }; const serializeAws_json1_1UpdateAssociationRequest = ( input: UpdateAssociationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationId !== undefined) { - bodyParams["AssociationId"] = input.AssociationId; - } - if (input.AssociationName !== undefined) { - bodyParams["AssociationName"] = input.AssociationName; - } - if (input.AssociationVersion !== undefined) { - bodyParams["AssociationVersion"] = input.AssociationVersion; - } - if (input.AutomationTargetParameterName !== undefined) { - bodyParams["AutomationTargetParameterName"] = - input.AutomationTargetParameterName; - } - if (input.ComplianceSeverity !== undefined) { - bodyParams["ComplianceSeverity"] = input.ComplianceSeverity; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OutputLocation !== undefined) { - bodyParams[ - "OutputLocation" - ] = serializeAws_json1_1InstanceAssociationOutputLocation( - input.OutputLocation, - context - ); - } - if (input.Parameters !== undefined) { - bodyParams["Parameters"] = serializeAws_json1_1Parameters( - input.Parameters, - context - ); - } - if (input.ScheduleExpression !== undefined) { - bodyParams["ScheduleExpression"] = input.ScheduleExpression; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - return bodyParams; + return { + ...(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.Targets !== undefined && { + Targets: serializeAws_json1_1Targets(input.Targets, context) + }) + }; }; const serializeAws_json1_1UpdateAssociationStatusRequest = ( input: UpdateAssociationStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AssociationStatus !== undefined) { - bodyParams["AssociationStatus"] = serializeAws_json1_1AssociationStatus( - input.AssociationStatus, - context - ); - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.AssociationStatus !== undefined && { + AssociationStatus: serializeAws_json1_1AssociationStatus( + input.AssociationStatus, + context + ) + }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateDocumentDefaultVersionRequest = ( input: UpdateDocumentDefaultVersionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.DocumentVersion !== undefined && { + DocumentVersion: input.DocumentVersion + }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1UpdateDocumentRequest = ( input: UpdateDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attachments !== undefined) { - bodyParams["Attachments"] = serializeAws_json1_1AttachmentsSourceList( - input.Attachments, - context - ); - } - if (input.Content !== undefined) { - bodyParams["Content"] = input.Content; - } - if (input.DocumentFormat !== undefined) { - bodyParams["DocumentFormat"] = input.DocumentFormat; - } - if (input.DocumentVersion !== undefined) { - bodyParams["DocumentVersion"] = input.DocumentVersion; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.TargetType !== undefined) { - bodyParams["TargetType"] = input.TargetType; - } - if (input.VersionName !== undefined) { - bodyParams["VersionName"] = input.VersionName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateMaintenanceWindowRequest = ( input: UpdateMaintenanceWindowRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowUnassociatedTargets !== undefined) { - bodyParams["AllowUnassociatedTargets"] = input.AllowUnassociatedTargets; - } - if (input.Cutoff !== undefined) { - bodyParams["Cutoff"] = input.Cutoff; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Duration !== undefined) { - bodyParams["Duration"] = input.Duration; - } - if (input.Enabled !== undefined) { - bodyParams["Enabled"] = input.Enabled; - } - if (input.EndDate !== undefined) { - bodyParams["EndDate"] = input.EndDate; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Replace !== undefined) { - bodyParams["Replace"] = input.Replace; - } - if (input.Schedule !== undefined) { - bodyParams["Schedule"] = input.Schedule; - } - if (input.ScheduleTimezone !== undefined) { - bodyParams["ScheduleTimezone"] = input.ScheduleTimezone; - } - if (input.StartDate !== undefined) { - bodyParams["StartDate"] = input.StartDate; - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - return bodyParams; + 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.ScheduleTimezone !== undefined && { + ScheduleTimezone: input.ScheduleTimezone + }), + ...(input.StartDate !== undefined && { StartDate: input.StartDate }), + ...(input.WindowId !== undefined && { WindowId: input.WindowId }) + }; }; const serializeAws_json1_1UpdateMaintenanceWindowTargetRequest = ( input: UpdateMaintenanceWindowTargetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OwnerInformation !== undefined) { - bodyParams["OwnerInformation"] = input.OwnerInformation; - } - if (input.Replace !== undefined) { - bodyParams["Replace"] = input.Replace; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - if (input.WindowTargetId !== undefined) { - bodyParams["WindowTargetId"] = input.WindowTargetId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateMaintenanceWindowTaskRequest = ( input: UpdateMaintenanceWindowTaskRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.LoggingInfo !== undefined) { - bodyParams["LoggingInfo"] = serializeAws_json1_1LoggingInfo( - input.LoggingInfo, - context - ); - } - if (input.MaxConcurrency !== undefined) { - bodyParams["MaxConcurrency"] = input.MaxConcurrency; - } - if (input.MaxErrors !== undefined) { - bodyParams["MaxErrors"] = input.MaxErrors; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.Replace !== undefined) { - bodyParams["Replace"] = input.Replace; - } - if (input.ServiceRoleArn !== undefined) { - bodyParams["ServiceRoleArn"] = input.ServiceRoleArn; - } - if (input.Targets !== undefined) { - bodyParams["Targets"] = serializeAws_json1_1Targets(input.Targets, context); - } - if (input.TaskArn !== undefined) { - bodyParams["TaskArn"] = input.TaskArn; - } - if (input.TaskInvocationParameters !== undefined) { - bodyParams[ - "TaskInvocationParameters" - ] = serializeAws_json1_1MaintenanceWindowTaskInvocationParameters( - input.TaskInvocationParameters, - context - ); - } - if (input.TaskParameters !== undefined) { - bodyParams[ - "TaskParameters" - ] = serializeAws_json1_1MaintenanceWindowTaskParameters( - input.TaskParameters, - context - ); - } - if (input.WindowId !== undefined) { - bodyParams["WindowId"] = input.WindowId; - } - if (input.WindowTaskId !== undefined) { - bodyParams["WindowTaskId"] = input.WindowTaskId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateManagedInstanceRoleRequest = ( input: UpdateManagedInstanceRoleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IamRole !== undefined) { - bodyParams["IamRole"] = input.IamRole; - } - if (input.InstanceId !== undefined) { - bodyParams["InstanceId"] = input.InstanceId; - } - return bodyParams; + return { + ...(input.IamRole !== undefined && { IamRole: input.IamRole }), + ...(input.InstanceId !== undefined && { InstanceId: input.InstanceId }) + }; }; const serializeAws_json1_1UpdateOpsItemRequest = ( input: UpdateOpsItemRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Category !== undefined) { - bodyParams["Category"] = input.Category; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Notifications !== undefined) { - bodyParams["Notifications"] = serializeAws_json1_1OpsItemNotifications( - input.Notifications, - context - ); - } - if (input.OperationalData !== undefined) { - bodyParams["OperationalData"] = serializeAws_json1_1OpsItemOperationalData( - input.OperationalData, - context - ); - } - if (input.OperationalDataToDelete !== undefined) { - bodyParams[ - "OperationalDataToDelete" - ] = serializeAws_json1_1OpsItemOpsDataKeysList( - input.OperationalDataToDelete, - context - ); - } - if (input.OpsItemId !== undefined) { - bodyParams["OpsItemId"] = input.OpsItemId; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.RelatedOpsItems !== undefined) { - bodyParams["RelatedOpsItems"] = serializeAws_json1_1RelatedOpsItems( - input.RelatedOpsItems, - context - ); - } - if (input.Severity !== undefined) { - bodyParams["Severity"] = input.Severity; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - if (input.Title !== undefined) { - bodyParams["Title"] = input.Title; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdatePatchBaselineRequest = ( input: UpdatePatchBaselineRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ApprovalRules !== undefined) { - bodyParams["ApprovalRules"] = serializeAws_json1_1PatchRuleGroup( - input.ApprovalRules, - context - ); - } - if (input.ApprovedPatches !== undefined) { - bodyParams["ApprovedPatches"] = serializeAws_json1_1PatchIdList( - input.ApprovedPatches, - context - ); - } - if (input.ApprovedPatchesComplianceLevel !== undefined) { - bodyParams["ApprovedPatchesComplianceLevel"] = - input.ApprovedPatchesComplianceLevel; - } - if (input.ApprovedPatchesEnableNonSecurity !== undefined) { - bodyParams["ApprovedPatchesEnableNonSecurity"] = - input.ApprovedPatchesEnableNonSecurity; - } - if (input.BaselineId !== undefined) { - bodyParams["BaselineId"] = input.BaselineId; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.GlobalFilters !== undefined) { - bodyParams["GlobalFilters"] = serializeAws_json1_1PatchFilterGroup( - input.GlobalFilters, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RejectedPatches !== undefined) { - bodyParams["RejectedPatches"] = serializeAws_json1_1PatchIdList( - input.RejectedPatches, - context - ); - } - if (input.RejectedPatchesAction !== undefined) { - bodyParams["RejectedPatchesAction"] = input.RejectedPatchesAction; - } - if (input.Replace !== undefined) { - bodyParams["Replace"] = input.Replace; - } - if (input.Sources !== undefined) { - bodyParams["Sources"] = serializeAws_json1_1PatchSourceList( - input.Sources, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateResourceDataSyncRequest = ( input: UpdateResourceDataSyncRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SyncName !== undefined) { - bodyParams["SyncName"] = input.SyncName; - } - if (input.SyncSource !== undefined) { - bodyParams["SyncSource"] = serializeAws_json1_1ResourceDataSyncSource( - input.SyncSource, - context - ); - } - if (input.SyncType !== undefined) { - bodyParams["SyncType"] = input.SyncType; - } - return bodyParams; + return { + ...(input.SyncName !== undefined && { SyncName: input.SyncName }), + ...(input.SyncSource !== undefined && { + SyncSource: serializeAws_json1_1ResourceDataSyncSource( + input.SyncSource, + context + ) + }), + ...(input.SyncType !== undefined && { SyncType: input.SyncType }) + }; }; const serializeAws_json1_1UpdateServiceSettingRequest = ( input: UpdateServiceSettingRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SettingId !== undefined) { - bodyParams["SettingId"] = input.SettingId; - } - if (input.SettingValue !== undefined) { - bodyParams["SettingValue"] = input.SettingValue; - } - return bodyParams; + return { + ...(input.SettingId !== undefined && { SettingId: input.SettingId }), + ...(input.SettingValue !== undefined && { + SettingValue: input.SettingValue + }) + }; }; const deserializeAws_json1_1AccountIdList = ( diff --git a/clients/client-storage-gateway/protocols/Aws_json1_1.ts b/clients/client-storage-gateway/protocols/Aws_json1_1.ts index 31a3d70f73b7..951593b807ff 100644 --- a/clients/client-storage-gateway/protocols/Aws_json1_1.ts +++ b/clients/client-storage-gateway/protocols/Aws_json1_1.ts @@ -7178,182 +7178,147 @@ const serializeAws_json1_1AddWorkingStorageInput = ( input: AddWorkingStorageInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DiskIds !== undefined) { - bodyParams["DiskIds"] = serializeAws_json1_1DiskIds(input.DiskIds, context); - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.DiskIds !== undefined && { + DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) + }), + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1CreateSnapshotInput = ( input: CreateSnapshotInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnapshotDescription !== undefined) { - bodyParams["SnapshotDescription"] = input.SnapshotDescription; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.SnapshotDescription !== undefined && { + SnapshotDescription: input.SnapshotDescription + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }), + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1CreateStorediSCSIVolumeInput = ( input: CreateStorediSCSIVolumeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DiskId !== undefined) { - bodyParams["DiskId"] = input.DiskId; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.NetworkInterfaceId !== undefined) { - bodyParams["NetworkInterfaceId"] = input.NetworkInterfaceId; - } - if (input.PreserveExistingData !== undefined) { - bodyParams["PreserveExistingData"] = input.PreserveExistingData; - } - if (input.SnapshotId !== undefined) { - bodyParams["SnapshotId"] = input.SnapshotId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.TargetName !== undefined) { - bodyParams["TargetName"] = input.TargetName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteChapCredentialsInput = ( input: DeleteChapCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InitiatorName !== undefined) { - bodyParams["InitiatorName"] = input.InitiatorName; - } - if (input.TargetARN !== undefined) { - bodyParams["TargetARN"] = input.TargetARN; - } - return bodyParams; + return { + ...(input.InitiatorName !== undefined && { + InitiatorName: input.InitiatorName + }), + ...(input.TargetARN !== undefined && { TargetARN: input.TargetARN }) + }; }; const serializeAws_json1_1DeleteGatewayInput = ( input: DeleteGatewayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DeleteVolumeInput = ( input: DeleteVolumeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1DescribeBandwidthRateLimitInput = ( input: DescribeBandwidthRateLimitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DescribeChapCredentialsInput = ( input: DescribeChapCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TargetARN !== undefined) { - bodyParams["TargetARN"] = input.TargetARN; - } - return bodyParams; + return { + ...(input.TargetARN !== undefined && { TargetARN: input.TargetARN }) + }; }; const serializeAws_json1_1DescribeGatewayInformationInput = ( input: DescribeGatewayInformationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DescribeMaintenanceStartTimeInput = ( input: DescribeMaintenanceStartTimeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DescribeSnapshotScheduleInput = ( input: DescribeSnapshotScheduleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1DescribeStorediSCSIVolumesInput = ( input: DescribeStorediSCSIVolumesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeARNs !== undefined) { - bodyParams["VolumeARNs"] = serializeAws_json1_1VolumeARNs( - input.VolumeARNs, - context - ); - } - return bodyParams; + return { + ...(input.VolumeARNs !== undefined && { + VolumeARNs: serializeAws_json1_1VolumeARNs(input.VolumeARNs, context) + }) + }; }; const serializeAws_json1_1DescribeWorkingStorageInput = ( input: DescribeWorkingStorageInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DiskIds = ( @@ -7367,161 +7332,124 @@ const serializeAws_json1_1ListGatewaysInput = ( input: ListGatewaysInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListLocalDisksInput = ( input: ListLocalDisksInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1ListVolumesInput = ( input: ListVolumesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ShutdownGatewayInput = ( input: ShutdownGatewayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1StartGatewayInput = ( input: StartGatewayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1UpdateBandwidthRateLimitInput = ( input: UpdateBandwidthRateLimitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AverageDownloadRateLimitInBitsPerSec !== undefined) { - bodyParams["AverageDownloadRateLimitInBitsPerSec"] = - input.AverageDownloadRateLimitInBitsPerSec; - } - if (input.AverageUploadRateLimitInBitsPerSec !== undefined) { - bodyParams["AverageUploadRateLimitInBitsPerSec"] = - input.AverageUploadRateLimitInBitsPerSec; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.AverageDownloadRateLimitInBitsPerSec !== undefined && { + AverageDownloadRateLimitInBitsPerSec: + input.AverageDownloadRateLimitInBitsPerSec + }), + ...(input.AverageUploadRateLimitInBitsPerSec !== undefined && { + AverageUploadRateLimitInBitsPerSec: + input.AverageUploadRateLimitInBitsPerSec + }), + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1UpdateChapCredentialsInput = ( input: UpdateChapCredentialsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InitiatorName !== undefined) { - bodyParams["InitiatorName"] = input.InitiatorName; - } - if (input.SecretToAuthenticateInitiator !== undefined) { - bodyParams["SecretToAuthenticateInitiator"] = - input.SecretToAuthenticateInitiator; - } - if (input.SecretToAuthenticateTarget !== undefined) { - bodyParams["SecretToAuthenticateTarget"] = input.SecretToAuthenticateTarget; - } - if (input.TargetARN !== undefined) { - bodyParams["TargetARN"] = input.TargetARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateGatewaySoftwareNowInput = ( input: UpdateGatewaySoftwareNowInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1UpdateMaintenanceStartTimeInput = ( input: UpdateMaintenanceStartTimeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DayOfMonth !== undefined) { - bodyParams["DayOfMonth"] = input.DayOfMonth; - } - if (input.DayOfWeek !== undefined) { - bodyParams["DayOfWeek"] = input.DayOfWeek; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.HourOfDay !== undefined) { - bodyParams["HourOfDay"] = input.HourOfDay; - } - if (input.MinuteOfHour !== undefined) { - bodyParams["MinuteOfHour"] = input.MinuteOfHour; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateSnapshotScheduleInput = ( input: UpdateSnapshotScheduleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.RecurrenceInHours !== undefined) { - bodyParams["RecurrenceInHours"] = input.RecurrenceInHours; - } - if (input.StartAt !== undefined) { - bodyParams["StartAt"] = input.StartAt; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1VolumeARNs = ( @@ -7535,656 +7463,507 @@ const serializeAws_json1_1AddCacheInput = ( input: AddCacheInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DiskIds !== undefined) { - bodyParams["DiskIds"] = serializeAws_json1_1DiskIds(input.DiskIds, context); - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.DiskIds !== undefined && { + DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) + }), + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1AddUploadBufferInput = ( input: AddUploadBufferInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DiskIds !== undefined) { - bodyParams["DiskIds"] = serializeAws_json1_1DiskIds(input.DiskIds, context); - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.DiskIds !== undefined && { + DiskIds: serializeAws_json1_1DiskIds(input.DiskIds, context) + }), + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1CreateCachediSCSIVolumeInput = ( input: CreateCachediSCSIVolumeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.NetworkInterfaceId !== undefined) { - bodyParams["NetworkInterfaceId"] = input.NetworkInterfaceId; - } - if (input.SnapshotId !== undefined) { - bodyParams["SnapshotId"] = input.SnapshotId; - } - if (input.SourceVolumeARN !== undefined) { - bodyParams["SourceVolumeARN"] = input.SourceVolumeARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.TargetName !== undefined) { - bodyParams["TargetName"] = input.TargetName; - } - if (input.VolumeSizeInBytes !== undefined) { - bodyParams["VolumeSizeInBytes"] = input.VolumeSizeInBytes; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteSnapshotScheduleInput = ( input: DeleteSnapshotScheduleInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1DescribeCacheInput = ( input: DescribeCacheInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DescribeCachediSCSIVolumesInput = ( input: DescribeCachediSCSIVolumesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeARNs !== undefined) { - bodyParams["VolumeARNs"] = serializeAws_json1_1VolumeARNs( - input.VolumeARNs, - context - ); - } - return bodyParams; + return { + ...(input.VolumeARNs !== undefined && { + VolumeARNs: serializeAws_json1_1VolumeARNs(input.VolumeARNs, context) + }) + }; }; const serializeAws_json1_1DescribeUploadBufferInput = ( input: DescribeUploadBufferInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1ListVolumeRecoveryPointsInput = ( input: ListVolumeRecoveryPointsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1ActivateGatewayInput = ( input: ActivateGatewayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ActivationKey !== undefined) { - bodyParams["ActivationKey"] = input.ActivationKey; - } - if (input.GatewayName !== undefined) { - bodyParams["GatewayName"] = input.GatewayName; - } - if (input.GatewayRegion !== undefined) { - bodyParams["GatewayRegion"] = input.GatewayRegion; - } - if (input.GatewayTimezone !== undefined) { - bodyParams["GatewayTimezone"] = input.GatewayTimezone; - } - if (input.GatewayType !== undefined) { - bodyParams["GatewayType"] = input.GatewayType; - } - if (input.MediumChangerType !== undefined) { - bodyParams["MediumChangerType"] = input.MediumChangerType; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.TapeDriveType !== undefined) { - bodyParams["TapeDriveType"] = input.TapeDriveType; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1AddTagsToResourceInput = ( input: AddTagsToResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1AssignTapePoolInput = ( input: AssignTapePoolInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.PoolId !== undefined) { - bodyParams["PoolId"] = input.PoolId; - } - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.PoolId !== undefined && { PoolId: input.PoolId }), + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1AttachVolumeInput = ( input: AttachVolumeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DiskId !== undefined) { - bodyParams["DiskId"] = input.DiskId; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.NetworkInterfaceId !== undefined) { - bodyParams["NetworkInterfaceId"] = input.NetworkInterfaceId; - } - if (input.TargetName !== undefined) { - bodyParams["TargetName"] = input.TargetName; - } - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1CancelArchivalInput = ( input: CancelArchivalInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1CancelRetrievalInput = ( input: CancelRetrievalInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1CreateNFSFileShareInput = ( input: CreateNFSFileShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientList !== undefined) { - bodyParams["ClientList"] = serializeAws_json1_1FileShareClientList( - input.ClientList, - context - ); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.DefaultStorageClass !== undefined) { - bodyParams["DefaultStorageClass"] = input.DefaultStorageClass; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.GuessMIMETypeEnabled !== undefined) { - bodyParams["GuessMIMETypeEnabled"] = input.GuessMIMETypeEnabled; - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.LocationARN !== undefined) { - bodyParams["LocationARN"] = input.LocationARN; - } - if (input.NFSFileShareDefaults !== undefined) { - bodyParams[ - "NFSFileShareDefaults" - ] = serializeAws_json1_1NFSFileShareDefaults( - input.NFSFileShareDefaults, - context - ); - } - if (input.ObjectACL !== undefined) { - bodyParams["ObjectACL"] = input.ObjectACL; - } - if (input.ReadOnly !== undefined) { - bodyParams["ReadOnly"] = input.ReadOnly; - } - if (input.RequesterPays !== undefined) { - bodyParams["RequesterPays"] = input.RequesterPays; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Squash !== undefined) { - bodyParams["Squash"] = input.Squash; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.ClientList !== undefined && { + ClientList: serializeAws_json1_1FileShareClientList( + input.ClientList, + context + ) + }), + ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), + ...(input.DefaultStorageClass !== undefined && { + DefaultStorageClass: input.DefaultStorageClass + }), + ...(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.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) + }) + }; }; const serializeAws_json1_1CreateSMBFileShareInput = ( input: CreateSMBFileShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminUserList !== undefined) { - bodyParams["AdminUserList"] = serializeAws_json1_1FileShareUserList( - input.AdminUserList, - context - ); - } - if (input.Authentication !== undefined) { - bodyParams["Authentication"] = input.Authentication; - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.DefaultStorageClass !== undefined) { - bodyParams["DefaultStorageClass"] = input.DefaultStorageClass; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.GuessMIMETypeEnabled !== undefined) { - bodyParams["GuessMIMETypeEnabled"] = input.GuessMIMETypeEnabled; - } - if (input.InvalidUserList !== undefined) { - bodyParams["InvalidUserList"] = serializeAws_json1_1FileShareUserList( - input.InvalidUserList, - context - ); - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.LocationARN !== undefined) { - bodyParams["LocationARN"] = input.LocationARN; - } - if (input.ObjectACL !== undefined) { - bodyParams["ObjectACL"] = input.ObjectACL; - } - if (input.ReadOnly !== undefined) { - bodyParams["ReadOnly"] = input.ReadOnly; - } - if (input.RequesterPays !== undefined) { - bodyParams["RequesterPays"] = input.RequesterPays; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.SMBACLEnabled !== undefined) { - bodyParams["SMBACLEnabled"] = input.SMBACLEnabled; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.ValidUserList !== undefined) { - bodyParams["ValidUserList"] = serializeAws_json1_1FileShareUserList( - input.ValidUserList, - context - ); - } - return bodyParams; + return { + ...(input.AdminUserList !== undefined && { + AdminUserList: serializeAws_json1_1FileShareUserList( + input.AdminUserList, + context + ) + }), + ...(input.Authentication !== undefined && { + Authentication: input.Authentication + }), + ...(input.ClientToken !== undefined && { ClientToken: input.ClientToken }), + ...(input.DefaultStorageClass !== undefined && { + DefaultStorageClass: input.DefaultStorageClass + }), + ...(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.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 + ) + }) + }; }; const serializeAws_json1_1CreateSnapshotFromVolumeRecoveryPointInput = ( input: CreateSnapshotFromVolumeRecoveryPointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SnapshotDescription !== undefined) { - bodyParams["SnapshotDescription"] = input.SnapshotDescription; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.SnapshotDescription !== undefined && { + SnapshotDescription: input.SnapshotDescription + }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }), + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1CreateTapeWithBarcodeInput = ( input: CreateTapeWithBarcodeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.PoolId !== undefined) { - bodyParams["PoolId"] = input.PoolId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.TapeBarcode !== undefined) { - bodyParams["TapeBarcode"] = input.TapeBarcode; - } - if (input.TapeSizeInBytes !== undefined) { - bodyParams["TapeSizeInBytes"] = input.TapeSizeInBytes; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateTapesInput = ( input: CreateTapesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.NumTapesToCreate !== undefined) { - bodyParams["NumTapesToCreate"] = input.NumTapesToCreate; - } - if (input.PoolId !== undefined) { - bodyParams["PoolId"] = input.PoolId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.TapeBarcodePrefix !== undefined) { - bodyParams["TapeBarcodePrefix"] = input.TapeBarcodePrefix; - } - if (input.TapeSizeInBytes !== undefined) { - bodyParams["TapeSizeInBytes"] = input.TapeSizeInBytes; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteBandwidthRateLimitInput = ( input: DeleteBandwidthRateLimitInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BandwidthType !== undefined) { - bodyParams["BandwidthType"] = input.BandwidthType; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.BandwidthType !== undefined && { + BandwidthType: input.BandwidthType + }), + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DeleteFileShareInput = ( input: DeleteFileShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileShareARN !== undefined) { - bodyParams["FileShareARN"] = input.FileShareARN; - } - if (input.ForceDelete !== undefined) { - bodyParams["ForceDelete"] = input.ForceDelete; - } - return bodyParams; + return { + ...(input.FileShareARN !== undefined && { + FileShareARN: input.FileShareARN + }), + ...(input.ForceDelete !== undefined && { ForceDelete: input.ForceDelete }) + }; }; const serializeAws_json1_1DeleteTapeArchiveInput = ( input: DeleteTapeArchiveInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1DeleteTapeInput = ( input: DeleteTapeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1DescribeAvailabilityMonitorTestInput = ( input: DescribeAvailabilityMonitorTestInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DescribeNFSFileSharesInput = ( input: DescribeNFSFileSharesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileShareARNList !== undefined) { - bodyParams["FileShareARNList"] = serializeAws_json1_1FileShareARNList( - input.FileShareARNList, - context - ); - } - return bodyParams; + return { + ...(input.FileShareARNList !== undefined && { + FileShareARNList: serializeAws_json1_1FileShareARNList( + input.FileShareARNList, + context + ) + }) + }; }; const serializeAws_json1_1DescribeSMBFileSharesInput = ( input: DescribeSMBFileSharesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileShareARNList !== undefined) { - bodyParams["FileShareARNList"] = serializeAws_json1_1FileShareARNList( - input.FileShareARNList, - context - ); - } - return bodyParams; + return { + ...(input.FileShareARNList !== undefined && { + FileShareARNList: serializeAws_json1_1FileShareARNList( + input.FileShareARNList, + context + ) + }) + }; }; const serializeAws_json1_1DescribeSMBSettingsInput = ( input: DescribeSMBSettingsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1DescribeTapeArchivesInput = ( input: DescribeTapeArchivesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.TapeARNs !== undefined) { - bodyParams["TapeARNs"] = serializeAws_json1_1TapeARNs( - input.TapeARNs, - context - ); - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.TapeARNs !== undefined && { + TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) + }) + }; }; const serializeAws_json1_1DescribeTapeRecoveryPointsInput = ( input: DescribeTapeRecoveryPointsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1DescribeTapesInput = ( input: DescribeTapesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.TapeARNs !== undefined) { - bodyParams["TapeARNs"] = serializeAws_json1_1TapeARNs( - input.TapeARNs, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1DescribeVTLDevicesInput = ( input: DescribeVTLDevicesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.VTLDeviceARNs !== undefined) { - bodyParams["VTLDeviceARNs"] = serializeAws_json1_1VTLDeviceARNs( - input.VTLDeviceARNs, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DetachVolumeInput = ( input: DetachVolumeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ForceDetach !== undefined) { - bodyParams["ForceDetach"] = input.ForceDetach; - } - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.ForceDetach !== undefined && { ForceDetach: input.ForceDetach }), + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1DisableGatewayInput = ( input: DisableGatewayInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1FileShareARNList = ( @@ -8226,251 +8005,187 @@ const serializeAws_json1_1JoinDomainInput = ( input: JoinDomainInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DomainControllers !== undefined) { - bodyParams["DomainControllers"] = serializeAws_json1_1Hosts( - input.DomainControllers, - context - ); - } - if (input.DomainName !== undefined) { - bodyParams["DomainName"] = input.DomainName; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.OrganizationalUnit !== undefined) { - bodyParams["OrganizationalUnit"] = input.OrganizationalUnit; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.TimeoutInSeconds !== undefined) { - bodyParams["TimeoutInSeconds"] = input.TimeoutInSeconds; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListFileSharesInput = ( input: ListFileSharesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }) + }; }; const serializeAws_json1_1ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListTapesInput = ( input: ListTapesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.Marker !== undefined) { - bodyParams["Marker"] = input.Marker; - } - if (input.TapeARNs !== undefined) { - bodyParams["TapeARNs"] = serializeAws_json1_1TapeARNs( - input.TapeARNs, - context - ); - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.Marker !== undefined && { Marker: input.Marker }), + ...(input.TapeARNs !== undefined && { + TapeARNs: serializeAws_json1_1TapeARNs(input.TapeARNs, context) + }) + }; }; const serializeAws_json1_1ListVolumeInitiatorsInput = ( input: ListVolumeInitiatorsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VolumeARN !== undefined) { - bodyParams["VolumeARN"] = input.VolumeARN; - } - return bodyParams; + return { + ...(input.VolumeARN !== undefined && { VolumeARN: input.VolumeARN }) + }; }; const serializeAws_json1_1NFSFileShareDefaults = ( input: NFSFileShareDefaults, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryMode !== undefined) { - bodyParams["DirectoryMode"] = input.DirectoryMode; - } - if (input.FileMode !== undefined) { - bodyParams["FileMode"] = input.FileMode; - } - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.OwnerId !== undefined) { - bodyParams["OwnerId"] = input.OwnerId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1NotifyWhenUploadedInput = ( input: NotifyWhenUploadedInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileShareARN !== undefined) { - bodyParams["FileShareARN"] = input.FileShareARN; - } - return bodyParams; + return { + ...(input.FileShareARN !== undefined && { + FileShareARN: input.FileShareARN + }) + }; }; const serializeAws_json1_1RefreshCacheInput = ( input: RefreshCacheInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FileShareARN !== undefined) { - bodyParams["FileShareARN"] = input.FileShareARN; - } - if (input.FolderList !== undefined) { - bodyParams["FolderList"] = serializeAws_json1_1FolderList( - input.FolderList, - context - ); - } - if (input.Recursive !== undefined) { - bodyParams["Recursive"] = input.Recursive; - } - return bodyParams; + return { + ...(input.FileShareARN !== undefined && { + FileShareARN: input.FileShareARN + }), + ...(input.FolderList !== undefined && { + FolderList: serializeAws_json1_1FolderList(input.FolderList, context) + }), + ...(input.Recursive !== undefined && { Recursive: input.Recursive }) + }; }; const serializeAws_json1_1RemoveTagsFromResourceInput = ( input: RemoveTagsFromResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1ResetCacheInput = ( input: ResetCacheInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1RetrieveTapeArchiveInput = ( input: RetrieveTapeArchiveInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1RetrieveTapeRecoveryPointInput = ( input: RetrieveTapeRecoveryPointInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.TapeARN !== undefined) { - bodyParams["TapeARN"] = input.TapeARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.TapeARN !== undefined && { TapeARN: input.TapeARN }) + }; }; const serializeAws_json1_1SetLocalConsolePasswordInput = ( input: SetLocalConsolePasswordInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.LocalConsolePassword !== undefined) { - bodyParams["LocalConsolePassword"] = input.LocalConsolePassword; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.LocalConsolePassword !== undefined && { + LocalConsolePassword: input.LocalConsolePassword + }) + }; }; const serializeAws_json1_1SetSMBGuestPasswordInput = ( input: SetSMBGuestPasswordInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.Password !== undefined && { Password: input.Password }) + }; }; const serializeAws_json1_1StartAvailabilityMonitorTestInput = ( input: StartAvailabilityMonitorTestInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -8498,150 +8213,126 @@ const serializeAws_json1_1UpdateGatewayInformationInput = ( input: UpdateGatewayInformationInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchLogGroupARN !== undefined) { - bodyParams["CloudWatchLogGroupARN"] = input.CloudWatchLogGroupARN; - } - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.GatewayName !== undefined) { - bodyParams["GatewayName"] = input.GatewayName; - } - if (input.GatewayTimezone !== undefined) { - bodyParams["GatewayTimezone"] = input.GatewayTimezone; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1UpdateNFSFileShareInput = ( input: UpdateNFSFileShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientList !== undefined) { - bodyParams["ClientList"] = serializeAws_json1_1FileShareClientList( - input.ClientList, - context - ); - } - if (input.DefaultStorageClass !== undefined) { - bodyParams["DefaultStorageClass"] = input.DefaultStorageClass; - } - if (input.FileShareARN !== undefined) { - bodyParams["FileShareARN"] = input.FileShareARN; - } - if (input.GuessMIMETypeEnabled !== undefined) { - bodyParams["GuessMIMETypeEnabled"] = input.GuessMIMETypeEnabled; - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.NFSFileShareDefaults !== undefined) { - bodyParams[ - "NFSFileShareDefaults" - ] = serializeAws_json1_1NFSFileShareDefaults( - input.NFSFileShareDefaults, - context - ); - } - if (input.ObjectACL !== undefined) { - bodyParams["ObjectACL"] = input.ObjectACL; - } - if (input.ReadOnly !== undefined) { - bodyParams["ReadOnly"] = input.ReadOnly; - } - if (input.RequesterPays !== undefined) { - bodyParams["RequesterPays"] = input.RequesterPays; - } - if (input.Squash !== undefined) { - bodyParams["Squash"] = input.Squash; - } - return bodyParams; + return { + ...(input.ClientList !== undefined && { + ClientList: serializeAws_json1_1FileShareClientList( + input.ClientList, + context + ) + }), + ...(input.DefaultStorageClass !== undefined && { + DefaultStorageClass: input.DefaultStorageClass + }), + ...(input.FileShareARN !== undefined && { + FileShareARN: input.FileShareARN + }), + ...(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.ObjectACL !== undefined && { ObjectACL: input.ObjectACL }), + ...(input.ReadOnly !== undefined && { ReadOnly: input.ReadOnly }), + ...(input.RequesterPays !== undefined && { + RequesterPays: input.RequesterPays + }), + ...(input.Squash !== undefined && { Squash: input.Squash }) + }; }; const serializeAws_json1_1UpdateSMBFileShareInput = ( input: UpdateSMBFileShareInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AdminUserList !== undefined) { - bodyParams["AdminUserList"] = serializeAws_json1_1FileShareUserList( - input.AdminUserList, - context - ); - } - if (input.DefaultStorageClass !== undefined) { - bodyParams["DefaultStorageClass"] = input.DefaultStorageClass; - } - if (input.FileShareARN !== undefined) { - bodyParams["FileShareARN"] = input.FileShareARN; - } - if (input.GuessMIMETypeEnabled !== undefined) { - bodyParams["GuessMIMETypeEnabled"] = input.GuessMIMETypeEnabled; - } - if (input.InvalidUserList !== undefined) { - bodyParams["InvalidUserList"] = serializeAws_json1_1FileShareUserList( - input.InvalidUserList, - context - ); - } - if (input.KMSEncrypted !== undefined) { - bodyParams["KMSEncrypted"] = input.KMSEncrypted; - } - if (input.KMSKey !== undefined) { - bodyParams["KMSKey"] = input.KMSKey; - } - if (input.ObjectACL !== undefined) { - bodyParams["ObjectACL"] = input.ObjectACL; - } - if (input.ReadOnly !== undefined) { - bodyParams["ReadOnly"] = input.ReadOnly; - } - if (input.RequesterPays !== undefined) { - bodyParams["RequesterPays"] = input.RequesterPays; - } - if (input.SMBACLEnabled !== undefined) { - bodyParams["SMBACLEnabled"] = input.SMBACLEnabled; - } - if (input.ValidUserList !== undefined) { - bodyParams["ValidUserList"] = serializeAws_json1_1FileShareUserList( - input.ValidUserList, - context - ); - } - return bodyParams; + return { + ...(input.AdminUserList !== undefined && { + AdminUserList: serializeAws_json1_1FileShareUserList( + input.AdminUserList, + context + ) + }), + ...(input.DefaultStorageClass !== undefined && { + DefaultStorageClass: input.DefaultStorageClass + }), + ...(input.FileShareARN !== undefined && { + FileShareARN: input.FileShareARN + }), + ...(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.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 + ) + }) + }; }; const serializeAws_json1_1UpdateSMBSecurityStrategyInput = ( input: UpdateSMBSecurityStrategyInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GatewayARN !== undefined) { - bodyParams["GatewayARN"] = input.GatewayARN; - } - if (input.SMBSecurityStrategy !== undefined) { - bodyParams["SMBSecurityStrategy"] = input.SMBSecurityStrategy; - } - return bodyParams; + return { + ...(input.GatewayARN !== undefined && { GatewayARN: input.GatewayARN }), + ...(input.SMBSecurityStrategy !== undefined && { + SMBSecurityStrategy: input.SMBSecurityStrategy + }) + }; }; const serializeAws_json1_1UpdateVTLDeviceTypeInput = ( input: UpdateVTLDeviceTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceType !== undefined) { - bodyParams["DeviceType"] = input.DeviceType; - } - if (input.VTLDeviceARN !== undefined) { - bodyParams["VTLDeviceARN"] = input.VTLDeviceARN; - } - return bodyParams; + return { + ...(input.DeviceType !== undefined && { DeviceType: input.DeviceType }), + ...(input.VTLDeviceARN !== undefined && { + VTLDeviceARN: input.VTLDeviceARN + }) + }; }; const serializeAws_json1_1VTLDeviceARNs = ( diff --git a/clients/client-support/protocols/Aws_json1_1.ts b/clients/client-support/protocols/Aws_json1_1.ts index eb16e1884701..d66698834548 100644 --- a/clients/client-support/protocols/Aws_json1_1.ts +++ b/clients/client-support/protocols/Aws_json1_1.ts @@ -1557,14 +1557,12 @@ const serializeAws_json1_1Attachment = ( input: Attachment, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.data !== undefined) { - bodyParams["data"] = context.base64Encoder(input.data); - } - if (input.fileName !== undefined) { - bodyParams["fileName"] = input.fileName; - } - return bodyParams; + return { + ...(input.data !== undefined && { + data: context.base64Encoder(input.data) + }), + ...(input.fileName !== undefined && { fileName: input.fileName }) + }; }; const serializeAws_json1_1Attachments = ( @@ -1578,40 +1576,35 @@ const serializeAws_json1_1AddAttachmentsToSetRequest = ( input: AddAttachmentsToSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachmentSetId !== undefined) { - bodyParams["attachmentSetId"] = input.attachmentSetId; - } - if (input.attachments !== undefined) { - bodyParams["attachments"] = serializeAws_json1_1Attachments( - input.attachments, - context - ); - } - return bodyParams; + return { + ...(input.attachmentSetId !== undefined && { + attachmentSetId: input.attachmentSetId + }), + ...(input.attachments !== undefined && { + attachments: serializeAws_json1_1Attachments(input.attachments, context) + }) + }; }; const serializeAws_json1_1AddCommunicationToCaseRequest = ( input: AddCommunicationToCaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachmentSetId !== undefined) { - bodyParams["attachmentSetId"] = input.attachmentSetId; - } - if (input.caseId !== undefined) { - bodyParams["caseId"] = input.caseId; - } - if (input.ccEmailAddresses !== undefined) { - bodyParams["ccEmailAddresses"] = serializeAws_json1_1CcEmailAddressList( - input.ccEmailAddresses, - context - ); - } - if (input.communicationBody !== undefined) { - bodyParams["communicationBody"] = input.communicationBody; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CaseIdList = ( @@ -1632,149 +1625,110 @@ const serializeAws_json1_1CreateCaseRequest = ( input: CreateCaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachmentSetId !== undefined) { - bodyParams["attachmentSetId"] = input.attachmentSetId; - } - if (input.categoryCode !== undefined) { - bodyParams["categoryCode"] = input.categoryCode; - } - if (input.ccEmailAddresses !== undefined) { - bodyParams["ccEmailAddresses"] = serializeAws_json1_1CcEmailAddressList( - input.ccEmailAddresses, - context - ); - } - if (input.communicationBody !== undefined) { - bodyParams["communicationBody"] = input.communicationBody; - } - if (input.issueType !== undefined) { - bodyParams["issueType"] = input.issueType; - } - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - if (input.serviceCode !== undefined) { - bodyParams["serviceCode"] = input.serviceCode; - } - if (input.severityCode !== undefined) { - bodyParams["severityCode"] = input.severityCode; - } - if (input.subject !== undefined) { - bodyParams["subject"] = input.subject; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeAttachmentRequest = ( input: DescribeAttachmentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.attachmentId !== undefined) { - bodyParams["attachmentId"] = input.attachmentId; - } - return bodyParams; + return { + ...(input.attachmentId !== undefined && { + attachmentId: input.attachmentId + }) + }; }; const serializeAws_json1_1DescribeCasesRequest = ( input: DescribeCasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.afterTime !== undefined) { - bodyParams["afterTime"] = input.afterTime; - } - if (input.beforeTime !== undefined) { - bodyParams["beforeTime"] = input.beforeTime; - } - if (input.caseIdList !== undefined) { - bodyParams["caseIdList"] = serializeAws_json1_1CaseIdList( - input.caseIdList, - context - ); - } - if (input.displayId !== undefined) { - bodyParams["displayId"] = input.displayId; - } - if (input.includeCommunications !== undefined) { - bodyParams["includeCommunications"] = input.includeCommunications; - } - if (input.includeResolvedCases !== undefined) { - bodyParams["includeResolvedCases"] = input.includeResolvedCases; - } - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeCommunicationsRequest = ( input: DescribeCommunicationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.afterTime !== undefined) { - bodyParams["afterTime"] = input.afterTime; - } - if (input.beforeTime !== undefined) { - bodyParams["beforeTime"] = input.beforeTime; - } - if (input.caseId !== undefined) { - bodyParams["caseId"] = input.caseId; - } - if (input.maxResults !== undefined) { - bodyParams["maxResults"] = input.maxResults; - } - if (input.nextToken !== undefined) { - bodyParams["nextToken"] = input.nextToken; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeServicesRequest = ( input: DescribeServicesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - if (input.serviceCodeList !== undefined) { - bodyParams["serviceCodeList"] = serializeAws_json1_1ServiceCodeList( - input.serviceCodeList, - context - ); - } - return bodyParams; + return { + ...(input.language !== undefined && { language: input.language }), + ...(input.serviceCodeList !== undefined && { + serviceCodeList: serializeAws_json1_1ServiceCodeList( + input.serviceCodeList, + context + ) + }) + }; }; const serializeAws_json1_1DescribeSeverityLevelsRequest = ( input: DescribeSeverityLevelsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - return bodyParams; + return { + ...(input.language !== undefined && { language: input.language }) + }; }; const serializeAws_json1_1ResolveCaseRequest = ( input: ResolveCaseRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.caseId !== undefined) { - bodyParams["caseId"] = input.caseId; - } - return bodyParams; + return { + ...(input.caseId !== undefined && { caseId: input.caseId }) + }; }; const serializeAws_json1_1ServiceCodeList = ( @@ -1788,64 +1742,50 @@ const serializeAws_json1_1DescribeTrustedAdvisorCheckRefreshStatusesRequest = ( input: DescribeTrustedAdvisorCheckRefreshStatusesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.checkIds !== undefined) { - bodyParams["checkIds"] = serializeAws_json1_1StringList( - input.checkIds, - context - ); - } - return bodyParams; + return { + ...(input.checkIds !== undefined && { + checkIds: serializeAws_json1_1StringList(input.checkIds, context) + }) + }; }; const serializeAws_json1_1DescribeTrustedAdvisorCheckResultRequest = ( input: DescribeTrustedAdvisorCheckResultRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.checkId !== undefined) { - bodyParams["checkId"] = input.checkId; - } - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - return bodyParams; + return { + ...(input.checkId !== undefined && { checkId: input.checkId }), + ...(input.language !== undefined && { language: input.language }) + }; }; const serializeAws_json1_1DescribeTrustedAdvisorCheckSummariesRequest = ( input: DescribeTrustedAdvisorCheckSummariesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.checkIds !== undefined) { - bodyParams["checkIds"] = serializeAws_json1_1StringList( - input.checkIds, - context - ); - } - return bodyParams; + return { + ...(input.checkIds !== undefined && { + checkIds: serializeAws_json1_1StringList(input.checkIds, context) + }) + }; }; const serializeAws_json1_1DescribeTrustedAdvisorChecksRequest = ( input: DescribeTrustedAdvisorChecksRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.language !== undefined) { - bodyParams["language"] = input.language; - } - return bodyParams; + return { + ...(input.language !== undefined && { language: input.language }) + }; }; const serializeAws_json1_1RefreshTrustedAdvisorCheckRequest = ( input: RefreshTrustedAdvisorCheckRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.checkId !== undefined) { - bodyParams["checkId"] = input.checkId; - } - return bodyParams; + return { + ...(input.checkId !== undefined && { checkId: input.checkId }) + }; }; const serializeAws_json1_1StringList = ( diff --git a/clients/client-swf/protocols/Aws_json1_0.ts b/clients/client-swf/protocols/Aws_json1_0.ts index b237fdc0567b..f66cf9419e4b 100644 --- a/clients/client-swf/protocols/Aws_json1_0.ts +++ b/clients/client-swf/protocols/Aws_json1_0.ts @@ -3915,214 +3915,167 @@ const serializeAws_json1_0ActivityType = ( input: ActivityType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_json1_0CancelTimerDecisionAttributes = ( input: CancelTimerDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.timerId !== undefined) { - bodyParams["timerId"] = input.timerId; - } - return bodyParams; + return { + ...(input.timerId !== undefined && { timerId: input.timerId }) + }; }; const serializeAws_json1_0CancelWorkflowExecutionDecisionAttributes = ( input: CancelWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - return bodyParams; + return { + ...(input.details !== undefined && { details: input.details }) + }; }; const serializeAws_json1_0CloseStatusFilter = ( input: CloseStatusFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.status !== undefined) { - bodyParams["status"] = input.status; - } - return bodyParams; + return { + ...(input.status !== undefined && { status: input.status }) + }; }; const serializeAws_json1_0CompleteWorkflowExecutionDecisionAttributes = ( input: CompleteWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.result !== undefined) { - bodyParams["result"] = input.result; - } - return bodyParams; + return { + ...(input.result !== undefined && { result: input.result }) + }; }; const serializeAws_json1_0ContinueAsNewWorkflowExecutionDecisionAttributes = ( input: ContinueAsNewWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.childPolicy !== undefined) { - bodyParams["childPolicy"] = input.childPolicy; - } - if (input.executionStartToCloseTimeout !== undefined) { - bodyParams["executionStartToCloseTimeout"] = - input.executionStartToCloseTimeout; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.lambdaRole !== undefined) { - bodyParams["lambdaRole"] = input.lambdaRole; - } - if (input.tagList !== undefined) { - bodyParams["tagList"] = serializeAws_json1_0TagList(input.tagList, context); - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - if (input.taskPriority !== undefined) { - bodyParams["taskPriority"] = input.taskPriority; - } - if (input.taskStartToCloseTimeout !== undefined) { - bodyParams["taskStartToCloseTimeout"] = input.taskStartToCloseTimeout; - } - if (input.workflowTypeVersion !== undefined) { - bodyParams["workflowTypeVersion"] = input.workflowTypeVersion; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0Decision = ( input: Decision, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.cancelTimerDecisionAttributes !== undefined) { - bodyParams[ - "cancelTimerDecisionAttributes" - ] = serializeAws_json1_0CancelTimerDecisionAttributes( - input.cancelTimerDecisionAttributes, - context - ); - } - if (input.cancelWorkflowExecutionDecisionAttributes !== undefined) { - bodyParams[ - "cancelWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0CancelWorkflowExecutionDecisionAttributes( - input.cancelWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.completeWorkflowExecutionDecisionAttributes !== undefined) { - bodyParams[ - "completeWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0CompleteWorkflowExecutionDecisionAttributes( - input.completeWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.continueAsNewWorkflowExecutionDecisionAttributes !== undefined) { - bodyParams[ - "continueAsNewWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0ContinueAsNewWorkflowExecutionDecisionAttributes( - input.continueAsNewWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.decisionType !== undefined) { - bodyParams["decisionType"] = input.decisionType; - } - if (input.failWorkflowExecutionDecisionAttributes !== undefined) { - bodyParams[ - "failWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0FailWorkflowExecutionDecisionAttributes( - input.failWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.recordMarkerDecisionAttributes !== undefined) { - bodyParams[ - "recordMarkerDecisionAttributes" - ] = serializeAws_json1_0RecordMarkerDecisionAttributes( - input.recordMarkerDecisionAttributes, - context - ); - } - if (input.requestCancelActivityTaskDecisionAttributes !== undefined) { - bodyParams[ - "requestCancelActivityTaskDecisionAttributes" - ] = serializeAws_json1_0RequestCancelActivityTaskDecisionAttributes( - input.requestCancelActivityTaskDecisionAttributes, - context - ); - } - if ( - input.requestCancelExternalWorkflowExecutionDecisionAttributes !== undefined - ) { - bodyParams[ - "requestCancelExternalWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0RequestCancelExternalWorkflowExecutionDecisionAttributes( - input.requestCancelExternalWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.scheduleActivityTaskDecisionAttributes !== undefined) { - bodyParams[ - "scheduleActivityTaskDecisionAttributes" - ] = serializeAws_json1_0ScheduleActivityTaskDecisionAttributes( - input.scheduleActivityTaskDecisionAttributes, - context - ); - } - if (input.scheduleLambdaFunctionDecisionAttributes !== undefined) { - bodyParams[ - "scheduleLambdaFunctionDecisionAttributes" - ] = serializeAws_json1_0ScheduleLambdaFunctionDecisionAttributes( - input.scheduleLambdaFunctionDecisionAttributes, - context - ); - } - if (input.signalExternalWorkflowExecutionDecisionAttributes !== undefined) { - bodyParams[ - "signalExternalWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0SignalExternalWorkflowExecutionDecisionAttributes( - input.signalExternalWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.startChildWorkflowExecutionDecisionAttributes !== undefined) { - bodyParams[ - "startChildWorkflowExecutionDecisionAttributes" - ] = serializeAws_json1_0StartChildWorkflowExecutionDecisionAttributes( - input.startChildWorkflowExecutionDecisionAttributes, - context - ); - } - if (input.startTimerDecisionAttributes !== undefined) { - bodyParams[ - "startTimerDecisionAttributes" - ] = serializeAws_json1_0StartTimerDecisionAttributes( - input.startTimerDecisionAttributes, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0DecisionList = ( @@ -4136,84 +4089,64 @@ const serializeAws_json1_0ExecutionTimeFilter = ( input: ExecutionTimeFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.latestDate !== undefined) { - bodyParams["latestDate"] = Math.round(input.latestDate.getTime() / 1000); - } - if (input.oldestDate !== undefined) { - bodyParams["oldestDate"] = Math.round(input.oldestDate.getTime() / 1000); - } - return bodyParams; + return { + ...(input.latestDate !== undefined && { + latestDate: Math.round(input.latestDate.getTime() / 1000) + }), + ...(input.oldestDate !== undefined && { + oldestDate: Math.round(input.oldestDate.getTime() / 1000) + }) + }; }; const serializeAws_json1_0FailWorkflowExecutionDecisionAttributes = ( input: FailWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - return bodyParams; + return { + ...(input.details !== undefined && { details: input.details }), + ...(input.reason !== undefined && { reason: input.reason }) + }; }; const serializeAws_json1_0RecordMarkerDecisionAttributes = ( input: RecordMarkerDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - if (input.markerName !== undefined) { - bodyParams["markerName"] = input.markerName; - } - return bodyParams; + return { + ...(input.details !== undefined && { details: input.details }), + ...(input.markerName !== undefined && { markerName: input.markerName }) + }; }; const serializeAws_json1_0RequestCancelActivityTaskDecisionAttributes = ( input: RequestCancelActivityTaskDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityId !== undefined) { - bodyParams["activityId"] = input.activityId; - } - return bodyParams; + return { + ...(input.activityId !== undefined && { activityId: input.activityId }) + }; }; const serializeAws_json1_0RequestCancelExternalWorkflowExecutionDecisionAttributes = ( input: RequestCancelExternalWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.control !== undefined) { - bodyParams["control"] = input.control; - } - if (input.runId !== undefined) { - bodyParams["runId"] = input.runId; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + return { + ...(input.control !== undefined && { control: input.control }), + ...(input.runId !== undefined && { runId: input.runId }), + ...(input.workflowId !== undefined && { workflowId: input.workflowId }) + }; }; const serializeAws_json1_0ResourceTag = ( input: ResourceTag, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.key !== undefined) { - bodyParams["key"] = input.key; - } - if (input.value !== undefined) { - bodyParams["value"] = input.value; - } - return bodyParams; + return { + ...(input.key !== undefined && { key: input.key }), + ...(input.value !== undefined && { value: input.value }) + }; }; const serializeAws_json1_0ResourceTagKeyList = ( @@ -4234,166 +4167,119 @@ const serializeAws_json1_0ScheduleActivityTaskDecisionAttributes = ( input: ScheduleActivityTaskDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityId !== undefined) { - bodyParams["activityId"] = input.activityId; - } - if (input.activityType !== undefined) { - bodyParams["activityType"] = serializeAws_json1_0ActivityType( - input.activityType, - context - ); - } - if (input.control !== undefined) { - bodyParams["control"] = input.control; - } - if (input.heartbeatTimeout !== undefined) { - bodyParams["heartbeatTimeout"] = input.heartbeatTimeout; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.scheduleToCloseTimeout !== undefined) { - bodyParams["scheduleToCloseTimeout"] = input.scheduleToCloseTimeout; - } - if (input.scheduleToStartTimeout !== undefined) { - bodyParams["scheduleToStartTimeout"] = input.scheduleToStartTimeout; - } - if (input.startToCloseTimeout !== undefined) { - bodyParams["startToCloseTimeout"] = input.startToCloseTimeout; - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - if (input.taskPriority !== undefined) { - bodyParams["taskPriority"] = input.taskPriority; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ScheduleLambdaFunctionDecisionAttributes = ( input: ScheduleLambdaFunctionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.control !== undefined) { - bodyParams["control"] = input.control; - } - if (input.id !== undefined) { - bodyParams["id"] = input.id; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.startToCloseTimeout !== undefined) { - bodyParams["startToCloseTimeout"] = input.startToCloseTimeout; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0SignalExternalWorkflowExecutionDecisionAttributes = ( input: SignalExternalWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.control !== undefined) { - bodyParams["control"] = input.control; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.runId !== undefined) { - bodyParams["runId"] = input.runId; - } - if (input.signalName !== undefined) { - bodyParams["signalName"] = input.signalName; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0StartChildWorkflowExecutionDecisionAttributes = ( input: StartChildWorkflowExecutionDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.childPolicy !== undefined) { - bodyParams["childPolicy"] = input.childPolicy; - } - if (input.control !== undefined) { - bodyParams["control"] = input.control; - } - if (input.executionStartToCloseTimeout !== undefined) { - bodyParams["executionStartToCloseTimeout"] = - input.executionStartToCloseTimeout; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.lambdaRole !== undefined) { - bodyParams["lambdaRole"] = input.lambdaRole; - } - if (input.tagList !== undefined) { - bodyParams["tagList"] = serializeAws_json1_0TagList(input.tagList, context); - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - if (input.taskPriority !== undefined) { - bodyParams["taskPriority"] = input.taskPriority; - } - if (input.taskStartToCloseTimeout !== undefined) { - bodyParams["taskStartToCloseTimeout"] = input.taskStartToCloseTimeout; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - if (input.workflowType !== undefined) { - bodyParams["workflowType"] = serializeAws_json1_0WorkflowType( - input.workflowType, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0StartTimerDecisionAttributes = ( input: StartTimerDecisionAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.control !== undefined) { - bodyParams["control"] = input.control; - } - if (input.startToFireTimeout !== undefined) { - bodyParams["startToFireTimeout"] = input.startToFireTimeout; - } - if (input.timerId !== undefined) { - bodyParams["timerId"] = input.timerId; - } - return bodyParams; + return { + ...(input.control !== undefined && { control: input.control }), + ...(input.startToFireTimeout !== undefined && { + startToFireTimeout: input.startToFireTimeout + }), + ...(input.timerId !== undefined && { timerId: input.timerId }) + }; }; const serializeAws_json1_0TagFilter = ( input: TagFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.tag !== undefined) { - bodyParams["tag"] = input.tag; - } - return bodyParams; + return { + ...(input.tag !== undefined && { tag: input.tag }) + }; }; const serializeAws_json1_0TagList = ( @@ -4407,929 +4293,728 @@ const serializeAws_json1_0TaskList = ( input: TaskList, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_0WorkflowExecution = ( input: WorkflowExecution, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.runId !== undefined) { - bodyParams["runId"] = input.runId; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + return { + ...(input.runId !== undefined && { runId: input.runId }), + ...(input.workflowId !== undefined && { workflowId: input.workflowId }) + }; }; const serializeAws_json1_0WorkflowExecutionFilter = ( input: WorkflowExecutionFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + return { + ...(input.workflowId !== undefined && { workflowId: input.workflowId }) + }; }; const serializeAws_json1_0WorkflowType = ( input: WorkflowType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_json1_0WorkflowTypeFilter = ( input: WorkflowTypeFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }), + ...(input.version !== undefined && { version: input.version }) + }; }; const serializeAws_json1_0CountClosedWorkflowExecutionsInput = ( input: CountClosedWorkflowExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.closeStatusFilter !== undefined) { - bodyParams["closeStatusFilter"] = serializeAws_json1_0CloseStatusFilter( - input.closeStatusFilter, - context - ); - } - if (input.closeTimeFilter !== undefined) { - bodyParams["closeTimeFilter"] = serializeAws_json1_0ExecutionTimeFilter( - input.closeTimeFilter, - context - ); - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.executionFilter !== undefined) { - bodyParams["executionFilter"] = serializeAws_json1_0WorkflowExecutionFilter( - input.executionFilter, - context - ); - } - if (input.startTimeFilter !== undefined) { - bodyParams["startTimeFilter"] = serializeAws_json1_0ExecutionTimeFilter( - input.startTimeFilter, - context - ); - } - if (input.tagFilter !== undefined) { - bodyParams["tagFilter"] = serializeAws_json1_0TagFilter( - input.tagFilter, - context - ); - } - if (input.typeFilter !== undefined) { - bodyParams["typeFilter"] = serializeAws_json1_0WorkflowTypeFilter( - input.typeFilter, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0CountOpenWorkflowExecutionsInput = ( input: CountOpenWorkflowExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.executionFilter !== undefined) { - bodyParams["executionFilter"] = serializeAws_json1_0WorkflowExecutionFilter( - input.executionFilter, - context - ); - } - if (input.startTimeFilter !== undefined) { - bodyParams["startTimeFilter"] = serializeAws_json1_0ExecutionTimeFilter( - input.startTimeFilter, - context - ); - } - if (input.tagFilter !== undefined) { - bodyParams["tagFilter"] = serializeAws_json1_0TagFilter( - input.tagFilter, - context - ); - } - if (input.typeFilter !== undefined) { - bodyParams["typeFilter"] = serializeAws_json1_0WorkflowTypeFilter( - input.typeFilter, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0CountPendingActivityTasksInput = ( input: CountPendingActivityTasksInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.taskList !== undefined && { + taskList: serializeAws_json1_0TaskList(input.taskList, context) + }) + }; }; const serializeAws_json1_0CountPendingDecisionTasksInput = ( input: CountPendingDecisionTasksInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.taskList !== undefined && { + taskList: serializeAws_json1_0TaskList(input.taskList, context) + }) + }; }; const serializeAws_json1_0DeprecateActivityTypeInput = ( input: DeprecateActivityTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityType !== undefined) { - bodyParams["activityType"] = serializeAws_json1_0ActivityType( - input.activityType, - context - ); - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - return bodyParams; + return { + ...(input.activityType !== undefined && { + activityType: serializeAws_json1_0ActivityType( + input.activityType, + context + ) + }), + ...(input.domain !== undefined && { domain: input.domain }) + }; }; const serializeAws_json1_0DeprecateDomainInput = ( input: DeprecateDomainInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_0DeprecateWorkflowTypeInput = ( input: DeprecateWorkflowTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.workflowType !== undefined) { - bodyParams["workflowType"] = serializeAws_json1_0WorkflowType( - input.workflowType, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.workflowType !== undefined && { + workflowType: serializeAws_json1_0WorkflowType( + input.workflowType, + context + ) + }) + }; }; const serializeAws_json1_0DescribeActivityTypeInput = ( input: DescribeActivityTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityType !== undefined) { - bodyParams["activityType"] = serializeAws_json1_0ActivityType( - input.activityType, - context - ); - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - return bodyParams; + return { + ...(input.activityType !== undefined && { + activityType: serializeAws_json1_0ActivityType( + input.activityType, + context + ) + }), + ...(input.domain !== undefined && { domain: input.domain }) + }; }; const serializeAws_json1_0DescribeDomainInput = ( input: DescribeDomainInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_0DescribeWorkflowExecutionInput = ( input: DescribeWorkflowExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.execution !== undefined) { - bodyParams["execution"] = serializeAws_json1_0WorkflowExecution( - input.execution, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.execution !== undefined && { + execution: serializeAws_json1_0WorkflowExecution(input.execution, context) + }) + }; }; const serializeAws_json1_0DescribeWorkflowTypeInput = ( input: DescribeWorkflowTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.workflowType !== undefined) { - bodyParams["workflowType"] = serializeAws_json1_0WorkflowType( - input.workflowType, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.workflowType !== undefined && { + workflowType: serializeAws_json1_0WorkflowType( + input.workflowType, + context + ) + }) + }; }; const serializeAws_json1_0GetWorkflowExecutionHistoryInput = ( input: GetWorkflowExecutionHistoryInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.execution !== undefined) { - bodyParams["execution"] = serializeAws_json1_0WorkflowExecution( - input.execution, - context - ); - } - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ListActivityTypesInput = ( input: ListActivityTypesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.registrationStatus !== undefined) { - bodyParams["registrationStatus"] = input.registrationStatus; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ListClosedWorkflowExecutionsInput = ( input: ListClosedWorkflowExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.closeStatusFilter !== undefined) { - bodyParams["closeStatusFilter"] = serializeAws_json1_0CloseStatusFilter( - input.closeStatusFilter, - context - ); - } - if (input.closeTimeFilter !== undefined) { - bodyParams["closeTimeFilter"] = serializeAws_json1_0ExecutionTimeFilter( - input.closeTimeFilter, - context - ); - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.executionFilter !== undefined) { - bodyParams["executionFilter"] = serializeAws_json1_0WorkflowExecutionFilter( - input.executionFilter, - context - ); - } - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - if (input.startTimeFilter !== undefined) { - bodyParams["startTimeFilter"] = serializeAws_json1_0ExecutionTimeFilter( - input.startTimeFilter, - context - ); - } - if (input.tagFilter !== undefined) { - bodyParams["tagFilter"] = serializeAws_json1_0TagFilter( - input.tagFilter, - context - ); - } - if (input.typeFilter !== undefined) { - bodyParams["typeFilter"] = serializeAws_json1_0WorkflowTypeFilter( - input.typeFilter, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0ListDomainsInput = ( input: ListDomainsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.registrationStatus !== undefined) { - bodyParams["registrationStatus"] = input.registrationStatus; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0ListOpenWorkflowExecutionsInput = ( input: ListOpenWorkflowExecutionsInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.executionFilter !== undefined) { - bodyParams["executionFilter"] = serializeAws_json1_0WorkflowExecutionFilter( - input.executionFilter, - context - ); - } - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - if (input.startTimeFilter !== undefined) { - bodyParams["startTimeFilter"] = serializeAws_json1_0ExecutionTimeFilter( - input.startTimeFilter, - context - ); - } - if (input.tagFilter !== undefined) { - bodyParams["tagFilter"] = serializeAws_json1_0TagFilter( - input.tagFilter, - context - ); - } - if (input.typeFilter !== undefined) { - bodyParams["typeFilter"] = serializeAws_json1_0WorkflowTypeFilter( - input.typeFilter, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0ListTagsForResourceInput = ( input: ListTagsForResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }) + }; }; const serializeAws_json1_0ListWorkflowTypesInput = ( input: ListWorkflowTypesInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.registrationStatus !== undefined) { - bodyParams["registrationStatus"] = input.registrationStatus; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0PollForActivityTaskInput = ( input: PollForActivityTaskInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.identity !== undefined) { - bodyParams["identity"] = input.identity; - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.identity !== undefined && { identity: input.identity }), + ...(input.taskList !== undefined && { + taskList: serializeAws_json1_0TaskList(input.taskList, context) + }) + }; }; const serializeAws_json1_0PollForDecisionTaskInput = ( input: PollForDecisionTaskInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.identity !== undefined) { - bodyParams["identity"] = input.identity; - } - if (input.maximumPageSize !== undefined) { - bodyParams["maximumPageSize"] = input.maximumPageSize; - } - if (input.nextPageToken !== undefined) { - bodyParams["nextPageToken"] = input.nextPageToken; - } - if (input.reverseOrder !== undefined) { - bodyParams["reverseOrder"] = input.reverseOrder; - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_0RecordActivityTaskHeartbeatInput = ( input: RecordActivityTaskHeartbeatInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.details !== undefined && { details: input.details }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0RegisterActivityTypeInput = ( input: RegisterActivityTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultTaskHeartbeatTimeout !== undefined) { - bodyParams["defaultTaskHeartbeatTimeout"] = - input.defaultTaskHeartbeatTimeout; - } - if (input.defaultTaskList !== undefined) { - bodyParams["defaultTaskList"] = serializeAws_json1_0TaskList( - input.defaultTaskList, - context - ); - } - if (input.defaultTaskPriority !== undefined) { - bodyParams["defaultTaskPriority"] = input.defaultTaskPriority; - } - if (input.defaultTaskScheduleToCloseTimeout !== undefined) { - bodyParams["defaultTaskScheduleToCloseTimeout"] = - input.defaultTaskScheduleToCloseTimeout; - } - if (input.defaultTaskScheduleToStartTimeout !== undefined) { - bodyParams["defaultTaskScheduleToStartTimeout"] = - input.defaultTaskScheduleToStartTimeout; - } - if (input.defaultTaskStartToCloseTimeout !== undefined) { - bodyParams["defaultTaskStartToCloseTimeout"] = - input.defaultTaskStartToCloseTimeout; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0RegisterDomainInput = ( input: RegisterDomainInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_0ResourceTagList( - input.tags, - context - ); - } - if (input.workflowExecutionRetentionPeriodInDays !== undefined) { - bodyParams["workflowExecutionRetentionPeriodInDays"] = - input.workflowExecutionRetentionPeriodInDays; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_0RegisterWorkflowTypeInput = ( input: RegisterWorkflowTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.defaultChildPolicy !== undefined) { - bodyParams["defaultChildPolicy"] = input.defaultChildPolicy; - } - if (input.defaultExecutionStartToCloseTimeout !== undefined) { - bodyParams["defaultExecutionStartToCloseTimeout"] = - input.defaultExecutionStartToCloseTimeout; - } - if (input.defaultLambdaRole !== undefined) { - bodyParams["defaultLambdaRole"] = input.defaultLambdaRole; - } - if (input.defaultTaskList !== undefined) { - bodyParams["defaultTaskList"] = serializeAws_json1_0TaskList( - input.defaultTaskList, - context - ); - } - if (input.defaultTaskPriority !== undefined) { - bodyParams["defaultTaskPriority"] = input.defaultTaskPriority; - } - if (input.defaultTaskStartToCloseTimeout !== undefined) { - bodyParams["defaultTaskStartToCloseTimeout"] = - input.defaultTaskStartToCloseTimeout; - } - if (input.description !== undefined) { - bodyParams["description"] = input.description; - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - if (input.version !== undefined) { - bodyParams["version"] = input.version; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0RequestCancelWorkflowExecutionInput = ( input: RequestCancelWorkflowExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.runId !== undefined) { - bodyParams["runId"] = input.runId; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.runId !== undefined && { runId: input.runId }), + ...(input.workflowId !== undefined && { workflowId: input.workflowId }) + }; }; const serializeAws_json1_0RespondActivityTaskCanceledInput = ( input: RespondActivityTaskCanceledInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.details !== undefined && { details: input.details }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0RespondActivityTaskCompletedInput = ( input: RespondActivityTaskCompletedInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.result !== undefined) { - bodyParams["result"] = input.result; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.result !== undefined && { result: input.result }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0RespondActivityTaskFailedInput = ( input: RespondActivityTaskFailedInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.details !== undefined && { details: input.details }), + ...(input.reason !== undefined && { reason: input.reason }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0RespondDecisionTaskCompletedInput = ( input: RespondDecisionTaskCompletedInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.decisions !== undefined) { - bodyParams["decisions"] = serializeAws_json1_0DecisionList( - input.decisions, - context - ); - } - if (input.executionContext !== undefined) { - bodyParams["executionContext"] = input.executionContext; - } - if (input.taskToken !== undefined) { - bodyParams["taskToken"] = input.taskToken; - } - return bodyParams; + return { + ...(input.decisions !== undefined && { + decisions: serializeAws_json1_0DecisionList(input.decisions, context) + }), + ...(input.executionContext !== undefined && { + executionContext: input.executionContext + }), + ...(input.taskToken !== undefined && { taskToken: input.taskToken }) + }; }; const serializeAws_json1_0SignalWorkflowExecutionInput = ( input: SignalWorkflowExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.runId !== undefined) { - bodyParams["runId"] = input.runId; - } - if (input.signalName !== undefined) { - bodyParams["signalName"] = input.signalName; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0StartWorkflowExecutionInput = ( input: StartWorkflowExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.childPolicy !== undefined) { - bodyParams["childPolicy"] = input.childPolicy; - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.executionStartToCloseTimeout !== undefined) { - bodyParams["executionStartToCloseTimeout"] = - input.executionStartToCloseTimeout; - } - if (input.input !== undefined) { - bodyParams["input"] = input.input; - } - if (input.lambdaRole !== undefined) { - bodyParams["lambdaRole"] = input.lambdaRole; - } - if (input.tagList !== undefined) { - bodyParams["tagList"] = serializeAws_json1_0TagList(input.tagList, context); - } - if (input.taskList !== undefined) { - bodyParams["taskList"] = serializeAws_json1_0TaskList( - input.taskList, - context - ); - } - if (input.taskPriority !== undefined) { - bodyParams["taskPriority"] = input.taskPriority; - } - if (input.taskStartToCloseTimeout !== undefined) { - bodyParams["taskStartToCloseTimeout"] = input.taskStartToCloseTimeout; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - if (input.workflowType !== undefined) { - bodyParams["workflowType"] = serializeAws_json1_0WorkflowType( - input.workflowType, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_0TagResourceInput = ( input: TagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tags !== undefined) { - bodyParams["tags"] = serializeAws_json1_0ResourceTagList( - input.tags, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tags !== undefined && { + tags: serializeAws_json1_0ResourceTagList(input.tags, context) + }) + }; }; const serializeAws_json1_0TerminateWorkflowExecutionInput = ( input: TerminateWorkflowExecutionInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.childPolicy !== undefined) { - bodyParams["childPolicy"] = input.childPolicy; - } - if (input.details !== undefined) { - bodyParams["details"] = input.details; - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.reason !== undefined) { - bodyParams["reason"] = input.reason; - } - if (input.runId !== undefined) { - bodyParams["runId"] = input.runId; - } - if (input.workflowId !== undefined) { - bodyParams["workflowId"] = input.workflowId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_0UndeprecateActivityTypeInput = ( input: UndeprecateActivityTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.activityType !== undefined) { - bodyParams["activityType"] = serializeAws_json1_0ActivityType( - input.activityType, - context - ); - } - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - return bodyParams; + return { + ...(input.activityType !== undefined && { + activityType: serializeAws_json1_0ActivityType( + input.activityType, + context + ) + }), + ...(input.domain !== undefined && { domain: input.domain }) + }; }; const serializeAws_json1_0UndeprecateDomainInput = ( input: UndeprecateDomainInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_json1_0UndeprecateWorkflowTypeInput = ( input: UndeprecateWorkflowTypeInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.domain !== undefined) { - bodyParams["domain"] = input.domain; - } - if (input.workflowType !== undefined) { - bodyParams["workflowType"] = serializeAws_json1_0WorkflowType( - input.workflowType, - context - ); - } - return bodyParams; + return { + ...(input.domain !== undefined && { domain: input.domain }), + ...(input.workflowType !== undefined && { + workflowType: serializeAws_json1_0WorkflowType( + input.workflowType, + context + ) + }) + }; }; const serializeAws_json1_0UntagResourceInput = ( input: UntagResourceInput, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.resourceArn !== undefined) { - bodyParams["resourceArn"] = input.resourceArn; - } - if (input.tagKeys !== undefined) { - bodyParams["tagKeys"] = serializeAws_json1_0ResourceTagKeyList( - input.tagKeys, - context - ); - } - return bodyParams; + return { + ...(input.resourceArn !== undefined && { resourceArn: input.resourceArn }), + ...(input.tagKeys !== undefined && { + tagKeys: serializeAws_json1_0ResourceTagKeyList(input.tagKeys, context) + }) + }; }; const deserializeAws_json1_0ActivityTask = ( diff --git a/clients/client-textract/protocols/Aws_json1_1.ts b/clients/client-textract/protocols/Aws_json1_1.ts index d417ce406869..b9620d48e91d 100644 --- a/clients/client-textract/protocols/Aws_json1_1.ts +++ b/clients/client-textract/protocols/Aws_json1_1.ts @@ -1308,26 +1308,23 @@ const serializeAws_json1_1AnalyzeDocumentRequest = ( input: AnalyzeDocumentRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Document !== undefined) { - bodyParams["Document"] = serializeAws_json1_1Document( - input.Document, - context - ); - } - if (input.FeatureTypes !== undefined) { - bodyParams["FeatureTypes"] = serializeAws_json1_1FeatureTypes( - input.FeatureTypes, - context - ); - } - if (input.HumanLoopConfig !== undefined) { - bodyParams["HumanLoopConfig"] = serializeAws_json1_1HumanLoopConfig( - input.HumanLoopConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1ContentClassifiers = ( @@ -1341,45 +1338,36 @@ const serializeAws_json1_1DetectDocumentTextRequest = ( input: DetectDocumentTextRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Document !== undefined) { - bodyParams["Document"] = serializeAws_json1_1Document( - input.Document, - context - ); - } - return bodyParams; + return { + ...(input.Document !== undefined && { + Document: serializeAws_json1_1Document(input.Document, context) + }) + }; }; const serializeAws_json1_1Document = ( input: Document, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bytes !== undefined) { - bodyParams["Bytes"] = context.base64Encoder(input.Bytes); - } - if (input.S3Object !== undefined) { - bodyParams["S3Object"] = serializeAws_json1_1S3Object( - input.S3Object, - context - ); - } - return bodyParams; + return { + ...(input.Bytes !== undefined && { + Bytes: context.base64Encoder(input.Bytes) + }), + ...(input.S3Object !== undefined && { + S3Object: serializeAws_json1_1S3Object(input.S3Object, context) + }) + }; }; const serializeAws_json1_1DocumentLocation = ( input: DocumentLocation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Object !== undefined) { - bodyParams["S3Object"] = serializeAws_json1_1S3Object( - input.S3Object, - context - ); - } - return bodyParams; + return { + ...(input.S3Object !== undefined && { + S3Object: serializeAws_json1_1S3Object(input.S3Object, context) + }) + }; }; const serializeAws_json1_1FeatureTypes = ( @@ -1393,157 +1381,131 @@ const serializeAws_json1_1GetDocumentAnalysisRequest = ( input: GetDocumentAnalysisRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1GetDocumentTextDetectionRequest = ( input: GetDocumentTextDetectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1HumanLoopConfig = ( input: HumanLoopConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataAttributes !== undefined) { - bodyParams["DataAttributes"] = serializeAws_json1_1HumanLoopDataAttributes( - input.DataAttributes, - context - ); - } - if (input.FlowDefinitionArn !== undefined) { - bodyParams["FlowDefinitionArn"] = input.FlowDefinitionArn; - } - if (input.HumanLoopName !== undefined) { - bodyParams["HumanLoopName"] = input.HumanLoopName; - } - return bodyParams; + return { + ...(input.DataAttributes !== undefined && { + DataAttributes: serializeAws_json1_1HumanLoopDataAttributes( + input.DataAttributes, + context + ) + }), + ...(input.FlowDefinitionArn !== undefined && { + FlowDefinitionArn: input.FlowDefinitionArn + }), + ...(input.HumanLoopName !== undefined && { + HumanLoopName: input.HumanLoopName + }) + }; }; const serializeAws_json1_1HumanLoopDataAttributes = ( input: HumanLoopDataAttributes, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContentClassifiers !== undefined) { - bodyParams["ContentClassifiers"] = serializeAws_json1_1ContentClassifiers( - input.ContentClassifiers, - context - ); - } - return bodyParams; + return { + ...(input.ContentClassifiers !== undefined && { + ContentClassifiers: serializeAws_json1_1ContentClassifiers( + input.ContentClassifiers, + context + ) + }) + }; }; const serializeAws_json1_1NotificationChannel = ( input: NotificationChannel, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RoleArn !== undefined) { - bodyParams["RoleArn"] = input.RoleArn; - } - if (input.SNSTopicArn !== undefined) { - bodyParams["SNSTopicArn"] = input.SNSTopicArn; - } - return bodyParams; + return { + ...(input.RoleArn !== undefined && { RoleArn: input.RoleArn }), + ...(input.SNSTopicArn !== undefined && { SNSTopicArn: input.SNSTopicArn }) + }; }; const serializeAws_json1_1S3Object = ( input: S3Object, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Bucket !== undefined) { - bodyParams["Bucket"] = input.Bucket; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Bucket !== undefined && { Bucket: input.Bucket }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Version !== undefined && { Version: input.Version }) + }; }; const serializeAws_json1_1StartDocumentAnalysisRequest = ( input: StartDocumentAnalysisRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DocumentLocation !== undefined) { - bodyParams["DocumentLocation"] = serializeAws_json1_1DocumentLocation( - input.DocumentLocation, - context - ); - } - if (input.FeatureTypes !== undefined) { - bodyParams["FeatureTypes"] = serializeAws_json1_1FeatureTypes( - input.FeatureTypes, - context - ); - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - return bodyParams; + 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.NotificationChannel !== undefined && { + NotificationChannel: serializeAws_json1_1NotificationChannel( + input.NotificationChannel, + context + ) + }) + }; }; const serializeAws_json1_1StartDocumentTextDetectionRequest = ( input: StartDocumentTextDetectionRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientRequestToken !== undefined) { - bodyParams["ClientRequestToken"] = input.ClientRequestToken; - } - if (input.DocumentLocation !== undefined) { - bodyParams["DocumentLocation"] = serializeAws_json1_1DocumentLocation( - input.DocumentLocation, - context - ); - } - if (input.JobTag !== undefined) { - bodyParams["JobTag"] = input.JobTag; - } - if (input.NotificationChannel !== undefined) { - bodyParams["NotificationChannel"] = serializeAws_json1_1NotificationChannel( - input.NotificationChannel, - context - ); - } - return bodyParams; + return { + ...(input.ClientRequestToken !== undefined && { + ClientRequestToken: input.ClientRequestToken + }), + ...(input.DocumentLocation !== undefined && { + DocumentLocation: serializeAws_json1_1DocumentLocation( + input.DocumentLocation, + context + ) + }), + ...(input.JobTag !== undefined && { JobTag: input.JobTag }), + ...(input.NotificationChannel !== undefined && { + NotificationChannel: serializeAws_json1_1NotificationChannel( + input.NotificationChannel, + context + ) + }) + }; }; const deserializeAws_json1_1AccessDeniedException = ( diff --git a/clients/client-transcribe-streaming/protocols/Aws_restJson1_1.ts b/clients/client-transcribe-streaming/protocols/Aws_restJson1_1.ts index b51496b23e4d..479dc119e1be 100644 --- a/clients/client-transcribe-streaming/protocols/Aws_restJson1_1.ts +++ b/clients/client-transcribe-streaming/protocols/Aws_restJson1_1.ts @@ -427,11 +427,11 @@ const serializeAws_restJson1_1AudioEvent = ( input: AudioEvent, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AudioChunk !== undefined) { - bodyParams["AudioChunk"] = context.base64Encoder(input.AudioChunk); - } - return bodyParams; + return { + ...(input.AudioChunk !== undefined && { + AudioChunk: context.base64Encoder(input.AudioChunk) + }) + }; }; const serializeAws_restJson1_1AudioStream = ( diff --git a/clients/client-transcribe/protocols/Aws_json1_1.ts b/clients/client-transcribe/protocols/Aws_json1_1.ts index 4e1760f07b2e..4e79a5313bb4 100644 --- a/clients/client-transcribe/protocols/Aws_json1_1.ts +++ b/clients/client-transcribe/protocols/Aws_json1_1.ts @@ -1701,188 +1701,172 @@ const serializeAws_json1_1CreateVocabularyFilterRequest = ( input: CreateVocabularyFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.VocabularyFilterFileUri !== undefined) { - bodyParams["VocabularyFilterFileUri"] = input.VocabularyFilterFileUri; - } - if (input.VocabularyFilterName !== undefined) { - bodyParams["VocabularyFilterName"] = input.VocabularyFilterName; - } - if (input.Words !== undefined) { - bodyParams["Words"] = serializeAws_json1_1Words(input.Words, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateVocabularyRequest = ( input: CreateVocabularyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Phrases !== undefined) { - bodyParams["Phrases"] = serializeAws_json1_1Phrases(input.Phrases, context); - } - if (input.VocabularyFileUri !== undefined) { - bodyParams["VocabularyFileUri"] = input.VocabularyFileUri; - } - if (input.VocabularyName !== undefined) { - bodyParams["VocabularyName"] = input.VocabularyName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1DeleteTranscriptionJobRequest = ( input: DeleteTranscriptionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TranscriptionJobName !== undefined) { - bodyParams["TranscriptionJobName"] = input.TranscriptionJobName; - } - return bodyParams; + return { + ...(input.TranscriptionJobName !== undefined && { + TranscriptionJobName: input.TranscriptionJobName + }) + }; }; const serializeAws_json1_1DeleteVocabularyFilterRequest = ( input: DeleteVocabularyFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VocabularyFilterName !== undefined) { - bodyParams["VocabularyFilterName"] = input.VocabularyFilterName; - } - return bodyParams; + return { + ...(input.VocabularyFilterName !== undefined && { + VocabularyFilterName: input.VocabularyFilterName + }) + }; }; const serializeAws_json1_1DeleteVocabularyRequest = ( input: DeleteVocabularyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VocabularyName !== undefined) { - bodyParams["VocabularyName"] = input.VocabularyName; - } - return bodyParams; + return { + ...(input.VocabularyName !== undefined && { + VocabularyName: input.VocabularyName + }) + }; }; const serializeAws_json1_1GetTranscriptionJobRequest = ( input: GetTranscriptionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TranscriptionJobName !== undefined) { - bodyParams["TranscriptionJobName"] = input.TranscriptionJobName; - } - return bodyParams; + return { + ...(input.TranscriptionJobName !== undefined && { + TranscriptionJobName: input.TranscriptionJobName + }) + }; }; const serializeAws_json1_1GetVocabularyFilterRequest = ( input: GetVocabularyFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VocabularyFilterName !== undefined) { - bodyParams["VocabularyFilterName"] = input.VocabularyFilterName; - } - return bodyParams; + return { + ...(input.VocabularyFilterName !== undefined && { + VocabularyFilterName: input.VocabularyFilterName + }) + }; }; const serializeAws_json1_1GetVocabularyRequest = ( input: GetVocabularyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VocabularyName !== undefined) { - bodyParams["VocabularyName"] = input.VocabularyName; - } - return bodyParams; + return { + ...(input.VocabularyName !== undefined && { + VocabularyName: input.VocabularyName + }) + }; }; const serializeAws_json1_1JobExecutionSettings = ( input: JobExecutionSettings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllowDeferredExecution !== undefined) { - bodyParams["AllowDeferredExecution"] = input.AllowDeferredExecution; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - return bodyParams; + return { + ...(input.AllowDeferredExecution !== undefined && { + AllowDeferredExecution: input.AllowDeferredExecution + }), + ...(input.DataAccessRoleArn !== undefined && { + DataAccessRoleArn: input.DataAccessRoleArn + }) + }; }; const serializeAws_json1_1ListTranscriptionJobsRequest = ( input: ListTranscriptionJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobNameContains !== undefined) { - bodyParams["JobNameContains"] = input.JobNameContains; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Status !== undefined) { - bodyParams["Status"] = input.Status; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListVocabulariesRequest = ( input: ListVocabulariesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.StateEquals !== undefined) { - bodyParams["StateEquals"] = input.StateEquals; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListVocabularyFiltersRequest = ( input: ListVocabularyFiltersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NameContains !== undefined) { - bodyParams["NameContains"] = input.NameContains; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NameContains !== undefined && { + NameContains: input.NameContains + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1Media = ( input: Media, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MediaFileUri !== undefined) { - bodyParams["MediaFileUri"] = input.MediaFileUri; - } - return bodyParams; + return { + ...(input.MediaFileUri !== undefined && { + MediaFileUri: input.MediaFileUri + }) + }; }; const serializeAws_json1_1Phrases = ( @@ -1896,112 +1880,105 @@ const serializeAws_json1_1Settings = ( input: Settings, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChannelIdentification !== undefined) { - bodyParams["ChannelIdentification"] = input.ChannelIdentification; - } - if (input.MaxAlternatives !== undefined) { - bodyParams["MaxAlternatives"] = input.MaxAlternatives; - } - if (input.MaxSpeakerLabels !== undefined) { - bodyParams["MaxSpeakerLabels"] = input.MaxSpeakerLabels; - } - if (input.ShowAlternatives !== undefined) { - bodyParams["ShowAlternatives"] = input.ShowAlternatives; - } - if (input.ShowSpeakerLabels !== undefined) { - bodyParams["ShowSpeakerLabels"] = input.ShowSpeakerLabels; - } - if (input.VocabularyFilterMethod !== undefined) { - bodyParams["VocabularyFilterMethod"] = input.VocabularyFilterMethod; - } - if (input.VocabularyFilterName !== undefined) { - bodyParams["VocabularyFilterName"] = input.VocabularyFilterName; - } - if (input.VocabularyName !== undefined) { - bodyParams["VocabularyName"] = input.VocabularyName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1StartTranscriptionJobRequest = ( input: StartTranscriptionJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobExecutionSettings !== undefined) { - bodyParams[ - "JobExecutionSettings" - ] = serializeAws_json1_1JobExecutionSettings( - input.JobExecutionSettings, - context - ); - } - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Media !== undefined) { - bodyParams["Media"] = serializeAws_json1_1Media(input.Media, context); - } - if (input.MediaFormat !== undefined) { - bodyParams["MediaFormat"] = input.MediaFormat; - } - if (input.MediaSampleRateHertz !== undefined) { - bodyParams["MediaSampleRateHertz"] = input.MediaSampleRateHertz; - } - if (input.OutputBucketName !== undefined) { - bodyParams["OutputBucketName"] = input.OutputBucketName; - } - if (input.OutputEncryptionKMSKeyId !== undefined) { - bodyParams["OutputEncryptionKMSKeyId"] = input.OutputEncryptionKMSKeyId; - } - if (input.Settings !== undefined) { - bodyParams["Settings"] = serializeAws_json1_1Settings( - input.Settings, - context - ); - } - if (input.TranscriptionJobName !== undefined) { - bodyParams["TranscriptionJobName"] = input.TranscriptionJobName; - } - return bodyParams; + return { + ...(input.JobExecutionSettings !== undefined && { + JobExecutionSettings: serializeAws_json1_1JobExecutionSettings( + input.JobExecutionSettings, + context + ) + }), + ...(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.OutputBucketName !== undefined && { + OutputBucketName: input.OutputBucketName + }), + ...(input.OutputEncryptionKMSKeyId !== undefined && { + OutputEncryptionKMSKeyId: input.OutputEncryptionKMSKeyId + }), + ...(input.Settings !== undefined && { + Settings: serializeAws_json1_1Settings(input.Settings, context) + }), + ...(input.TranscriptionJobName !== undefined && { + TranscriptionJobName: input.TranscriptionJobName + }) + }; }; const serializeAws_json1_1UpdateVocabularyFilterRequest = ( input: UpdateVocabularyFilterRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.VocabularyFilterFileUri !== undefined) { - bodyParams["VocabularyFilterFileUri"] = input.VocabularyFilterFileUri; - } - if (input.VocabularyFilterName !== undefined) { - bodyParams["VocabularyFilterName"] = input.VocabularyFilterName; - } - if (input.Words !== undefined) { - bodyParams["Words"] = serializeAws_json1_1Words(input.Words, context); - } - return bodyParams; + return { + ...(input.VocabularyFilterFileUri !== undefined && { + VocabularyFilterFileUri: input.VocabularyFilterFileUri + }), + ...(input.VocabularyFilterName !== undefined && { + VocabularyFilterName: input.VocabularyFilterName + }), + ...(input.Words !== undefined && { + Words: serializeAws_json1_1Words(input.Words, context) + }) + }; }; const serializeAws_json1_1UpdateVocabularyRequest = ( input: UpdateVocabularyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LanguageCode !== undefined) { - bodyParams["LanguageCode"] = input.LanguageCode; - } - if (input.Phrases !== undefined) { - bodyParams["Phrases"] = serializeAws_json1_1Phrases(input.Phrases, context); - } - if (input.VocabularyFileUri !== undefined) { - bodyParams["VocabularyFileUri"] = input.VocabularyFileUri; - } - if (input.VocabularyName !== undefined) { - bodyParams["VocabularyName"] = input.VocabularyName; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1Words = ( diff --git a/clients/client-transfer/protocols/Aws_json1_1.ts b/clients/client-transfer/protocols/Aws_json1_1.ts index 1a0207b42600..9f307e9f7c3b 100644 --- a/clients/client-transfer/protocols/Aws_json1_1.ts +++ b/clients/client-transfer/protocols/Aws_json1_1.ts @@ -2319,186 +2319,143 @@ const serializeAws_json1_1CreateServerRequest = ( input: CreateServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointDetails !== undefined) { - bodyParams["EndpointDetails"] = serializeAws_json1_1EndpointDetails( - input.EndpointDetails, - context - ); - } - if (input.EndpointType !== undefined) { - bodyParams["EndpointType"] = input.EndpointType; - } - if (input.HostKey !== undefined) { - bodyParams["HostKey"] = input.HostKey; - } - if (input.IdentityProviderDetails !== undefined) { - bodyParams[ - "IdentityProviderDetails" - ] = serializeAws_json1_1IdentityProviderDetails( - input.IdentityProviderDetails, - context - ); - } - if (input.IdentityProviderType !== undefined) { - bodyParams["IdentityProviderType"] = input.IdentityProviderType; - } - if (input.LoggingRole !== undefined) { - bodyParams["LoggingRole"] = input.LoggingRole; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(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.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateUserRequest = ( input: CreateUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HomeDirectory !== undefined) { - bodyParams["HomeDirectory"] = input.HomeDirectory; - } - if (input.HomeDirectoryMappings !== undefined) { - bodyParams[ - "HomeDirectoryMappings" - ] = serializeAws_json1_1HomeDirectoryMappings( - input.HomeDirectoryMappings, - context - ); - } - if (input.HomeDirectoryType !== undefined) { - bodyParams["HomeDirectoryType"] = input.HomeDirectoryType; - } - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.SshPublicKeyBody !== undefined) { - bodyParams["SshPublicKeyBody"] = input.SshPublicKeyBody; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteServerRequest = ( input: DeleteServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }) + }; }; const serializeAws_json1_1DeleteSshPublicKeyRequest = ( input: DeleteSshPublicKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.SshPublicKeyId !== undefined) { - bodyParams["SshPublicKeyId"] = input.SshPublicKeyId; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.SshPublicKeyId !== undefined && { + SshPublicKeyId: input.SshPublicKeyId + }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1DeleteUserRequest = ( input: DeleteUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1DescribeServerRequest = ( input: DescribeServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }) + }; }; const serializeAws_json1_1DescribeUserRequest = ( input: DescribeUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1EndpointDetails = ( input: EndpointDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AddressAllocationIds !== undefined) { - bodyParams[ - "AddressAllocationIds" - ] = serializeAws_json1_1AddressAllocationIds( - input.AddressAllocationIds, - context - ); - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.VpcEndpointId !== undefined) { - bodyParams["VpcEndpointId"] = input.VpcEndpointId; - } - if (input.VpcId !== undefined) { - bodyParams["VpcId"] = input.VpcId; - } - return bodyParams; + return { + ...(input.AddressAllocationIds !== undefined && { + AddressAllocationIds: serializeAws_json1_1AddressAllocationIds( + input.AddressAllocationIds, + context + ) + }), + ...(input.SubnetIds !== undefined && { + SubnetIds: serializeAws_json1_1SubnetIds(input.SubnetIds, context) + }), + ...(input.VpcEndpointId !== undefined && { + VpcEndpointId: input.VpcEndpointId + }), + ...(input.VpcId !== undefined && { VpcId: input.VpcId }) + }; }; const serializeAws_json1_1HomeDirectoryMapEntry = ( input: HomeDirectoryMapEntry, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Entry !== undefined) { - bodyParams["Entry"] = input.Entry; - } - if (input.Target !== undefined) { - bodyParams["Target"] = input.Target; - } - return bodyParams; + return { + ...(input.Entry !== undefined && { Entry: input.Entry }), + ...(input.Target !== undefined && { Target: input.Target }) + }; }; const serializeAws_json1_1HomeDirectoryMappings = ( @@ -2514,101 +2471,75 @@ const serializeAws_json1_1IdentityProviderDetails = ( input: IdentityProviderDetails, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.InvocationRole !== undefined) { - bodyParams["InvocationRole"] = input.InvocationRole; - } - if (input.Url !== undefined) { - bodyParams["Url"] = input.Url; - } - return bodyParams; + return { + ...(input.InvocationRole !== undefined && { + InvocationRole: input.InvocationRole + }), + ...(input.Url !== undefined && { Url: input.Url }) + }; }; const serializeAws_json1_1ImportSshPublicKeyRequest = ( input: ImportSshPublicKeyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.SshPublicKeyBody !== undefined) { - bodyParams["SshPublicKeyBody"] = input.SshPublicKeyBody; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.SshPublicKeyBody !== undefined && { + SshPublicKeyBody: input.SshPublicKeyBody + }), + ...(input.UserName !== undefined && { UserName: input.UserName }) + }; }; const serializeAws_json1_1ListServersRequest = ( input: ListServersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListUsersRequest = ( input: ListUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.ServerId !== undefined && { ServerId: input.ServerId }) + }; }; const serializeAws_json1_1StartServerRequest = ( input: StartServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }) + }; }; const serializeAws_json1_1StopServerRequest = ( input: StopServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }) + }; }; const serializeAws_json1_1SubnetIds = ( @@ -2619,14 +2550,10 @@ const serializeAws_json1_1SubnetIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeys = ( @@ -2640,14 +2567,12 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1Tags(input.Tags, context); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1Tags(input.Tags, context) + }) + }; }; const serializeAws_json1_1Tags = ( @@ -2661,99 +2586,75 @@ const serializeAws_json1_1TestIdentityProviderRequest = ( input: TestIdentityProviderRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - if (input.UserPassword !== undefined) { - bodyParams["UserPassword"] = input.UserPassword; - } - return bodyParams; + return { + ...(input.ServerId !== undefined && { ServerId: input.ServerId }), + ...(input.UserName !== undefined && { UserName: input.UserName }), + ...(input.UserPassword !== undefined && { + UserPassword: input.UserPassword + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Arn !== undefined) { - bodyParams["Arn"] = input.Arn; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeys(input.TagKeys, context); - } - return bodyParams; + return { + ...(input.Arn !== undefined && { Arn: input.Arn }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeys(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateServerRequest = ( input: UpdateServerRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndpointDetails !== undefined) { - bodyParams["EndpointDetails"] = serializeAws_json1_1EndpointDetails( - input.EndpointDetails, - context - ); - } - if (input.EndpointType !== undefined) { - bodyParams["EndpointType"] = input.EndpointType; - } - if (input.HostKey !== undefined) { - bodyParams["HostKey"] = input.HostKey; - } - if (input.IdentityProviderDetails !== undefined) { - bodyParams[ - "IdentityProviderDetails" - ] = serializeAws_json1_1IdentityProviderDetails( - input.IdentityProviderDetails, - context - ); - } - if (input.LoggingRole !== undefined) { - bodyParams["LoggingRole"] = input.LoggingRole; - } - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - return bodyParams; + return { + ...(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.ServerId !== undefined && { ServerId: input.ServerId }) + }; }; const serializeAws_json1_1UpdateUserRequest = ( input: UpdateUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.HomeDirectory !== undefined) { - bodyParams["HomeDirectory"] = input.HomeDirectory; - } - if (input.HomeDirectoryMappings !== undefined) { - bodyParams[ - "HomeDirectoryMappings" - ] = serializeAws_json1_1HomeDirectoryMappings( - input.HomeDirectoryMappings, - context - ); - } - if (input.HomeDirectoryType !== undefined) { - bodyParams["HomeDirectoryType"] = input.HomeDirectoryType; - } - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.ServerId !== undefined) { - bodyParams["ServerId"] = input.ServerId; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1ServiceUnavailableException = ( diff --git a/clients/client-translate/protocols/Aws_json1_1.ts b/clients/client-translate/protocols/Aws_json1_1.ts index ad0472b8e56b..1e30167c78ad 100644 --- a/clients/client-translate/protocols/Aws_json1_1.ts +++ b/clients/client-translate/protocols/Aws_json1_1.ts @@ -1295,138 +1295,110 @@ const serializeAws_json1_1DeleteTerminologyRequest = ( input: DeleteTerminologyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DescribeTextTranslationJobRequest = ( input: DescribeTextTranslationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1EncryptionKey = ( input: EncryptionKey, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1GetTerminologyRequest = ( input: GetTerminologyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.TerminologyDataFormat !== undefined) { - bodyParams["TerminologyDataFormat"] = input.TerminologyDataFormat; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.TerminologyDataFormat !== undefined && { + TerminologyDataFormat: input.TerminologyDataFormat + }) + }; }; const serializeAws_json1_1ImportTerminologyRequest = ( input: ImportTerminologyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.EncryptionKey !== undefined) { - bodyParams["EncryptionKey"] = serializeAws_json1_1EncryptionKey( - input.EncryptionKey, - context - ); - } - if (input.MergeStrategy !== undefined) { - bodyParams["MergeStrategy"] = input.MergeStrategy; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.TerminologyData !== undefined) { - bodyParams["TerminologyData"] = serializeAws_json1_1TerminologyData( - input.TerminologyData, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1InputDataConfig = ( input: InputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ContentType !== undefined) { - bodyParams["ContentType"] = input.ContentType; - } - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.ContentType !== undefined && { ContentType: input.ContentType }), + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1ListTerminologiesRequest = ( input: ListTerminologiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListTextTranslationJobsRequest = ( input: ListTextTranslationJobsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Filter !== undefined) { - bodyParams["Filter"] = serializeAws_json1_1TextTranslationJobFilter( - input.Filter, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.Filter !== undefined && { + Filter: serializeAws_json1_1TextTranslationJobFilter( + input.Filter, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1OutputDataConfig = ( input: OutputDataConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.S3Uri !== undefined) { - bodyParams["S3Uri"] = input.S3Uri; - } - return bodyParams; + return { + ...(input.S3Uri !== undefined && { S3Uri: input.S3Uri }) + }; }; const serializeAws_json1_1ResourceNameList = ( @@ -1440,60 +1412,49 @@ const serializeAws_json1_1StartTextTranslationJobRequest = ( input: StartTextTranslationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientToken === undefined) { - input.ClientToken = generateIdempotencyToken(); - } - if (input.ClientToken !== undefined) { - bodyParams["ClientToken"] = input.ClientToken; - } - if (input.DataAccessRoleArn !== undefined) { - bodyParams["DataAccessRoleArn"] = input.DataAccessRoleArn; - } - if (input.InputDataConfig !== undefined) { - bodyParams["InputDataConfig"] = serializeAws_json1_1InputDataConfig( - input.InputDataConfig, - context - ); - } - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.OutputDataConfig !== undefined) { - bodyParams["OutputDataConfig"] = serializeAws_json1_1OutputDataConfig( - input.OutputDataConfig, - context - ); - } - if (input.SourceLanguageCode !== undefined) { - bodyParams["SourceLanguageCode"] = input.SourceLanguageCode; - } - if (input.TargetLanguageCodes !== undefined) { - bodyParams[ - "TargetLanguageCodes" - ] = serializeAws_json1_1TargetLanguageCodeStringList( - input.TargetLanguageCodes, - context - ); - } - if (input.TerminologyNames !== undefined) { - bodyParams["TerminologyNames"] = serializeAws_json1_1ResourceNameList( - input.TerminologyNames, - context - ); - } - return bodyParams; + 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.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 + ) + }) + }; }; const serializeAws_json1_1StopTextTranslationJobRequest = ( input: StopTextTranslationJobRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobId !== undefined) { - bodyParams["JobId"] = input.JobId; - } - return bodyParams; + return { + ...(input.JobId !== undefined && { JobId: input.JobId }) + }; }; const serializeAws_json1_1TargetLanguageCodeStringList = ( @@ -1507,61 +1468,51 @@ const serializeAws_json1_1TerminologyData = ( input: TerminologyData, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.File !== undefined) { - bodyParams["File"] = context.base64Encoder(input.File); - } - if (input.Format !== undefined) { - bodyParams["Format"] = input.Format; - } - return bodyParams; + return { + ...(input.File !== undefined && { + File: context.base64Encoder(input.File) + }), + ...(input.Format !== undefined && { Format: input.Format }) + }; }; const serializeAws_json1_1TextTranslationJobFilter = ( input: TextTranslationJobFilter, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.JobName !== undefined) { - bodyParams["JobName"] = input.JobName; - } - if (input.JobStatus !== undefined) { - bodyParams["JobStatus"] = input.JobStatus; - } - if (input.SubmittedAfterTime !== undefined) { - bodyParams["SubmittedAfterTime"] = Math.round( - input.SubmittedAfterTime.getTime() / 1000 - ); - } - if (input.SubmittedBeforeTime !== undefined) { - bodyParams["SubmittedBeforeTime"] = Math.round( - input.SubmittedBeforeTime.getTime() / 1000 - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1TranslateTextRequest = ( input: TranslateTextRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SourceLanguageCode !== undefined) { - bodyParams["SourceLanguageCode"] = input.SourceLanguageCode; - } - if (input.TargetLanguageCode !== undefined) { - bodyParams["TargetLanguageCode"] = input.TargetLanguageCode; - } - if (input.TerminologyNames !== undefined) { - bodyParams["TerminologyNames"] = serializeAws_json1_1ResourceNameList( - input.TerminologyNames, - context - ); - } - if (input.Text !== undefined) { - bodyParams["Text"] = input.Text; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1AppliedTerminology = ( diff --git a/clients/client-waf-regional/protocols/Aws_json1_1.ts b/clients/client-waf-regional/protocols/Aws_json1_1.ts index 678e0bbd956d..05860720acd5 100644 --- a/clients/client-waf-regional/protocols/Aws_json1_1.ts +++ b/clients/client-waf-regional/protocols/Aws_json1_1.ts @@ -10455,99 +10455,81 @@ const serializeAws_json1_1AssociateWebACLRequest = ( input: AssociateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }) + }; }; const serializeAws_json1_1DisassociateWebACLRequest = ( input: DisassociateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetWebACLForResourceRequest = ( input: GetWebACLForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ListResourcesForWebACLRequest = ( input: ListResourcesForWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + return { + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }) + }; }; const serializeAws_json1_1ActivatedRule = ( input: ActivatedRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = serializeAws_json1_1WafAction(input.Action, context); - } - if (input.ExcludedRules !== undefined) { - bodyParams["ExcludedRules"] = serializeAws_json1_1ExcludedRules( - input.ExcludedRules, - context - ); - } - if (input.OverrideAction !== undefined) { - bodyParams["OverrideAction"] = serializeAws_json1_1WafOverrideAction( - input.OverrideAction, - context - ); - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ByteMatchSetUpdate = ( input: ByteMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.ByteMatchTuple !== undefined) { - bodyParams["ByteMatchTuple"] = serializeAws_json1_1ByteMatchTuple( - input.ByteMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.ByteMatchTuple !== undefined && { + ByteMatchTuple: serializeAws_json1_1ByteMatchTuple( + input.ByteMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1ByteMatchSetUpdates = ( @@ -10563,428 +10545,325 @@ const serializeAws_json1_1ByteMatchTuple = ( input: ByteMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.PositionalConstraint !== undefined) { - bodyParams["PositionalConstraint"] = input.PositionalConstraint; - } - if (input.TargetString !== undefined) { - bodyParams["TargetString"] = context.base64Encoder(input.TargetString); - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateByteMatchSetRequest = ( input: CreateByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateGeoMatchSetRequest = ( input: CreateGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateIPSetRequest = ( input: CreateIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateRateBasedRuleRequest = ( input: CreateRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RateKey !== undefined) { - bodyParams["RateKey"] = input.RateKey; - } - if (input.RateLimit !== undefined) { - bodyParams["RateLimit"] = input.RateLimit; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRegexMatchSetRequest = ( input: CreateRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateRegexPatternSetRequest = ( input: CreateRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateRuleGroupRequest = ( input: CreateRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRuleRequest = ( input: CreateRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateSizeConstraintSetRequest = ( input: CreateSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateSqlInjectionMatchSetRequest = ( input: CreateSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateWebACLRequest = ( input: CreateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.DefaultAction !== undefined) { - bodyParams["DefaultAction"] = serializeAws_json1_1WafAction( - input.DefaultAction, - context - ); - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateXssMatchSetRequest = ( input: CreateXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteByteMatchSetRequest = ( input: DeleteByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ByteMatchSetId !== undefined) { - bodyParams["ByteMatchSetId"] = input.ByteMatchSetId; - } - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - return bodyParams; + return { + ...(input.ByteMatchSetId !== undefined && { + ByteMatchSetId: input.ByteMatchSetId + }), + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }) + }; }; const serializeAws_json1_1DeleteGeoMatchSetRequest = ( input: DeleteGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.GeoMatchSetId !== undefined) { - bodyParams["GeoMatchSetId"] = input.GeoMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && { + GeoMatchSetId: input.GeoMatchSetId + }) + }; }; const serializeAws_json1_1DeleteIPSetRequest = ( input: DeleteIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.IPSetId !== undefined) { - bodyParams["IPSetId"] = input.IPSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }) + }; }; const serializeAws_json1_1DeleteLoggingConfigurationRequest = ( input: DeleteLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DeletePermissionPolicyRequest = ( input: DeletePermissionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DeleteRateBasedRuleRequest = ( input: DeleteRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1DeleteRegexMatchSetRequest = ( input: DeleteRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexMatchSetId !== undefined) { - bodyParams["RegexMatchSetId"] = input.RegexMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && { + RegexMatchSetId: input.RegexMatchSetId + }) + }; }; const serializeAws_json1_1DeleteRegexPatternSetRequest = ( input: DeleteRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }) + }; }; const serializeAws_json1_1DeleteRuleGroupRequest = ( input: DeleteRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }) + }; }; const serializeAws_json1_1DeleteRuleRequest = ( input: DeleteRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1DeleteSizeConstraintSetRequest = ( input: DeleteSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SizeConstraintSetId !== undefined) { - bodyParams["SizeConstraintSetId"] = input.SizeConstraintSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && { + SizeConstraintSetId: input.SizeConstraintSetId + }) + }; }; const serializeAws_json1_1DeleteSqlInjectionMatchSetRequest = ( input: DeleteSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SqlInjectionMatchSetId !== undefined) { - bodyParams["SqlInjectionMatchSetId"] = input.SqlInjectionMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && { + SqlInjectionMatchSetId: input.SqlInjectionMatchSetId + }) + }; }; const serializeAws_json1_1DeleteWebACLRequest = ( input: DeleteWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }) + }; }; const serializeAws_json1_1DeleteXssMatchSetRequest = ( input: DeleteXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.XssMatchSetId !== undefined) { - bodyParams["XssMatchSetId"] = input.XssMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.XssMatchSetId !== undefined && { + XssMatchSetId: input.XssMatchSetId + }) + }; }; const serializeAws_json1_1ExcludedRule = ( input: ExcludedRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1ExcludedRules = ( @@ -10998,45 +10877,35 @@ const serializeAws_json1_1FieldToMatch = ( input: FieldToMatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = input.Data; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1GeoMatchConstraint = ( input: GeoMatchConstraint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1GeoMatchSetUpdate = ( input: GeoMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.GeoMatchConstraint !== undefined) { - bodyParams["GeoMatchConstraint"] = serializeAws_json1_1GeoMatchConstraint( - input.GeoMatchConstraint, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.GeoMatchConstraint !== undefined && { + GeoMatchConstraint: serializeAws_json1_1GeoMatchConstraint( + input.GeoMatchConstraint, + context + ) + }) + }; }; const serializeAws_json1_1GeoMatchSetUpdates = ( @@ -11052,241 +10921,205 @@ const serializeAws_json1_1GetByteMatchSetRequest = ( input: GetByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ByteMatchSetId !== undefined) { - bodyParams["ByteMatchSetId"] = input.ByteMatchSetId; - } - return bodyParams; + return { + ...(input.ByteMatchSetId !== undefined && { + ByteMatchSetId: input.ByteMatchSetId + }) + }; }; const serializeAws_json1_1GetChangeTokenRequest = ( input: GetChangeTokenRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetChangeTokenStatusRequest = ( input: GetChangeTokenStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }) + }; }; const serializeAws_json1_1GetGeoMatchSetRequest = ( input: GetGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GeoMatchSetId !== undefined) { - bodyParams["GeoMatchSetId"] = input.GeoMatchSetId; - } - return bodyParams; + return { + ...(input.GeoMatchSetId !== undefined && { + GeoMatchSetId: input.GeoMatchSetId + }) + }; }; const serializeAws_json1_1GetIPSetRequest = ( input: GetIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IPSetId !== undefined) { - bodyParams["IPSetId"] = input.IPSetId; - } - return bodyParams; + return { + ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }) + }; }; const serializeAws_json1_1GetLoggingConfigurationRequest = ( input: GetLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetPermissionPolicyRequest = ( input: GetPermissionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetRateBasedRuleManagedKeysRequest = ( input: GetRateBasedRuleManagedKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1GetRateBasedRuleRequest = ( input: GetRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1GetRegexMatchSetRequest = ( input: GetRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegexMatchSetId !== undefined) { - bodyParams["RegexMatchSetId"] = input.RegexMatchSetId; - } - return bodyParams; + return { + ...(input.RegexMatchSetId !== undefined && { + RegexMatchSetId: input.RegexMatchSetId + }) + }; }; const serializeAws_json1_1GetRegexPatternSetRequest = ( input: GetRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - return bodyParams; + return { + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }) + }; }; const serializeAws_json1_1GetRuleGroupRequest = ( input: GetRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - return bodyParams; + return { + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }) + }; }; const serializeAws_json1_1GetRuleRequest = ( input: GetRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1GetSampledRequestsRequest = ( input: GetSampledRequestsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.TimeWindow !== undefined) { - bodyParams["TimeWindow"] = serializeAws_json1_1TimeWindow( - input.TimeWindow, - context - ); - } - if (input.WebAclId !== undefined) { - bodyParams["WebAclId"] = input.WebAclId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetSizeConstraintSetRequest = ( input: GetSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SizeConstraintSetId !== undefined) { - bodyParams["SizeConstraintSetId"] = input.SizeConstraintSetId; - } - return bodyParams; + return { + ...(input.SizeConstraintSetId !== undefined && { + SizeConstraintSetId: input.SizeConstraintSetId + }) + }; }; const serializeAws_json1_1GetSqlInjectionMatchSetRequest = ( input: GetSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SqlInjectionMatchSetId !== undefined) { - bodyParams["SqlInjectionMatchSetId"] = input.SqlInjectionMatchSetId; - } - return bodyParams; + return { + ...(input.SqlInjectionMatchSetId !== undefined && { + SqlInjectionMatchSetId: input.SqlInjectionMatchSetId + }) + }; }; const serializeAws_json1_1GetWebACLRequest = ( input: GetWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + return { + ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }) + }; }; const serializeAws_json1_1GetXssMatchSetRequest = ( input: GetXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.XssMatchSetId !== undefined) { - bodyParams["XssMatchSetId"] = input.XssMatchSetId; - } - return bodyParams; + return { + ...(input.XssMatchSetId !== undefined && { + XssMatchSetId: input.XssMatchSetId + }) + }; }; const serializeAws_json1_1IPSetDescriptor = ( input: IPSetDescriptor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1IPSetUpdate = ( input: IPSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.IPSetDescriptor !== undefined) { - bodyParams["IPSetDescriptor"] = serializeAws_json1_1IPSetDescriptor( - input.IPSetDescriptor, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.IPSetDescriptor !== undefined && { + IPSetDescriptor: serializeAws_json1_1IPSetDescriptor( + input.IPSetDescriptor, + context + ) + }) + }; }; const serializeAws_json1_1IPSetUpdates = ( @@ -11300,230 +11133,162 @@ const serializeAws_json1_1ListActivatedRulesInRuleGroupRequest = ( input: ListActivatedRulesInRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }) + }; }; const serializeAws_json1_1ListByteMatchSetsRequest = ( input: ListByteMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListGeoMatchSetsRequest = ( input: ListGeoMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListIPSetsRequest = ( input: ListIPSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListLoggingConfigurationsRequest = ( input: ListLoggingConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRateBasedRulesRequest = ( input: ListRateBasedRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRegexMatchSetsRequest = ( input: ListRegexMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRegexPatternSetsRequest = ( input: ListRegexPatternSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRuleGroupsRequest = ( input: ListRuleGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRulesRequest = ( input: ListRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListSizeConstraintSetsRequest = ( input: ListSizeConstraintSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListSqlInjectionMatchSetsRequest = ( input: ListSqlInjectionMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListSubscribedRuleGroupsRequest = ( input: ListSubscribedRuleGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListWebACLsRequest = ( input: ListWebACLsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListXssMatchSetsRequest = ( input: ListXssMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1LogDestinationConfigs = ( @@ -11537,72 +11302,56 @@ const serializeAws_json1_1LoggingConfiguration = ( input: LoggingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogDestinationConfigs !== undefined) { - bodyParams[ - "LogDestinationConfigs" - ] = serializeAws_json1_1LogDestinationConfigs( - input.LogDestinationConfigs, - context - ); - } - if (input.RedactedFields !== undefined) { - bodyParams["RedactedFields"] = serializeAws_json1_1RedactedFields( - input.RedactedFields, - context - ); - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Predicate = ( input: Predicate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataId !== undefined) { - bodyParams["DataId"] = input.DataId; - } - if (input.Negated !== undefined) { - bodyParams["Negated"] = input.Negated; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.DataId !== undefined && { DataId: input.DataId }), + ...(input.Negated !== undefined && { Negated: input.Negated }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1PutLoggingConfigurationRequest = ( input: PutLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LoggingConfiguration !== undefined) { - bodyParams[ - "LoggingConfiguration" - ] = serializeAws_json1_1LoggingConfiguration( - input.LoggingConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.LoggingConfiguration !== undefined && { + LoggingConfiguration: serializeAws_json1_1LoggingConfiguration( + input.LoggingConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1PutPermissionPolicyRequest = ( input: PutPermissionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1RedactedFields = ( @@ -11616,17 +11365,15 @@ const serializeAws_json1_1RegexMatchSetUpdate = ( input: RegexMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.RegexMatchTuple !== undefined) { - bodyParams["RegexMatchTuple"] = serializeAws_json1_1RegexMatchTuple( - input.RegexMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.RegexMatchTuple !== undefined && { + RegexMatchTuple: serializeAws_json1_1RegexMatchTuple( + input.RegexMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1RegexMatchSetUpdates = ( @@ -11642,34 +11389,32 @@ const serializeAws_json1_1RegexMatchTuple = ( input: RegexMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }), + ...(input.TextTransformation !== undefined && { + TextTransformation: input.TextTransformation + }) + }; }; const serializeAws_json1_1RegexPatternSetUpdate = ( input: RegexPatternSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.RegexPatternString !== undefined) { - bodyParams["RegexPatternString"] = input.RegexPatternString; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.RegexPatternString !== undefined && { + RegexPatternString: input.RegexPatternString + }) + }; }; const serializeAws_json1_1RegexPatternSetUpdates = ( @@ -11685,17 +11430,15 @@ const serializeAws_json1_1RuleGroupUpdate = ( input: RuleGroupUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.ActivatedRule !== undefined) { - bodyParams["ActivatedRule"] = serializeAws_json1_1ActivatedRule( - input.ActivatedRule, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && { + ActivatedRule: serializeAws_json1_1ActivatedRule( + input.ActivatedRule, + context + ) + }) + }; }; const serializeAws_json1_1RuleGroupUpdates = ( @@ -11711,17 +11454,12 @@ const serializeAws_json1_1RuleUpdate = ( input: RuleUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Predicate !== undefined) { - bodyParams["Predicate"] = serializeAws_json1_1Predicate( - input.Predicate, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Predicate !== undefined && { + Predicate: serializeAws_json1_1Predicate(input.Predicate, context) + }) + }; }; const serializeAws_json1_1RuleUpdates = ( @@ -11735,40 +11473,36 @@ const serializeAws_json1_1SizeConstraint = ( input: SizeConstraint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1SizeConstraintSetUpdate = ( input: SizeConstraintSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.SizeConstraint !== undefined) { - bodyParams["SizeConstraint"] = serializeAws_json1_1SizeConstraint( - input.SizeConstraint, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.SizeConstraint !== undefined && { + SizeConstraint: serializeAws_json1_1SizeConstraint( + input.SizeConstraint, + context + ) + }) + }; }; const serializeAws_json1_1SizeConstraintSetUpdates = ( @@ -11784,19 +11518,15 @@ const serializeAws_json1_1SqlInjectionMatchSetUpdate = ( input: SqlInjectionMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.SqlInjectionMatchTuple !== undefined) { - bodyParams[ - "SqlInjectionMatchTuple" - ] = serializeAws_json1_1SqlInjectionMatchTuple( - input.SqlInjectionMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.SqlInjectionMatchTuple !== undefined && { + SqlInjectionMatchTuple: serializeAws_json1_1SqlInjectionMatchTuple( + input.SqlInjectionMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1SqlInjectionMatchSetUpdates = ( @@ -11812,28 +11542,24 @@ const serializeAws_json1_1SqlInjectionMatchTuple = ( input: SqlInjectionMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.TextTransformation !== undefined && { + TextTransformation: input.TextTransformation + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -11854,333 +11580,254 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TimeWindow = ( input: TimeWindow, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + return { + ...(input.EndTime !== undefined && { + EndTime: Math.round(input.EndTime.getTime() / 1000) + }), + ...(input.StartTime !== undefined && { + StartTime: Math.round(input.StartTime.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateByteMatchSetRequest = ( input: UpdateByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ByteMatchSetId !== undefined) { - bodyParams["ByteMatchSetId"] = input.ByteMatchSetId; - } - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1ByteMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ByteMatchSetId !== undefined && { + ByteMatchSetId: input.ByteMatchSetId + }), + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1ByteMatchSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateGeoMatchSetRequest = ( input: UpdateGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.GeoMatchSetId !== undefined) { - bodyParams["GeoMatchSetId"] = input.GeoMatchSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1GeoMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && { + GeoMatchSetId: input.GeoMatchSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1GeoMatchSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateIPSetRequest = ( input: UpdateIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.IPSetId !== undefined) { - bodyParams["IPSetId"] = input.IPSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1IPSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1IPSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateRateBasedRuleRequest = ( input: UpdateRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RateLimit !== undefined) { - bodyParams["RateLimit"] = input.RateLimit; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RuleUpdates( - input.Updates, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateRegexMatchSetRequest = ( input: UpdateRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexMatchSetId !== undefined) { - bodyParams["RegexMatchSetId"] = input.RegexMatchSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RegexMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && { + RegexMatchSetId: input.RegexMatchSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RegexMatchSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateRegexPatternSetRequest = ( input: UpdateRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RegexPatternSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RegexPatternSetUpdates( + input.Updates, + context + ) + }) + }; }; const serializeAws_json1_1UpdateRuleGroupRequest = ( input: UpdateRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RuleGroupUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RuleGroupUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateRuleRequest = ( input: UpdateRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RuleUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateSizeConstraintSetRequest = ( input: UpdateSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SizeConstraintSetId !== undefined) { - bodyParams["SizeConstraintSetId"] = input.SizeConstraintSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1SizeConstraintSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && { + SizeConstraintSetId: input.SizeConstraintSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1SizeConstraintSetUpdates( + input.Updates, + context + ) + }) + }; }; const serializeAws_json1_1UpdateSqlInjectionMatchSetRequest = ( input: UpdateSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SqlInjectionMatchSetId !== undefined) { - bodyParams["SqlInjectionMatchSetId"] = input.SqlInjectionMatchSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1SqlInjectionMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && { + SqlInjectionMatchSetId: input.SqlInjectionMatchSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1SqlInjectionMatchSetUpdates( + input.Updates, + context + ) + }) + }; }; const serializeAws_json1_1UpdateWebACLRequest = ( input: UpdateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.DefaultAction !== undefined) { - bodyParams["DefaultAction"] = serializeAws_json1_1WafAction( - input.DefaultAction, - context - ); - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1WebACLUpdates( - input.Updates, - context - ); - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateXssMatchSetRequest = ( input: UpdateXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1XssMatchSetUpdates( - input.Updates, - context - ); - } - if (input.XssMatchSetId !== undefined) { - bodyParams["XssMatchSetId"] = input.XssMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1XssMatchSetUpdates(input.Updates, context) + }), + ...(input.XssMatchSetId !== undefined && { + XssMatchSetId: input.XssMatchSetId + }) + }; }; const serializeAws_json1_1WafAction = ( input: WafAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1WafOverrideAction = ( input: WafOverrideAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1WebACLUpdate = ( input: WebACLUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.ActivatedRule !== undefined) { - bodyParams["ActivatedRule"] = serializeAws_json1_1ActivatedRule( - input.ActivatedRule, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && { + ActivatedRule: serializeAws_json1_1ActivatedRule( + input.ActivatedRule, + context + ) + }) + }; }; const serializeAws_json1_1WebACLUpdates = ( @@ -12194,17 +11841,15 @@ const serializeAws_json1_1XssMatchSetUpdate = ( input: XssMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.XssMatchTuple !== undefined) { - bodyParams["XssMatchTuple"] = serializeAws_json1_1XssMatchTuple( - input.XssMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.XssMatchTuple !== undefined && { + XssMatchTuple: serializeAws_json1_1XssMatchTuple( + input.XssMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1XssMatchSetUpdates = ( @@ -12220,17 +11865,17 @@ const serializeAws_json1_1XssMatchTuple = ( input: XssMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.TextTransformation !== undefined && { + TextTransformation: input.TextTransformation + }) + }; }; const deserializeAws_json1_1AssociateWebACLResponse = ( diff --git a/clients/client-waf/protocols/Aws_json1_1.ts b/clients/client-waf/protocols/Aws_json1_1.ts index 718b7c452cbc..c006ad0868c5 100644 --- a/clients/client-waf/protocols/Aws_json1_1.ts +++ b/clients/client-waf/protocols/Aws_json1_1.ts @@ -9946,49 +9946,41 @@ const serializeAws_json1_1ActivatedRule = ( input: ActivatedRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = serializeAws_json1_1WafAction(input.Action, context); - } - if (input.ExcludedRules !== undefined) { - bodyParams["ExcludedRules"] = serializeAws_json1_1ExcludedRules( - input.ExcludedRules, - context - ); - } - if (input.OverrideAction !== undefined) { - bodyParams["OverrideAction"] = serializeAws_json1_1WafOverrideAction( - input.OverrideAction, - context - ); - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ByteMatchSetUpdate = ( input: ByteMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.ByteMatchTuple !== undefined) { - bodyParams["ByteMatchTuple"] = serializeAws_json1_1ByteMatchTuple( - input.ByteMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.ByteMatchTuple !== undefined && { + ByteMatchTuple: serializeAws_json1_1ByteMatchTuple( + input.ByteMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1ByteMatchSetUpdates = ( @@ -10004,428 +9996,325 @@ const serializeAws_json1_1ByteMatchTuple = ( input: ByteMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.PositionalConstraint !== undefined) { - bodyParams["PositionalConstraint"] = input.PositionalConstraint; - } - if (input.TargetString !== undefined) { - bodyParams["TargetString"] = context.base64Encoder(input.TargetString); - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1CreateByteMatchSetRequest = ( input: CreateByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateGeoMatchSetRequest = ( input: CreateGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateIPSetRequest = ( input: CreateIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateRateBasedRuleRequest = ( input: CreateRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RateKey !== undefined) { - bodyParams["RateKey"] = input.RateKey; - } - if (input.RateLimit !== undefined) { - bodyParams["RateLimit"] = input.RateLimit; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRegexMatchSetRequest = ( input: CreateRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateRegexPatternSetRequest = ( input: CreateRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateRuleGroupRequest = ( input: CreateRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRuleRequest = ( input: CreateRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateSizeConstraintSetRequest = ( input: CreateSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateSqlInjectionMatchSetRequest = ( input: CreateSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1CreateWebACLRequest = ( input: CreateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.DefaultAction !== undefined) { - bodyParams["DefaultAction"] = serializeAws_json1_1WafAction( - input.DefaultAction, - context - ); - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateXssMatchSetRequest = ( input: CreateXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1DeleteByteMatchSetRequest = ( input: DeleteByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ByteMatchSetId !== undefined) { - bodyParams["ByteMatchSetId"] = input.ByteMatchSetId; - } - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - return bodyParams; + return { + ...(input.ByteMatchSetId !== undefined && { + ByteMatchSetId: input.ByteMatchSetId + }), + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }) + }; }; const serializeAws_json1_1DeleteGeoMatchSetRequest = ( input: DeleteGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.GeoMatchSetId !== undefined) { - bodyParams["GeoMatchSetId"] = input.GeoMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && { + GeoMatchSetId: input.GeoMatchSetId + }) + }; }; const serializeAws_json1_1DeleteIPSetRequest = ( input: DeleteIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.IPSetId !== undefined) { - bodyParams["IPSetId"] = input.IPSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }) + }; }; const serializeAws_json1_1DeleteLoggingConfigurationRequest = ( input: DeleteLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DeletePermissionPolicyRequest = ( input: DeletePermissionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DeleteRateBasedRuleRequest = ( input: DeleteRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1DeleteRegexMatchSetRequest = ( input: DeleteRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexMatchSetId !== undefined) { - bodyParams["RegexMatchSetId"] = input.RegexMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && { + RegexMatchSetId: input.RegexMatchSetId + }) + }; }; const serializeAws_json1_1DeleteRegexPatternSetRequest = ( input: DeleteRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }) + }; }; const serializeAws_json1_1DeleteRuleGroupRequest = ( input: DeleteRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }) + }; }; const serializeAws_json1_1DeleteRuleRequest = ( input: DeleteRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1DeleteSizeConstraintSetRequest = ( input: DeleteSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SizeConstraintSetId !== undefined) { - bodyParams["SizeConstraintSetId"] = input.SizeConstraintSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && { + SizeConstraintSetId: input.SizeConstraintSetId + }) + }; }; const serializeAws_json1_1DeleteSqlInjectionMatchSetRequest = ( input: DeleteSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SqlInjectionMatchSetId !== undefined) { - bodyParams["SqlInjectionMatchSetId"] = input.SqlInjectionMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && { + SqlInjectionMatchSetId: input.SqlInjectionMatchSetId + }) + }; }; const serializeAws_json1_1DeleteWebACLRequest = ( input: DeleteWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }) + }; }; const serializeAws_json1_1DeleteXssMatchSetRequest = ( input: DeleteXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.XssMatchSetId !== undefined) { - bodyParams["XssMatchSetId"] = input.XssMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.XssMatchSetId !== undefined && { + XssMatchSetId: input.XssMatchSetId + }) + }; }; const serializeAws_json1_1ExcludedRule = ( input: ExcludedRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1ExcludedRules = ( @@ -10439,45 +10328,35 @@ const serializeAws_json1_1FieldToMatch = ( input: FieldToMatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Data !== undefined) { - bodyParams["Data"] = input.Data; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Data !== undefined && { Data: input.Data }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1GeoMatchConstraint = ( input: GeoMatchConstraint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1GeoMatchSetUpdate = ( input: GeoMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.GeoMatchConstraint !== undefined) { - bodyParams["GeoMatchConstraint"] = serializeAws_json1_1GeoMatchConstraint( - input.GeoMatchConstraint, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.GeoMatchConstraint !== undefined && { + GeoMatchConstraint: serializeAws_json1_1GeoMatchConstraint( + input.GeoMatchConstraint, + context + ) + }) + }; }; const serializeAws_json1_1GeoMatchSetUpdates = ( @@ -10493,241 +10372,205 @@ const serializeAws_json1_1GetByteMatchSetRequest = ( input: GetByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ByteMatchSetId !== undefined) { - bodyParams["ByteMatchSetId"] = input.ByteMatchSetId; - } - return bodyParams; + return { + ...(input.ByteMatchSetId !== undefined && { + ByteMatchSetId: input.ByteMatchSetId + }) + }; }; const serializeAws_json1_1GetChangeTokenRequest = ( input: GetChangeTokenRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1GetChangeTokenStatusRequest = ( input: GetChangeTokenStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }) + }; }; const serializeAws_json1_1GetGeoMatchSetRequest = ( input: GetGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GeoMatchSetId !== undefined) { - bodyParams["GeoMatchSetId"] = input.GeoMatchSetId; - } - return bodyParams; + return { + ...(input.GeoMatchSetId !== undefined && { + GeoMatchSetId: input.GeoMatchSetId + }) + }; }; const serializeAws_json1_1GetIPSetRequest = ( input: GetIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.IPSetId !== undefined) { - bodyParams["IPSetId"] = input.IPSetId; - } - return bodyParams; + return { + ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }) + }; }; const serializeAws_json1_1GetLoggingConfigurationRequest = ( input: GetLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetPermissionPolicyRequest = ( input: GetPermissionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetRateBasedRuleManagedKeysRequest = ( input: GetRateBasedRuleManagedKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1GetRateBasedRuleRequest = ( input: GetRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1GetRegexMatchSetRequest = ( input: GetRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegexMatchSetId !== undefined) { - bodyParams["RegexMatchSetId"] = input.RegexMatchSetId; - } - return bodyParams; + return { + ...(input.RegexMatchSetId !== undefined && { + RegexMatchSetId: input.RegexMatchSetId + }) + }; }; const serializeAws_json1_1GetRegexPatternSetRequest = ( input: GetRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - return bodyParams; + return { + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }) + }; }; const serializeAws_json1_1GetRuleGroupRequest = ( input: GetRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - return bodyParams; + return { + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }) + }; }; const serializeAws_json1_1GetRuleRequest = ( input: GetRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - return bodyParams; + return { + ...(input.RuleId !== undefined && { RuleId: input.RuleId }) + }; }; const serializeAws_json1_1GetSampledRequestsRequest = ( input: GetSampledRequestsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.TimeWindow !== undefined) { - bodyParams["TimeWindow"] = serializeAws_json1_1TimeWindow( - input.TimeWindow, - context - ); - } - if (input.WebAclId !== undefined) { - bodyParams["WebAclId"] = input.WebAclId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetSizeConstraintSetRequest = ( input: GetSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SizeConstraintSetId !== undefined) { - bodyParams["SizeConstraintSetId"] = input.SizeConstraintSetId; - } - return bodyParams; + return { + ...(input.SizeConstraintSetId !== undefined && { + SizeConstraintSetId: input.SizeConstraintSetId + }) + }; }; const serializeAws_json1_1GetSqlInjectionMatchSetRequest = ( input: GetSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.SqlInjectionMatchSetId !== undefined) { - bodyParams["SqlInjectionMatchSetId"] = input.SqlInjectionMatchSetId; - } - return bodyParams; + return { + ...(input.SqlInjectionMatchSetId !== undefined && { + SqlInjectionMatchSetId: input.SqlInjectionMatchSetId + }) + }; }; const serializeAws_json1_1GetWebACLRequest = ( input: GetWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + return { + ...(input.WebACLId !== undefined && { WebACLId: input.WebACLId }) + }; }; const serializeAws_json1_1GetXssMatchSetRequest = ( input: GetXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.XssMatchSetId !== undefined) { - bodyParams["XssMatchSetId"] = input.XssMatchSetId; - } - return bodyParams; + return { + ...(input.XssMatchSetId !== undefined && { + XssMatchSetId: input.XssMatchSetId + }) + }; }; const serializeAws_json1_1IPSetDescriptor = ( input: IPSetDescriptor, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1IPSetUpdate = ( input: IPSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.IPSetDescriptor !== undefined) { - bodyParams["IPSetDescriptor"] = serializeAws_json1_1IPSetDescriptor( - input.IPSetDescriptor, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.IPSetDescriptor !== undefined && { + IPSetDescriptor: serializeAws_json1_1IPSetDescriptor( + input.IPSetDescriptor, + context + ) + }) + }; }; const serializeAws_json1_1IPSetUpdates = ( @@ -10741,230 +10584,162 @@ const serializeAws_json1_1ListActivatedRulesInRuleGroupRequest = ( input: ListActivatedRulesInRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }) + }; }; const serializeAws_json1_1ListByteMatchSetsRequest = ( input: ListByteMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListGeoMatchSetsRequest = ( input: ListGeoMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListIPSetsRequest = ( input: ListIPSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListLoggingConfigurationsRequest = ( input: ListLoggingConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRateBasedRulesRequest = ( input: ListRateBasedRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRegexMatchSetsRequest = ( input: ListRegexMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRegexPatternSetsRequest = ( input: ListRegexPatternSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRuleGroupsRequest = ( input: ListRuleGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListRulesRequest = ( input: ListRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListSizeConstraintSetsRequest = ( input: ListSizeConstraintSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListSqlInjectionMatchSetsRequest = ( input: ListSqlInjectionMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListSubscribedRuleGroupsRequest = ( input: ListSubscribedRuleGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListWebACLsRequest = ( input: ListWebACLsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1ListXssMatchSetsRequest = ( input: ListXssMatchSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }) + }; }; const serializeAws_json1_1LogDestinationConfigs = ( @@ -10978,72 +10753,56 @@ const serializeAws_json1_1LoggingConfiguration = ( input: LoggingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogDestinationConfigs !== undefined) { - bodyParams[ - "LogDestinationConfigs" - ] = serializeAws_json1_1LogDestinationConfigs( - input.LogDestinationConfigs, - context - ); - } - if (input.RedactedFields !== undefined) { - bodyParams["RedactedFields"] = serializeAws_json1_1RedactedFields( - input.RedactedFields, - context - ); - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1Predicate = ( input: Predicate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DataId !== undefined) { - bodyParams["DataId"] = input.DataId; - } - if (input.Negated !== undefined) { - bodyParams["Negated"] = input.Negated; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.DataId !== undefined && { DataId: input.DataId }), + ...(input.Negated !== undefined && { Negated: input.Negated }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1PutLoggingConfigurationRequest = ( input: PutLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LoggingConfiguration !== undefined) { - bodyParams[ - "LoggingConfiguration" - ] = serializeAws_json1_1LoggingConfiguration( - input.LoggingConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.LoggingConfiguration !== undefined && { + LoggingConfiguration: serializeAws_json1_1LoggingConfiguration( + input.LoggingConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1PutPermissionPolicyRequest = ( input: PutPermissionPolicyRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Policy !== undefined) { - bodyParams["Policy"] = input.Policy; - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.Policy !== undefined && { Policy: input.Policy }), + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1RedactedFields = ( @@ -11057,17 +10816,15 @@ const serializeAws_json1_1RegexMatchSetUpdate = ( input: RegexMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.RegexMatchTuple !== undefined) { - bodyParams["RegexMatchTuple"] = serializeAws_json1_1RegexMatchTuple( - input.RegexMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.RegexMatchTuple !== undefined && { + RegexMatchTuple: serializeAws_json1_1RegexMatchTuple( + input.RegexMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1RegexMatchSetUpdates = ( @@ -11083,34 +10840,32 @@ const serializeAws_json1_1RegexMatchTuple = ( input: RegexMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }), + ...(input.TextTransformation !== undefined && { + TextTransformation: input.TextTransformation + }) + }; }; const serializeAws_json1_1RegexPatternSetUpdate = ( input: RegexPatternSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.RegexPatternString !== undefined) { - bodyParams["RegexPatternString"] = input.RegexPatternString; - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.RegexPatternString !== undefined && { + RegexPatternString: input.RegexPatternString + }) + }; }; const serializeAws_json1_1RegexPatternSetUpdates = ( @@ -11126,17 +10881,15 @@ const serializeAws_json1_1RuleGroupUpdate = ( input: RuleGroupUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.ActivatedRule !== undefined) { - bodyParams["ActivatedRule"] = serializeAws_json1_1ActivatedRule( - input.ActivatedRule, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && { + ActivatedRule: serializeAws_json1_1ActivatedRule( + input.ActivatedRule, + context + ) + }) + }; }; const serializeAws_json1_1RuleGroupUpdates = ( @@ -11152,17 +10905,12 @@ const serializeAws_json1_1RuleUpdate = ( input: RuleUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.Predicate !== undefined) { - bodyParams["Predicate"] = serializeAws_json1_1Predicate( - input.Predicate, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.Predicate !== undefined && { + Predicate: serializeAws_json1_1Predicate(input.Predicate, context) + }) + }; }; const serializeAws_json1_1RuleUpdates = ( @@ -11176,40 +10924,36 @@ const serializeAws_json1_1SizeConstraint = ( input: SizeConstraint, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1SizeConstraintSetUpdate = ( input: SizeConstraintSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.SizeConstraint !== undefined) { - bodyParams["SizeConstraint"] = serializeAws_json1_1SizeConstraint( - input.SizeConstraint, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.SizeConstraint !== undefined && { + SizeConstraint: serializeAws_json1_1SizeConstraint( + input.SizeConstraint, + context + ) + }) + }; }; const serializeAws_json1_1SizeConstraintSetUpdates = ( @@ -11225,19 +10969,15 @@ const serializeAws_json1_1SqlInjectionMatchSetUpdate = ( input: SqlInjectionMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.SqlInjectionMatchTuple !== undefined) { - bodyParams[ - "SqlInjectionMatchTuple" - ] = serializeAws_json1_1SqlInjectionMatchTuple( - input.SqlInjectionMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.SqlInjectionMatchTuple !== undefined && { + SqlInjectionMatchTuple: serializeAws_json1_1SqlInjectionMatchTuple( + input.SqlInjectionMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1SqlInjectionMatchSetUpdates = ( @@ -11253,28 +10993,24 @@ const serializeAws_json1_1SqlInjectionMatchTuple = ( input: SqlInjectionMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.TextTransformation !== undefined && { + TextTransformation: input.TextTransformation + }) + }; }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -11295,333 +11031,254 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TimeWindow = ( input: TimeWindow, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + return { + ...(input.EndTime !== undefined && { + EndTime: Math.round(input.EndTime.getTime() / 1000) + }), + ...(input.StartTime !== undefined && { + StartTime: Math.round(input.StartTime.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateByteMatchSetRequest = ( input: UpdateByteMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ByteMatchSetId !== undefined) { - bodyParams["ByteMatchSetId"] = input.ByteMatchSetId; - } - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1ByteMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ByteMatchSetId !== undefined && { + ByteMatchSetId: input.ByteMatchSetId + }), + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1ByteMatchSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateGeoMatchSetRequest = ( input: UpdateGeoMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.GeoMatchSetId !== undefined) { - bodyParams["GeoMatchSetId"] = input.GeoMatchSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1GeoMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.GeoMatchSetId !== undefined && { + GeoMatchSetId: input.GeoMatchSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1GeoMatchSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateIPSetRequest = ( input: UpdateIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.IPSetId !== undefined) { - bodyParams["IPSetId"] = input.IPSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1IPSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.IPSetId !== undefined && { IPSetId: input.IPSetId }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1IPSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateRateBasedRuleRequest = ( input: UpdateRateBasedRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RateLimit !== undefined) { - bodyParams["RateLimit"] = input.RateLimit; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RuleUpdates( - input.Updates, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1UpdateRegexMatchSetRequest = ( input: UpdateRegexMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexMatchSetId !== undefined) { - bodyParams["RegexMatchSetId"] = input.RegexMatchSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RegexMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexMatchSetId !== undefined && { + RegexMatchSetId: input.RegexMatchSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RegexMatchSetUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateRegexPatternSetRequest = ( input: UpdateRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RegexPatternSetId !== undefined) { - bodyParams["RegexPatternSetId"] = input.RegexPatternSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RegexPatternSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RegexPatternSetId !== undefined && { + RegexPatternSetId: input.RegexPatternSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RegexPatternSetUpdates( + input.Updates, + context + ) + }) + }; }; const serializeAws_json1_1UpdateRuleGroupRequest = ( input: UpdateRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleGroupId !== undefined) { - bodyParams["RuleGroupId"] = input.RuleGroupId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RuleGroupUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleGroupId !== undefined && { RuleGroupId: input.RuleGroupId }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RuleGroupUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateRuleRequest = ( input: UpdateRuleRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.RuleId !== undefined) { - bodyParams["RuleId"] = input.RuleId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1RuleUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.RuleId !== undefined && { RuleId: input.RuleId }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1RuleUpdates(input.Updates, context) + }) + }; }; const serializeAws_json1_1UpdateSizeConstraintSetRequest = ( input: UpdateSizeConstraintSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SizeConstraintSetId !== undefined) { - bodyParams["SizeConstraintSetId"] = input.SizeConstraintSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1SizeConstraintSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SizeConstraintSetId !== undefined && { + SizeConstraintSetId: input.SizeConstraintSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1SizeConstraintSetUpdates( + input.Updates, + context + ) + }) + }; }; const serializeAws_json1_1UpdateSqlInjectionMatchSetRequest = ( input: UpdateSqlInjectionMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.SqlInjectionMatchSetId !== undefined) { - bodyParams["SqlInjectionMatchSetId"] = input.SqlInjectionMatchSetId; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1SqlInjectionMatchSetUpdates( - input.Updates, - context - ); - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.SqlInjectionMatchSetId !== undefined && { + SqlInjectionMatchSetId: input.SqlInjectionMatchSetId + }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1SqlInjectionMatchSetUpdates( + input.Updates, + context + ) + }) + }; }; const serializeAws_json1_1UpdateWebACLRequest = ( input: UpdateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.DefaultAction !== undefined) { - bodyParams["DefaultAction"] = serializeAws_json1_1WafAction( - input.DefaultAction, - context - ); - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1WebACLUpdates( - input.Updates, - context - ); - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateXssMatchSetRequest = ( input: UpdateXssMatchSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeToken !== undefined) { - bodyParams["ChangeToken"] = input.ChangeToken; - } - if (input.Updates !== undefined) { - bodyParams["Updates"] = serializeAws_json1_1XssMatchSetUpdates( - input.Updates, - context - ); - } - if (input.XssMatchSetId !== undefined) { - bodyParams["XssMatchSetId"] = input.XssMatchSetId; - } - return bodyParams; + return { + ...(input.ChangeToken !== undefined && { ChangeToken: input.ChangeToken }), + ...(input.Updates !== undefined && { + Updates: serializeAws_json1_1XssMatchSetUpdates(input.Updates, context) + }), + ...(input.XssMatchSetId !== undefined && { + XssMatchSetId: input.XssMatchSetId + }) + }; }; const serializeAws_json1_1WafAction = ( input: WafAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1WafOverrideAction = ( input: WafOverrideAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1WebACLUpdate = ( input: WebACLUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.ActivatedRule !== undefined) { - bodyParams["ActivatedRule"] = serializeAws_json1_1ActivatedRule( - input.ActivatedRule, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.ActivatedRule !== undefined && { + ActivatedRule: serializeAws_json1_1ActivatedRule( + input.ActivatedRule, + context + ) + }) + }; }; const serializeAws_json1_1WebACLUpdates = ( @@ -11635,17 +11292,15 @@ const serializeAws_json1_1XssMatchSetUpdate = ( input: XssMatchSetUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = input.Action; - } - if (input.XssMatchTuple !== undefined) { - bodyParams["XssMatchTuple"] = serializeAws_json1_1XssMatchTuple( - input.XssMatchTuple, - context - ); - } - return bodyParams; + return { + ...(input.Action !== undefined && { Action: input.Action }), + ...(input.XssMatchTuple !== undefined && { + XssMatchTuple: serializeAws_json1_1XssMatchTuple( + input.XssMatchTuple, + context + ) + }) + }; }; const serializeAws_json1_1XssMatchSetUpdates = ( @@ -11661,17 +11316,17 @@ const serializeAws_json1_1XssMatchTuple = ( input: XssMatchTuple, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformation !== undefined) { - bodyParams["TextTransformation"] = input.TextTransformation; - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.TextTransformation !== undefined && { + TextTransformation: input.TextTransformation + }) + }; }; const deserializeAws_json1_1ActivatedRule = ( diff --git a/clients/client-wafv2/protocols/Aws_json1_1.ts b/clients/client-wafv2/protocols/Aws_json1_1.ts index 21a257e784db..ebfdf706393b 100644 --- a/clients/client-wafv2/protocols/Aws_json1_1.ts +++ b/clients/client-wafv2/protocols/Aws_json1_1.ts @@ -4681,108 +4681,94 @@ const serializeAws_json1_1AllQueryArguments = ( input: AllQueryArguments, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1AllowAction = ( input: AllowAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1AndStatement = ( input: AndStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Statements !== undefined) { - bodyParams["Statements"] = serializeAws_json1_1Statements( - input.Statements, - context - ); - } - return bodyParams; + return { + ...(input.Statements !== undefined && { + Statements: serializeAws_json1_1Statements(input.Statements, context) + }) + }; }; const serializeAws_json1_1AssociateWebACLRequest = ( input: AssociateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - if (input.WebACLArn !== undefined) { - bodyParams["WebACLArn"] = input.WebACLArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }), + ...(input.WebACLArn !== undefined && { WebACLArn: input.WebACLArn }) + }; }; const serializeAws_json1_1BlockAction = ( input: BlockAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1Body = ( input: Body, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1ByteMatchStatement = ( input: ByteMatchStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.PositionalConstraint !== undefined) { - bodyParams["PositionalConstraint"] = input.PositionalConstraint; - } - if (input.SearchString !== undefined) { - bodyParams["SearchString"] = context.base64Encoder(input.SearchString); - } - if (input.TextTransformations !== undefined) { - bodyParams["TextTransformations"] = serializeAws_json1_1TextTransformations( - input.TextTransformations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CheckCapacityRequest = ( input: CheckCapacityRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1Rules(input.Rules, context); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Rules !== undefined && { + Rules: serializeAws_json1_1Rules(input.Rules, context) + }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1CountAction = ( input: CountAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1CountryCodes = ( @@ -4796,268 +4782,193 @@ const serializeAws_json1_1CreateIPSetRequest = ( input: CreateIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Addresses !== undefined) { - bodyParams["Addresses"] = serializeAws_json1_1IPAddresses( - input.Addresses, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.IPAddressVersion !== undefined) { - bodyParams["IPAddressVersion"] = input.IPAddressVersion; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRegexPatternSetRequest = ( input: CreateRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RegularExpressionList !== undefined) { - bodyParams[ - "RegularExpressionList" - ] = serializeAws_json1_1RegularExpressionList( - input.RegularExpressionList, - context - ); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateRuleGroupRequest = ( input: CreateRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Capacity !== undefined) { - bodyParams["Capacity"] = input.Capacity; - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1Rules(input.Rules, context); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VisibilityConfig !== undefined) { - bodyParams["VisibilityConfig"] = serializeAws_json1_1VisibilityConfig( - input.VisibilityConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1CreateWebACLRequest = ( input: CreateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultAction !== undefined) { - bodyParams["DefaultAction"] = serializeAws_json1_1DefaultAction( - input.DefaultAction, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1Rules(input.Rules, context); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.VisibilityConfig !== undefined) { - bodyParams["VisibilityConfig"] = serializeAws_json1_1VisibilityConfig( - input.VisibilityConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DefaultAction = ( input: DefaultAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Allow !== undefined) { - bodyParams["Allow"] = serializeAws_json1_1AllowAction(input.Allow, context); - } - if (input.Block !== undefined) { - bodyParams["Block"] = serializeAws_json1_1BlockAction(input.Block, context); - } - return bodyParams; + return { + ...(input.Allow !== undefined && { + Allow: serializeAws_json1_1AllowAction(input.Allow, context) + }), + ...(input.Block !== undefined && { + Block: serializeAws_json1_1BlockAction(input.Block, context) + }) + }; }; const serializeAws_json1_1DeleteIPSetRequest = ( input: DeleteIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteLoggingConfigurationRequest = ( input: DeleteLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1DeleteRegexPatternSetRequest = ( input: DeleteRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteRuleGroupRequest = ( input: DeleteRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteWebACLRequest = ( input: DeleteWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DescribeManagedRuleGroupRequest = ( input: DescribeManagedRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.VendorName !== undefined) { - bodyParams["VendorName"] = input.VendorName; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Scope !== undefined && { Scope: input.Scope }), + ...(input.VendorName !== undefined && { VendorName: input.VendorName }) + }; }; const serializeAws_json1_1DisassociateWebACLRequest = ( input: DisassociateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1ExcludedRule = ( input: ExcludedRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1ExcludedRules = ( @@ -5071,191 +4982,143 @@ const serializeAws_json1_1FieldToMatch = ( input: FieldToMatch, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AllQueryArguments !== undefined) { - bodyParams["AllQueryArguments"] = serializeAws_json1_1AllQueryArguments( - input.AllQueryArguments, - context - ); - } - if (input.Body !== undefined) { - bodyParams["Body"] = serializeAws_json1_1Body(input.Body, context); - } - if (input.Method !== undefined) { - bodyParams["Method"] = serializeAws_json1_1Method(input.Method, context); - } - if (input.QueryString !== undefined) { - bodyParams["QueryString"] = serializeAws_json1_1QueryString( - input.QueryString, - context - ); - } - if (input.SingleHeader !== undefined) { - bodyParams["SingleHeader"] = serializeAws_json1_1SingleHeader( - input.SingleHeader, - context - ); - } - if (input.SingleQueryArgument !== undefined) { - bodyParams["SingleQueryArgument"] = serializeAws_json1_1SingleQueryArgument( - input.SingleQueryArgument, - context - ); - } - if (input.UriPath !== undefined) { - bodyParams["UriPath"] = serializeAws_json1_1UriPath(input.UriPath, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1GeoMatchStatement = ( input: GeoMatchStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CountryCodes !== undefined) { - bodyParams["CountryCodes"] = serializeAws_json1_1CountryCodes( - input.CountryCodes, - context - ); - } - return bodyParams; + return { + ...(input.CountryCodes !== undefined && { + CountryCodes: serializeAws_json1_1CountryCodes( + input.CountryCodes, + context + ) + }) + }; }; const serializeAws_json1_1GetIPSetRequest = ( input: GetIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1GetLoggingConfigurationRequest = ( input: GetLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetRateBasedStatementManagedKeysRequest = ( input: GetRateBasedStatementManagedKeysRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RuleName !== undefined) { - bodyParams["RuleName"] = input.RuleName; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.WebACLId !== undefined) { - bodyParams["WebACLId"] = input.WebACLId; - } - if (input.WebACLName !== undefined) { - bodyParams["WebACLName"] = input.WebACLName; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetRegexPatternSetRequest = ( input: GetRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1GetRuleGroupRequest = ( input: GetRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1GetSampledRequestsRequest = ( input: GetSampledRequestsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxItems !== undefined) { - bodyParams["MaxItems"] = input.MaxItems; - } - if (input.RuleMetricName !== undefined) { - bodyParams["RuleMetricName"] = input.RuleMetricName; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.TimeWindow !== undefined) { - bodyParams["TimeWindow"] = serializeAws_json1_1TimeWindow( - input.TimeWindow, - context - ); - } - if (input.WebAclArn !== undefined) { - bodyParams["WebAclArn"] = input.WebAclArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1GetWebACLForResourceRequest = ( input: GetWebACLForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + return { + ...(input.ResourceArn !== undefined && { ResourceArn: input.ResourceArn }) + }; }; const serializeAws_json1_1GetWebACLRequest = ( input: GetWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1IPAddresses = ( @@ -5269,144 +5132,98 @@ const serializeAws_json1_1IPSetReferenceStatement = ( input: IPSetReferenceStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ARN !== undefined) { - bodyParams["ARN"] = input.ARN; - } - return bodyParams; + return { + ...(input.ARN !== undefined && { ARN: input.ARN }) + }; }; const serializeAws_json1_1ListAvailableManagedRuleGroupsRequest = ( input: ListAvailableManagedRuleGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1ListIPSetsRequest = ( input: ListIPSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1ListLoggingConfigurationsRequest = ( input: ListLoggingConfigurationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1ListRegexPatternSetsRequest = ( input: ListRegexPatternSetsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1ListResourcesForWebACLRequest = ( input: ListResourcesForWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceType !== undefined) { - bodyParams["ResourceType"] = input.ResourceType; - } - if (input.WebACLArn !== undefined) { - bodyParams["WebACLArn"] = input.WebACLArn; - } - return bodyParams; + return { + ...(input.ResourceType !== undefined && { + ResourceType: input.ResourceType + }), + ...(input.WebACLArn !== undefined && { WebACLArn: input.WebACLArn }) + }; }; const serializeAws_json1_1ListRuleGroupsRequest = ( input: ListRuleGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1ListTagsForResourceRequest = ( input: ListTagsForResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }) + }; }; const serializeAws_json1_1ListWebACLsRequest = ( input: ListWebACLsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextMarker !== undefined) { - bodyParams["NextMarker"] = input.NextMarker; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + return { + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextMarker !== undefined && { NextMarker: input.NextMarker }), + ...(input.Scope !== undefined && { Scope: input.Scope }) + }; }; const serializeAws_json1_1LogDestinationConfigs = ( @@ -5420,147 +5237,126 @@ const serializeAws_json1_1LoggingConfiguration = ( input: LoggingConfiguration, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LogDestinationConfigs !== undefined) { - bodyParams[ - "LogDestinationConfigs" - ] = serializeAws_json1_1LogDestinationConfigs( - input.LogDestinationConfigs, - context - ); - } - if (input.RedactedFields !== undefined) { - bodyParams["RedactedFields"] = serializeAws_json1_1RedactedFields( - input.RedactedFields, - context - ); - } - if (input.ResourceArn !== undefined) { - bodyParams["ResourceArn"] = input.ResourceArn; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ManagedRuleGroupStatement = ( input: ManagedRuleGroupStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ExcludedRules !== undefined) { - bodyParams["ExcludedRules"] = serializeAws_json1_1ExcludedRules( - input.ExcludedRules, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.VendorName !== undefined) { - bodyParams["VendorName"] = input.VendorName; - } - return bodyParams; + return { + ...(input.ExcludedRules !== undefined && { + ExcludedRules: serializeAws_json1_1ExcludedRules( + input.ExcludedRules, + context + ) + }), + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.VendorName !== undefined && { VendorName: input.VendorName }) + }; }; const serializeAws_json1_1Method = ( input: Method, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1NoneAction = ( input: NoneAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1NotStatement = ( input: NotStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Statement !== undefined) { - bodyParams["Statement"] = serializeAws_json1_1Statement( - input.Statement, - context - ); - } - return bodyParams; + return { + ...(input.Statement !== undefined && { + Statement: serializeAws_json1_1Statement(input.Statement, context) + }) + }; }; const serializeAws_json1_1OrStatement = ( input: OrStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Statements !== undefined) { - bodyParams["Statements"] = serializeAws_json1_1Statements( - input.Statements, - context - ); - } - return bodyParams; + return { + ...(input.Statements !== undefined && { + Statements: serializeAws_json1_1Statements(input.Statements, context) + }) + }; }; const serializeAws_json1_1OverrideAction = ( input: OverrideAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Count !== undefined) { - bodyParams["Count"] = serializeAws_json1_1CountAction(input.Count, context); - } - if (input.None !== undefined) { - bodyParams["None"] = serializeAws_json1_1NoneAction(input.None, context); - } - return bodyParams; + return { + ...(input.Count !== undefined && { + Count: serializeAws_json1_1CountAction(input.Count, context) + }), + ...(input.None !== undefined && { + None: serializeAws_json1_1NoneAction(input.None, context) + }) + }; }; const serializeAws_json1_1PutLoggingConfigurationRequest = ( input: PutLoggingConfigurationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.LoggingConfiguration !== undefined) { - bodyParams[ - "LoggingConfiguration" - ] = serializeAws_json1_1LoggingConfiguration( - input.LoggingConfiguration, - context - ); - } - return bodyParams; + return { + ...(input.LoggingConfiguration !== undefined && { + LoggingConfiguration: serializeAws_json1_1LoggingConfiguration( + input.LoggingConfiguration, + context + ) + }) + }; }; const serializeAws_json1_1QueryString = ( input: QueryString, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1RateBasedStatement = ( input: RateBasedStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AggregateKeyType !== undefined) { - bodyParams["AggregateKeyType"] = input.AggregateKeyType; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.ScopeDownStatement !== undefined) { - bodyParams["ScopeDownStatement"] = serializeAws_json1_1Statement( - input.ScopeDownStatement, - context - ); - } - return bodyParams; + return { + ...(input.AggregateKeyType !== undefined && { + AggregateKeyType: input.AggregateKeyType + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.ScopeDownStatement !== undefined && { + ScopeDownStatement: serializeAws_json1_1Statement( + input.ScopeDownStatement, + context + ) + }) + }; }; const serializeAws_json1_1RedactedFields = ( @@ -5574,34 +5370,30 @@ const serializeAws_json1_1Regex = ( input: Regex, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RegexString !== undefined) { - bodyParams["RegexString"] = input.RegexString; - } - return bodyParams; + return { + ...(input.RegexString !== undefined && { RegexString: input.RegexString }) + }; }; const serializeAws_json1_1RegexPatternSetReferenceStatement = ( input: RegexPatternSetReferenceStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ARN !== undefined) { - bodyParams["ARN"] = input.ARN; - } - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformations !== undefined) { - bodyParams["TextTransformations"] = serializeAws_json1_1TextTransformations( - input.TextTransformations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RegularExpressionList = ( @@ -5615,72 +5407,60 @@ const serializeAws_json1_1Rule = ( input: Rule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Action !== undefined) { - bodyParams["Action"] = serializeAws_json1_1RuleAction( - input.Action, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OverrideAction !== undefined) { - bodyParams["OverrideAction"] = serializeAws_json1_1OverrideAction( - input.OverrideAction, - context - ); - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.Statement !== undefined) { - bodyParams["Statement"] = serializeAws_json1_1Statement( - input.Statement, - context - ); - } - if (input.VisibilityConfig !== undefined) { - bodyParams["VisibilityConfig"] = serializeAws_json1_1VisibilityConfig( - input.VisibilityConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RuleAction = ( input: RuleAction, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Allow !== undefined) { - bodyParams["Allow"] = serializeAws_json1_1AllowAction(input.Allow, context); - } - if (input.Block !== undefined) { - bodyParams["Block"] = serializeAws_json1_1BlockAction(input.Block, context); - } - if (input.Count !== undefined) { - bodyParams["Count"] = serializeAws_json1_1CountAction(input.Count, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1RuleGroupReferenceStatement = ( input: RuleGroupReferenceStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ARN !== undefined) { - bodyParams["ARN"] = input.ARN; - } - if (input.ExcludedRules !== undefined) { - bodyParams["ExcludedRules"] = serializeAws_json1_1ExcludedRules( - input.ExcludedRules, - context - ); - } - return bodyParams; + return { + ...(input.ARN !== undefined && { ARN: input.ARN }), + ...(input.ExcludedRules !== undefined && { + ExcludedRules: serializeAws_json1_1ExcludedRules( + input.ExcludedRules, + context + ) + }) + }; }; const serializeAws_json1_1Rules = ( @@ -5694,164 +5474,145 @@ const serializeAws_json1_1SingleHeader = ( input: SingleHeader, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1SingleQueryArgument = ( input: SingleQueryArgument, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }) + }; }; const serializeAws_json1_1SizeConstraintStatement = ( input: SizeConstraintStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComparisonOperator !== undefined) { - bodyParams["ComparisonOperator"] = input.ComparisonOperator; - } - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.Size !== undefined) { - bodyParams["Size"] = input.Size; - } - if (input.TextTransformations !== undefined) { - bodyParams["TextTransformations"] = serializeAws_json1_1TextTransformations( - input.TextTransformations, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1SqliMatchStatement = ( input: SqliMatchStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformations !== undefined) { - bodyParams["TextTransformations"] = serializeAws_json1_1TextTransformations( - input.TextTransformations, - context - ); - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.TextTransformations !== undefined && { + TextTransformations: serializeAws_json1_1TextTransformations( + input.TextTransformations, + context + ) + }) + }; }; const serializeAws_json1_1Statement = ( input: Statement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AndStatement !== undefined) { - bodyParams["AndStatement"] = serializeAws_json1_1AndStatement( - input.AndStatement, - context - ); - } - if (input.ByteMatchStatement !== undefined) { - bodyParams["ByteMatchStatement"] = serializeAws_json1_1ByteMatchStatement( - input.ByteMatchStatement, - context - ); - } - if (input.GeoMatchStatement !== undefined) { - bodyParams["GeoMatchStatement"] = serializeAws_json1_1GeoMatchStatement( - input.GeoMatchStatement, - context - ); - } - if (input.IPSetReferenceStatement !== undefined) { - bodyParams[ - "IPSetReferenceStatement" - ] = serializeAws_json1_1IPSetReferenceStatement( - input.IPSetReferenceStatement, - context - ); - } - if (input.ManagedRuleGroupStatement !== undefined) { - bodyParams[ - "ManagedRuleGroupStatement" - ] = serializeAws_json1_1ManagedRuleGroupStatement( - input.ManagedRuleGroupStatement, - context - ); - } - if (input.NotStatement !== undefined) { - bodyParams["NotStatement"] = serializeAws_json1_1NotStatement( - input.NotStatement, - context - ); - } - if (input.OrStatement !== undefined) { - bodyParams["OrStatement"] = serializeAws_json1_1OrStatement( - input.OrStatement, - context - ); - } - if (input.RateBasedStatement !== undefined) { - bodyParams["RateBasedStatement"] = serializeAws_json1_1RateBasedStatement( - input.RateBasedStatement, - context - ); - } - if (input.RegexPatternSetReferenceStatement !== undefined) { - bodyParams[ - "RegexPatternSetReferenceStatement" - ] = serializeAws_json1_1RegexPatternSetReferenceStatement( - input.RegexPatternSetReferenceStatement, - context - ); - } - if (input.RuleGroupReferenceStatement !== undefined) { - bodyParams[ - "RuleGroupReferenceStatement" - ] = serializeAws_json1_1RuleGroupReferenceStatement( - input.RuleGroupReferenceStatement, - context - ); - } - if (input.SizeConstraintStatement !== undefined) { - bodyParams[ - "SizeConstraintStatement" - ] = serializeAws_json1_1SizeConstraintStatement( - input.SizeConstraintStatement, - context - ); - } - if (input.SqliMatchStatement !== undefined) { - bodyParams["SqliMatchStatement"] = serializeAws_json1_1SqliMatchStatement( - input.SqliMatchStatement, - context - ); - } - if (input.XssMatchStatement !== undefined) { - bodyParams["XssMatchStatement"] = serializeAws_json1_1XssMatchStatement( - input.XssMatchStatement, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1Statements = ( @@ -5862,14 +5623,10 @@ const serializeAws_json1_1Statements = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -5890,28 +5647,22 @@ const serializeAws_json1_1TagResourceRequest = ( input: TagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1TextTransformation = ( input: TextTransformation, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Priority !== undefined && { Priority: input.Priority }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1TextTransformations = ( @@ -5927,206 +5678,153 @@ const serializeAws_json1_1TimeWindow = ( input: TimeWindow, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EndTime !== undefined) { - bodyParams["EndTime"] = Math.round(input.EndTime.getTime() / 1000); - } - if (input.StartTime !== undefined) { - bodyParams["StartTime"] = Math.round(input.StartTime.getTime() / 1000); - } - return bodyParams; + return { + ...(input.EndTime !== undefined && { + EndTime: Math.round(input.EndTime.getTime() / 1000) + }), + ...(input.StartTime !== undefined && { + StartTime: Math.round(input.StartTime.getTime() / 1000) + }) + }; }; const serializeAws_json1_1UntagResourceRequest = ( input: UntagResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceARN !== undefined && { ResourceARN: input.ResourceARN }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1UpdateIPSetRequest = ( input: UpdateIPSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Addresses !== undefined) { - bodyParams["Addresses"] = serializeAws_json1_1IPAddresses( - input.Addresses, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateRegexPatternSetRequest = ( input: UpdateRegexPatternSetRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.RegularExpressionList !== undefined) { - bodyParams[ - "RegularExpressionList" - ] = serializeAws_json1_1RegularExpressionList( - input.RegularExpressionList, - context - ); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1UpdateRuleGroupRequest = ( input: UpdateRuleGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1Rules(input.Rules, context); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.VisibilityConfig !== undefined) { - bodyParams["VisibilityConfig"] = serializeAws_json1_1VisibilityConfig( - input.VisibilityConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UpdateWebACLRequest = ( input: UpdateWebACLRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DefaultAction !== undefined) { - bodyParams["DefaultAction"] = serializeAws_json1_1DefaultAction( - input.DefaultAction, - context - ); - } - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.LockToken !== undefined) { - bodyParams["LockToken"] = input.LockToken; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Rules !== undefined) { - bodyParams["Rules"] = serializeAws_json1_1Rules(input.Rules, context); - } - if (input.Scope !== undefined) { - bodyParams["Scope"] = input.Scope; - } - if (input.VisibilityConfig !== undefined) { - bodyParams["VisibilityConfig"] = serializeAws_json1_1VisibilityConfig( - input.VisibilityConfig, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1UriPath = ( input: UriPath, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1VisibilityConfig = ( input: VisibilityConfig, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CloudWatchMetricsEnabled !== undefined) { - bodyParams["CloudWatchMetricsEnabled"] = input.CloudWatchMetricsEnabled; - } - if (input.MetricName !== undefined) { - bodyParams["MetricName"] = input.MetricName; - } - if (input.SampledRequestsEnabled !== undefined) { - bodyParams["SampledRequestsEnabled"] = input.SampledRequestsEnabled; - } - return bodyParams; + return { + ...(input.CloudWatchMetricsEnabled !== undefined && { + CloudWatchMetricsEnabled: input.CloudWatchMetricsEnabled + }), + ...(input.MetricName !== undefined && { MetricName: input.MetricName }), + ...(input.SampledRequestsEnabled !== undefined && { + SampledRequestsEnabled: input.SampledRequestsEnabled + }) + }; }; const serializeAws_json1_1XssMatchStatement = ( input: XssMatchStatement, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.FieldToMatch !== undefined) { - bodyParams["FieldToMatch"] = serializeAws_json1_1FieldToMatch( - input.FieldToMatch, - context - ); - } - if (input.TextTransformations !== undefined) { - bodyParams["TextTransformations"] = serializeAws_json1_1TextTransformations( - input.TextTransformations, - context - ); - } - return bodyParams; + return { + ...(input.FieldToMatch !== undefined && { + FieldToMatch: serializeAws_json1_1FieldToMatch( + input.FieldToMatch, + context + ) + }), + ...(input.TextTransformations !== undefined && { + TextTransformations: serializeAws_json1_1TextTransformations( + input.TextTransformations, + context + ) + }) + }; }; const deserializeAws_json1_1AllQueryArguments = ( diff --git a/clients/client-workdocs/protocols/Aws_restJson1_1.ts b/clients/client-workdocs/protocols/Aws_restJson1_1.ts index 4653b60c5fe3..2a5adf3b45ad 100644 --- a/clients/client-workdocs/protocols/Aws_restJson1_1.ts +++ b/clients/client-workdocs/protocols/Aws_restJson1_1.ts @@ -7350,31 +7350,23 @@ const serializeAws_restJson1_1NotificationOptions = ( input: NotificationOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EmailMessage !== undefined) { - bodyParams["EmailMessage"] = input.EmailMessage; - } - if (input.SendEmail !== undefined) { - bodyParams["SendEmail"] = input.SendEmail; - } - return bodyParams; + return { + ...(input.EmailMessage !== undefined && { + EmailMessage: input.EmailMessage + }), + ...(input.SendEmail !== undefined && { SendEmail: input.SendEmail }) + }; }; const serializeAws_restJson1_1SharePrincipal = ( input: SharePrincipal, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Id !== undefined) { - bodyParams["Id"] = input.Id; - } - if (input.Role !== undefined) { - bodyParams["Role"] = input.Role; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Id !== undefined && { Id: input.Id }), + ...(input.Role !== undefined && { Role: input.Role }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_restJson1_1SharePrincipalList = ( @@ -7397,14 +7389,12 @@ const serializeAws_restJson1_1StorageRuleType = ( input: StorageRuleType, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StorageAllocatedInBytes !== undefined) { - bodyParams["StorageAllocatedInBytes"] = input.StorageAllocatedInBytes; - } - if (input.StorageType !== undefined) { - bodyParams["StorageType"] = input.StorageType; - } - return bodyParams; + return { + ...(input.StorageAllocatedInBytes !== undefined && { + StorageAllocatedInBytes: input.StorageAllocatedInBytes + }), + ...(input.StorageType !== undefined && { StorageType: input.StorageType }) + }; }; const deserializeAws_restJson1_1Activity = ( diff --git a/clients/client-workmail/protocols/Aws_json1_1.ts b/clients/client-workmail/protocols/Aws_json1_1.ts index 116294b9bcd6..c5dec731ea9d 100644 --- a/clients/client-workmail/protocols/Aws_json1_1.ts +++ b/clients/client-workmail/protocols/Aws_json1_1.ts @@ -4764,457 +4764,359 @@ const serializeAws_json1_1AssociateDelegateToResourceRequest = ( input: AssociateDelegateToResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1AssociateMemberToGroupRequest = ( input: AssociateMemberToGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.MemberId !== undefined) { - bodyParams["MemberId"] = input.MemberId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.MemberId !== undefined && { MemberId: input.MemberId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1BookingOptions = ( input: BookingOptions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.AutoAcceptRequests !== undefined) { - bodyParams["AutoAcceptRequests"] = input.AutoAcceptRequests; - } - if (input.AutoDeclineConflictingRequests !== undefined) { - bodyParams["AutoDeclineConflictingRequests"] = - input.AutoDeclineConflictingRequests; - } - if (input.AutoDeclineRecurringRequests !== undefined) { - bodyParams["AutoDeclineRecurringRequests"] = - input.AutoDeclineRecurringRequests; - } - return bodyParams; + return { + ...(input.AutoAcceptRequests !== undefined && { + AutoAcceptRequests: input.AutoAcceptRequests + }), + ...(input.AutoDeclineConflictingRequests !== undefined && { + AutoDeclineConflictingRequests: input.AutoDeclineConflictingRequests + }), + ...(input.AutoDeclineRecurringRequests !== undefined && { + AutoDeclineRecurringRequests: input.AutoDeclineRecurringRequests + }) + }; }; const serializeAws_json1_1CreateAliasRequest = ( input: CreateAliasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alias !== undefined) { - bodyParams["Alias"] = input.Alias; - } - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.Alias !== undefined && { Alias: input.Alias }), + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1CreateGroupRequest = ( input: CreateGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1CreateResourceRequest = ( input: CreateResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.Type !== undefined) { - bodyParams["Type"] = input.Type; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.Type !== undefined && { Type: input.Type }) + }; }; const serializeAws_json1_1CreateUserRequest = ( input: CreateUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DisplayName !== undefined) { - bodyParams["DisplayName"] = input.DisplayName; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1DeleteAliasRequest = ( input: DeleteAliasRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Alias !== undefined) { - bodyParams["Alias"] = input.Alias; - } - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.Alias !== undefined && { Alias: input.Alias }), + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1DeleteGroupRequest = ( input: DeleteGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1DeleteMailboxPermissionsRequest = ( input: DeleteMailboxPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.GranteeId !== undefined) { - bodyParams["GranteeId"] = input.GranteeId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.GranteeId !== undefined && { GranteeId: input.GranteeId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1DeleteResourceRequest = ( input: DeleteResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1DeleteUserRequest = ( input: DeleteUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_json1_1DeregisterFromWorkMailRequest = ( input: DeregisterFromWorkMailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1DescribeGroupRequest = ( input: DescribeGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1DescribeOrganizationRequest = ( input: DescribeOrganizationRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1DescribeResourceRequest = ( input: DescribeResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1DescribeUserRequest = ( input: DescribeUserRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_json1_1DisassociateDelegateFromResourceRequest = ( input: DisassociateDelegateFromResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1DisassociateMemberFromGroupRequest = ( input: DisassociateMemberFromGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.MemberId !== undefined) { - bodyParams["MemberId"] = input.MemberId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.MemberId !== undefined && { MemberId: input.MemberId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1GetMailboxDetailsRequest = ( input: GetMailboxDetailsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_json1_1ListAliasesRequest = ( input: ListAliasesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListGroupMembersRequest = ( input: ListGroupMembersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListGroupsRequest = ( input: ListGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1ListMailboxPermissionsRequest = ( input: ListMailboxPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1ListOrganizationsRequest = ( input: ListOrganizationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1ListResourceDelegatesRequest = ( input: ListResourceDelegatesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ListResourcesRequest = ( input: ListResourcesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1ListUsersRequest = ( input: ListUsersRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1PermissionValues = ( @@ -5228,114 +5130,92 @@ const serializeAws_json1_1PutMailboxPermissionsRequest = ( input: PutMailboxPermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.GranteeId !== undefined) { - bodyParams["GranteeId"] = input.GranteeId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.PermissionValues !== undefined) { - bodyParams["PermissionValues"] = serializeAws_json1_1PermissionValues( - input.PermissionValues, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1RegisterToWorkMailRequest = ( input: RegisterToWorkMailRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.Email !== undefined && { Email: input.Email }), + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1ResetPasswordRequest = ( input: ResetPasswordRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.Password !== undefined) { - bodyParams["Password"] = input.Password; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.Password !== undefined && { Password: input.Password }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_json1_1UpdateMailboxQuotaRequest = ( input: UpdateMailboxQuotaRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.MailboxQuota !== undefined) { - bodyParams["MailboxQuota"] = input.MailboxQuota; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.UserId !== undefined) { - bodyParams["UserId"] = input.UserId; - } - return bodyParams; + return { + ...(input.MailboxQuota !== undefined && { + MailboxQuota: input.MailboxQuota + }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }), + ...(input.UserId !== undefined && { UserId: input.UserId }) + }; }; const serializeAws_json1_1UpdatePrimaryEmailAddressRequest = ( input: UpdatePrimaryEmailAddressRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Email !== undefined) { - bodyParams["Email"] = input.Email; - } - if (input.EntityId !== undefined) { - bodyParams["EntityId"] = input.EntityId; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - return bodyParams; + return { + ...(input.Email !== undefined && { Email: input.Email }), + ...(input.EntityId !== undefined && { EntityId: input.EntityId }), + ...(input.OrganizationId !== undefined && { + OrganizationId: input.OrganizationId + }) + }; }; const serializeAws_json1_1UpdateResourceRequest = ( input: UpdateResourceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BookingOptions !== undefined) { - bodyParams["BookingOptions"] = serializeAws_json1_1BookingOptions( - input.BookingOptions, - context - ); - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.OrganizationId !== undefined) { - bodyParams["OrganizationId"] = input.OrganizationId; - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + 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 }) + }; }; const deserializeAws_json1_1Aliases = ( diff --git a/clients/client-workspaces/protocols/Aws_json1_1.ts b/clients/client-workspaces/protocols/Aws_json1_1.ts index 7ada61f54759..2e519ef53f49 100644 --- a/clients/client-workspaces/protocols/Aws_json1_1.ts +++ b/clients/client-workspaces/protocols/Aws_json1_1.ts @@ -4643,34 +4643,24 @@ const serializeAws_json1_1AssociateIpGroupsRequest = ( input: AssociateIpGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.GroupIds !== undefined) { - bodyParams["GroupIds"] = serializeAws_json1_1IpGroupIdList( - input.GroupIds, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.GroupIds !== undefined && { + GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) + }) + }; }; const serializeAws_json1_1AuthorizeIpRulesRequest = ( input: AuthorizeIpRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.UserRules !== undefined) { - bodyParams["UserRules"] = serializeAws_json1_1IpRuleList( - input.UserRules, - context - ); - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.UserRules !== undefined && { + UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) + }) + }; }; const serializeAws_json1_1BundleIdList = ( @@ -4684,316 +4674,251 @@ const serializeAws_json1_1ClientProperties = ( input: ClientProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ReconnectEnabled !== undefined) { - bodyParams["ReconnectEnabled"] = input.ReconnectEnabled; - } - return bodyParams; + return { + ...(input.ReconnectEnabled !== undefined && { + ReconnectEnabled: input.ReconnectEnabled + }) + }; }; const serializeAws_json1_1CopyWorkspaceImageRequest = ( input: CopyWorkspaceImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Description !== undefined) { - bodyParams["Description"] = input.Description; - } - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.SourceImageId !== undefined) { - bodyParams["SourceImageId"] = input.SourceImageId; - } - if (input.SourceRegion !== undefined) { - bodyParams["SourceRegion"] = input.SourceRegion; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateIpGroupRequest = ( input: CreateIpGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupDesc !== undefined) { - bodyParams["GroupDesc"] = input.GroupDesc; - } - if (input.GroupName !== undefined) { - bodyParams["GroupName"] = input.GroupName; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.UserRules !== undefined) { - bodyParams["UserRules"] = serializeAws_json1_1IpRuleList( - input.UserRules, - context - ); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_json1_1CreateTagsRequest = ( input: CreateTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.Tags !== undefined && { + Tags: serializeAws_json1_1TagList(input.Tags, context) + }) + }; }; const serializeAws_json1_1CreateWorkspacesRequest = ( input: CreateWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Workspaces !== undefined) { - bodyParams["Workspaces"] = serializeAws_json1_1WorkspaceRequestList( - input.Workspaces, - context - ); - } - return bodyParams; + return { + ...(input.Workspaces !== undefined && { + Workspaces: serializeAws_json1_1WorkspaceRequestList( + input.Workspaces, + context + ) + }) + }; }; const serializeAws_json1_1DeleteIpGroupRequest = ( input: DeleteIpGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }) + }; }; const serializeAws_json1_1DeleteTagsRequest = ( input: DeleteTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.TagKeys !== undefined) { - bodyParams["TagKeys"] = serializeAws_json1_1TagKeyList( - input.TagKeys, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.TagKeys !== undefined && { + TagKeys: serializeAws_json1_1TagKeyList(input.TagKeys, context) + }) + }; }; const serializeAws_json1_1DeleteWorkspaceImageRequest = ( input: DeleteWorkspaceImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ImageId !== undefined) { - bodyParams["ImageId"] = input.ImageId; - } - return bodyParams; + return { + ...(input.ImageId !== undefined && { ImageId: input.ImageId }) + }; }; const serializeAws_json1_1DeregisterWorkspaceDirectoryRequest = ( input: DeregisterWorkspaceDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }) + }; }; const serializeAws_json1_1DescribeAccountModificationsRequest = ( input: DescribeAccountModificationsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeAccountRequest = ( input: DescribeAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1DescribeClientPropertiesRequest = ( input: DescribeClientPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceIds !== undefined) { - bodyParams["ResourceIds"] = serializeAws_json1_1ResourceIdList( - input.ResourceIds, - context - ); - } - return bodyParams; + return { + ...(input.ResourceIds !== undefined && { + ResourceIds: serializeAws_json1_1ResourceIdList( + input.ResourceIds, + context + ) + }) + }; }; const serializeAws_json1_1DescribeIpGroupsRequest = ( input: DescribeIpGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupIds !== undefined) { - bodyParams["GroupIds"] = serializeAws_json1_1IpGroupIdList( - input.GroupIds, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.GroupIds !== undefined && { + GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeTagsRequest = ( input: DescribeTagsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1DescribeWorkspaceBundlesRequest = ( input: DescribeWorkspaceBundlesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleIds !== undefined) { - bodyParams["BundleIds"] = serializeAws_json1_1BundleIdList( - input.BundleIds, - context - ); - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.Owner !== undefined) { - bodyParams["Owner"] = input.Owner; - } - return bodyParams; + return { + ...(input.BundleIds !== undefined && { + BundleIds: serializeAws_json1_1BundleIdList(input.BundleIds, context) + }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.Owner !== undefined && { Owner: input.Owner }) + }; }; const serializeAws_json1_1DescribeWorkspaceDirectoriesRequest = ( input: DescribeWorkspaceDirectoriesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryIds !== undefined) { - bodyParams["DirectoryIds"] = serializeAws_json1_1DirectoryIdList( - input.DirectoryIds, - context - ); - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.DirectoryIds !== undefined && { + DirectoryIds: serializeAws_json1_1DirectoryIdList( + input.DirectoryIds, + context + ) + }), + ...(input.Limit !== undefined && { Limit: input.Limit }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeWorkspaceImagesRequest = ( input: DescribeWorkspaceImagesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ImageIds !== undefined) { - bodyParams["ImageIds"] = serializeAws_json1_1WorkspaceImageIdList( - input.ImageIds, - context - ); - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ImageIds !== undefined && { + ImageIds: serializeAws_json1_1WorkspaceImageIdList( + input.ImageIds, + context + ) + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1DescribeWorkspaceSnapshotsRequest = ( input: DescribeWorkspaceSnapshotsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1DescribeWorkspacesConnectionStatusRequest = ( input: DescribeWorkspacesConnectionStatusRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.WorkspaceIds !== undefined) { - bodyParams["WorkspaceIds"] = serializeAws_json1_1WorkspaceIdList( - input.WorkspaceIds, - context - ); - } - return bodyParams; + return { + ...(input.NextToken !== undefined && { NextToken: input.NextToken }), + ...(input.WorkspaceIds !== undefined && { + WorkspaceIds: serializeAws_json1_1WorkspaceIdList( + input.WorkspaceIds, + context + ) + }) + }; }; const serializeAws_json1_1DescribeWorkspacesRequest = ( input: DescribeWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.Limit !== undefined) { - bodyParams["Limit"] = input.Limit; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - if (input.WorkspaceIds !== undefined) { - bodyParams["WorkspaceIds"] = serializeAws_json1_1WorkspaceIdList( - input.WorkspaceIds, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1DirectoryIdList = ( @@ -5007,40 +4932,31 @@ const serializeAws_json1_1DisassociateIpGroupsRequest = ( input: DisassociateIpGroupsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.GroupIds !== undefined) { - bodyParams["GroupIds"] = serializeAws_json1_1IpGroupIdList( - input.GroupIds, - context - ); - } - return bodyParams; + return { + ...(input.DirectoryId !== undefined && { DirectoryId: input.DirectoryId }), + ...(input.GroupIds !== undefined && { + GroupIds: serializeAws_json1_1IpGroupIdList(input.GroupIds, context) + }) + }; }; const serializeAws_json1_1ImportWorkspaceImageRequest = ( input: ImportWorkspaceImageRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Ec2ImageId !== undefined) { - bodyParams["Ec2ImageId"] = input.Ec2ImageId; - } - if (input.ImageDescription !== undefined) { - bodyParams["ImageDescription"] = input.ImageDescription; - } - if (input.ImageName !== undefined) { - bodyParams["ImageName"] = input.ImageName; - } - if (input.IngestionProcess !== undefined) { - bodyParams["IngestionProcess"] = input.IngestionProcess; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - return bodyParams; + return { + ...(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) + }) + }; }; const serializeAws_json1_1IpGroupIdList = ( @@ -5061,14 +4977,10 @@ const serializeAws_json1_1IpRuleItem = ( input: IpRuleItem, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ipRule !== undefined) { - bodyParams["ipRule"] = input.ipRule; - } - if (input.ruleDesc !== undefined) { - bodyParams["ruleDesc"] = input.ruleDesc; - } - return bodyParams; + return { + ...(input.ipRule !== undefined && { ipRule: input.ipRule }), + ...(input.ruleDesc !== undefined && { ruleDesc: input.ruleDesc }) + }; }; const serializeAws_json1_1IpRuleList = ( @@ -5082,163 +4994,136 @@ const serializeAws_json1_1ListAvailableManagementCidrRangesRequest = ( input: ListAvailableManagementCidrRangesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ManagementCidrRangeConstraint !== undefined) { - bodyParams["ManagementCidrRangeConstraint"] = - input.ManagementCidrRangeConstraint; - } - if (input.MaxResults !== undefined) { - bodyParams["MaxResults"] = input.MaxResults; - } - if (input.NextToken !== undefined) { - bodyParams["NextToken"] = input.NextToken; - } - return bodyParams; + return { + ...(input.ManagementCidrRangeConstraint !== undefined && { + ManagementCidrRangeConstraint: input.ManagementCidrRangeConstraint + }), + ...(input.MaxResults !== undefined && { MaxResults: input.MaxResults }), + ...(input.NextToken !== undefined && { NextToken: input.NextToken }) + }; }; const serializeAws_json1_1MigrateWorkspaceRequest = ( input: MigrateWorkspaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.SourceWorkspaceId !== undefined) { - bodyParams["SourceWorkspaceId"] = input.SourceWorkspaceId; - } - return bodyParams; + return { + ...(input.BundleId !== undefined && { BundleId: input.BundleId }), + ...(input.SourceWorkspaceId !== undefined && { + SourceWorkspaceId: input.SourceWorkspaceId + }) + }; }; const serializeAws_json1_1ModifyAccountRequest = ( input: ModifyAccountRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DedicatedTenancyManagementCidrRange !== undefined) { - bodyParams["DedicatedTenancyManagementCidrRange"] = - input.DedicatedTenancyManagementCidrRange; - } - if (input.DedicatedTenancySupport !== undefined) { - bodyParams["DedicatedTenancySupport"] = input.DedicatedTenancySupport; - } - return bodyParams; + return { + ...(input.DedicatedTenancyManagementCidrRange !== undefined && { + DedicatedTenancyManagementCidrRange: + input.DedicatedTenancyManagementCidrRange + }), + ...(input.DedicatedTenancySupport !== undefined && { + DedicatedTenancySupport: input.DedicatedTenancySupport + }) + }; }; const serializeAws_json1_1ModifyClientPropertiesRequest = ( input: ModifyClientPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ClientProperties !== undefined) { - bodyParams["ClientProperties"] = serializeAws_json1_1ClientProperties( - input.ClientProperties, - context - ); - } - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - return bodyParams; + return { + ...(input.ClientProperties !== undefined && { + ClientProperties: serializeAws_json1_1ClientProperties( + input.ClientProperties, + context + ) + }), + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }) + }; }; const serializeAws_json1_1ModifySelfservicePermissionsRequest = ( input: ModifySelfservicePermissionsRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.SelfservicePermissions !== undefined) { - bodyParams[ - "SelfservicePermissions" - ] = serializeAws_json1_1SelfservicePermissions( - input.SelfservicePermissions, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.SelfservicePermissions !== undefined && { + SelfservicePermissions: serializeAws_json1_1SelfservicePermissions( + input.SelfservicePermissions, + context + ) + }) + }; }; const serializeAws_json1_1ModifyWorkspaceAccessPropertiesRequest = ( input: ModifyWorkspaceAccessPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.WorkspaceAccessProperties !== undefined) { - bodyParams[ - "WorkspaceAccessProperties" - ] = serializeAws_json1_1WorkspaceAccessProperties( - input.WorkspaceAccessProperties, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.WorkspaceAccessProperties !== undefined && { + WorkspaceAccessProperties: serializeAws_json1_1WorkspaceAccessProperties( + input.WorkspaceAccessProperties, + context + ) + }) + }; }; const serializeAws_json1_1ModifyWorkspaceCreationPropertiesRequest = ( input: ModifyWorkspaceCreationPropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ResourceId !== undefined) { - bodyParams["ResourceId"] = input.ResourceId; - } - if (input.WorkspaceCreationProperties !== undefined) { - bodyParams[ - "WorkspaceCreationProperties" - ] = serializeAws_json1_1WorkspaceCreationProperties( - input.WorkspaceCreationProperties, - context - ); - } - return bodyParams; + return { + ...(input.ResourceId !== undefined && { ResourceId: input.ResourceId }), + ...(input.WorkspaceCreationProperties !== undefined && { + WorkspaceCreationProperties: serializeAws_json1_1WorkspaceCreationProperties( + input.WorkspaceCreationProperties, + context + ) + }) + }; }; const serializeAws_json1_1ModifyWorkspacePropertiesRequest = ( input: ModifyWorkspacePropertiesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - if (input.WorkspaceProperties !== undefined) { - bodyParams["WorkspaceProperties"] = serializeAws_json1_1WorkspaceProperties( - input.WorkspaceProperties, - context - ); - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceProperties !== undefined && { + WorkspaceProperties: serializeAws_json1_1WorkspaceProperties( + input.WorkspaceProperties, + context + ) + }) + }; }; const serializeAws_json1_1ModifyWorkspaceStateRequest = ( input: ModifyWorkspaceStateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - if (input.WorkspaceState !== undefined) { - bodyParams["WorkspaceState"] = input.WorkspaceState; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }), + ...(input.WorkspaceState !== undefined && { + WorkspaceState: input.WorkspaceState + }) + }; }; const serializeAws_json1_1RebootRequest = ( input: RebootRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1RebootWorkspaceRequests = ( @@ -5252,27 +5137,23 @@ const serializeAws_json1_1RebootWorkspacesRequest = ( input: RebootWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RebootWorkspaceRequests !== undefined) { - bodyParams[ - "RebootWorkspaceRequests" - ] = serializeAws_json1_1RebootWorkspaceRequests( - input.RebootWorkspaceRequests, - context - ); - } - return bodyParams; + return { + ...(input.RebootWorkspaceRequests !== undefined && { + RebootWorkspaceRequests: serializeAws_json1_1RebootWorkspaceRequests( + input.RebootWorkspaceRequests, + context + ) + }) + }; }; const serializeAws_json1_1RebuildRequest = ( input: RebuildRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1RebuildWorkspaceRequests = ( @@ -5286,45 +5167,36 @@ const serializeAws_json1_1RebuildWorkspacesRequest = ( input: RebuildWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.RebuildWorkspaceRequests !== undefined) { - bodyParams[ - "RebuildWorkspaceRequests" - ] = serializeAws_json1_1RebuildWorkspaceRequests( - input.RebuildWorkspaceRequests, - context - ); - } - return bodyParams; + return { + ...(input.RebuildWorkspaceRequests !== undefined && { + RebuildWorkspaceRequests: serializeAws_json1_1RebuildWorkspaceRequests( + input.RebuildWorkspaceRequests, + context + ) + }) + }; }; const serializeAws_json1_1RegisterWorkspaceDirectoryRequest = ( input: RegisterWorkspaceDirectoryRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.EnableSelfService !== undefined) { - bodyParams["EnableSelfService"] = input.EnableSelfService; - } - if (input.EnableWorkDocs !== undefined) { - bodyParams["EnableWorkDocs"] = input.EnableWorkDocs; - } - if (input.SubnetIds !== undefined) { - bodyParams["SubnetIds"] = serializeAws_json1_1SubnetIds( - input.SubnetIds, - context - ); - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.Tenancy !== undefined) { - bodyParams["Tenancy"] = input.Tenancy; - } - return bodyParams; + 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 }) + }; }; const serializeAws_json1_1ResourceIdList = ( @@ -5338,62 +5210,53 @@ const serializeAws_json1_1RestoreWorkspaceRequest = ( input: RestoreWorkspaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1RevokeIpRulesRequest = ( input: RevokeIpRulesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.UserRules !== undefined) { - bodyParams["UserRules"] = serializeAws_json1_1IpRevokedRuleList( - input.UserRules, - context - ); - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.UserRules !== undefined && { + UserRules: serializeAws_json1_1IpRevokedRuleList(input.UserRules, context) + }) + }; }; const serializeAws_json1_1SelfservicePermissions = ( input: SelfservicePermissions, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ChangeComputeType !== undefined) { - bodyParams["ChangeComputeType"] = input.ChangeComputeType; - } - if (input.IncreaseVolumeSize !== undefined) { - bodyParams["IncreaseVolumeSize"] = input.IncreaseVolumeSize; - } - if (input.RebuildWorkspace !== undefined) { - bodyParams["RebuildWorkspace"] = input.RebuildWorkspace; - } - if (input.RestartWorkspace !== undefined) { - bodyParams["RestartWorkspace"] = input.RestartWorkspace; - } - if (input.SwitchRunningMode !== undefined) { - bodyParams["SwitchRunningMode"] = input.SwitchRunningMode; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1StartRequest = ( input: StartRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1StartWorkspaceRequests = ( @@ -5407,27 +5270,23 @@ const serializeAws_json1_1StartWorkspacesRequest = ( input: StartWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StartWorkspaceRequests !== undefined) { - bodyParams[ - "StartWorkspaceRequests" - ] = serializeAws_json1_1StartWorkspaceRequests( - input.StartWorkspaceRequests, - context - ); - } - return bodyParams; + return { + ...(input.StartWorkspaceRequests !== undefined && { + StartWorkspaceRequests: serializeAws_json1_1StartWorkspaceRequests( + input.StartWorkspaceRequests, + context + ) + }) + }; }; const serializeAws_json1_1StopRequest = ( input: StopRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1StopWorkspaceRequests = ( @@ -5441,16 +5300,14 @@ const serializeAws_json1_1StopWorkspacesRequest = ( input: StopWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.StopWorkspaceRequests !== undefined) { - bodyParams[ - "StopWorkspaceRequests" - ] = serializeAws_json1_1StopWorkspaceRequests( - input.StopWorkspaceRequests, - context - ); - } - return bodyParams; + return { + ...(input.StopWorkspaceRequests !== undefined && { + StopWorkspaceRequests: serializeAws_json1_1StopWorkspaceRequests( + input.StopWorkspaceRequests, + context + ) + }) + }; }; const serializeAws_json1_1SubnetIds = ( @@ -5461,14 +5318,10 @@ const serializeAws_json1_1SubnetIds = ( }; const serializeAws_json1_1Tag = (input: Tag, context: __SerdeContext): any => { - const bodyParams: any = {}; - if (input.Key !== undefined) { - bodyParams["Key"] = input.Key; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Key !== undefined && { Key: input.Key }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1TagKeyList = ( @@ -5489,11 +5342,9 @@ const serializeAws_json1_1TerminateRequest = ( input: TerminateRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.WorkspaceId !== undefined) { - bodyParams["WorkspaceId"] = input.WorkspaceId; - } - return bodyParams; + return { + ...(input.WorkspaceId !== undefined && { WorkspaceId: input.WorkspaceId }) + }; }; const serializeAws_json1_1TerminateWorkspaceRequests = ( @@ -5509,86 +5360,76 @@ const serializeAws_json1_1TerminateWorkspacesRequest = ( input: TerminateWorkspacesRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.TerminateWorkspaceRequests !== undefined) { - bodyParams[ - "TerminateWorkspaceRequests" - ] = serializeAws_json1_1TerminateWorkspaceRequests( - input.TerminateWorkspaceRequests, - context - ); - } - return bodyParams; + return { + ...(input.TerminateWorkspaceRequests !== undefined && { + TerminateWorkspaceRequests: serializeAws_json1_1TerminateWorkspaceRequests( + input.TerminateWorkspaceRequests, + context + ) + }) + }; }; const serializeAws_json1_1UpdateRulesOfIpGroupRequest = ( input: UpdateRulesOfIpGroupRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.GroupId !== undefined) { - bodyParams["GroupId"] = input.GroupId; - } - if (input.UserRules !== undefined) { - bodyParams["UserRules"] = serializeAws_json1_1IpRuleList( - input.UserRules, - context - ); - } - return bodyParams; + return { + ...(input.GroupId !== undefined && { GroupId: input.GroupId }), + ...(input.UserRules !== undefined && { + UserRules: serializeAws_json1_1IpRuleList(input.UserRules, context) + }) + }; }; const serializeAws_json1_1WorkspaceAccessProperties = ( input: WorkspaceAccessProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.DeviceTypeAndroid !== undefined) { - bodyParams["DeviceTypeAndroid"] = input.DeviceTypeAndroid; - } - if (input.DeviceTypeChromeOs !== undefined) { - bodyParams["DeviceTypeChromeOs"] = input.DeviceTypeChromeOs; - } - if (input.DeviceTypeIos !== undefined) { - bodyParams["DeviceTypeIos"] = input.DeviceTypeIos; - } - if (input.DeviceTypeOsx !== undefined) { - bodyParams["DeviceTypeOsx"] = input.DeviceTypeOsx; - } - if (input.DeviceTypeWeb !== undefined) { - bodyParams["DeviceTypeWeb"] = input.DeviceTypeWeb; - } - if (input.DeviceTypeWindows !== undefined) { - bodyParams["DeviceTypeWindows"] = input.DeviceTypeWindows; - } - if (input.DeviceTypeZeroClient !== undefined) { - bodyParams["DeviceTypeZeroClient"] = input.DeviceTypeZeroClient; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1WorkspaceCreationProperties = ( input: WorkspaceCreationProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.CustomSecurityGroupId !== undefined) { - bodyParams["CustomSecurityGroupId"] = input.CustomSecurityGroupId; - } - if (input.DefaultOu !== undefined) { - bodyParams["DefaultOu"] = input.DefaultOu; - } - if (input.EnableInternetAccess !== undefined) { - bodyParams["EnableInternetAccess"] = input.EnableInternetAccess; - } - if (input.EnableMaintenanceMode !== undefined) { - bodyParams["EnableMaintenanceMode"] = input.EnableMaintenanceMode; - } - if (input.UserEnabledAsLocalAdministrator !== undefined) { - bodyParams["UserEnabledAsLocalAdministrator"] = - input.UserEnabledAsLocalAdministrator; - } - return bodyParams; + 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.UserEnabledAsLocalAdministrator !== undefined && { + UserEnabledAsLocalAdministrator: input.UserEnabledAsLocalAdministrator + }) + }; }; const serializeAws_json1_1WorkspaceIdList = ( @@ -5609,61 +5450,51 @@ const serializeAws_json1_1WorkspaceProperties = ( input: WorkspaceProperties, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ComputeTypeName !== undefined) { - bodyParams["ComputeTypeName"] = input.ComputeTypeName; - } - if (input.RootVolumeSizeGib !== undefined) { - bodyParams["RootVolumeSizeGib"] = input.RootVolumeSizeGib; - } - if (input.RunningMode !== undefined) { - bodyParams["RunningMode"] = input.RunningMode; - } - if (input.RunningModeAutoStopTimeoutInMinutes !== undefined) { - bodyParams["RunningModeAutoStopTimeoutInMinutes"] = - input.RunningModeAutoStopTimeoutInMinutes; - } - if (input.UserVolumeSizeGib !== undefined) { - bodyParams["UserVolumeSizeGib"] = input.UserVolumeSizeGib; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_json1_1WorkspaceRequest = ( input: WorkspaceRequest, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BundleId !== undefined) { - bodyParams["BundleId"] = input.BundleId; - } - if (input.DirectoryId !== undefined) { - bodyParams["DirectoryId"] = input.DirectoryId; - } - if (input.RootVolumeEncryptionEnabled !== undefined) { - bodyParams["RootVolumeEncryptionEnabled"] = - input.RootVolumeEncryptionEnabled; - } - if (input.Tags !== undefined) { - bodyParams["Tags"] = serializeAws_json1_1TagList(input.Tags, context); - } - if (input.UserName !== undefined) { - bodyParams["UserName"] = input.UserName; - } - if (input.UserVolumeEncryptionEnabled !== undefined) { - bodyParams["UserVolumeEncryptionEnabled"] = - input.UserVolumeEncryptionEnabled; - } - if (input.VolumeEncryptionKey !== undefined) { - bodyParams["VolumeEncryptionKey"] = input.VolumeEncryptionKey; - } - if (input.WorkspaceProperties !== undefined) { - bodyParams["WorkspaceProperties"] = serializeAws_json1_1WorkspaceProperties( - input.WorkspaceProperties, - context - ); - } - return bodyParams; + 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 + ) + }) + }; }; const serializeAws_json1_1WorkspaceRequestList = ( diff --git a/clients/client-xray/protocols/Aws_restJson1_1.ts b/clients/client-xray/protocols/Aws_restJson1_1.ts index aff6ac99d524..11e5b3bd42e2 100644 --- a/clients/client-xray/protocols/Aws_restJson1_1.ts +++ b/clients/client-xray/protocols/Aws_restJson1_1.ts @@ -2443,149 +2443,99 @@ const serializeAws_restJson1_1BackendConnectionErrors = ( input: BackendConnectionErrors, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.ConnectionRefusedCount !== undefined) { - bodyParams["ConnectionRefusedCount"] = input.ConnectionRefusedCount; - } - if (input.HTTPCode4XXCount !== undefined) { - bodyParams["HTTPCode4XXCount"] = input.HTTPCode4XXCount; - } - if (input.HTTPCode5XXCount !== undefined) { - bodyParams["HTTPCode5XXCount"] = input.HTTPCode5XXCount; - } - if (input.OtherCount !== undefined) { - bodyParams["OtherCount"] = input.OtherCount; - } - if (input.TimeoutCount !== undefined) { - bodyParams["TimeoutCount"] = input.TimeoutCount; - } - if (input.UnknownHostCount !== undefined) { - bodyParams["UnknownHostCount"] = input.UnknownHostCount; - } - return bodyParams; + 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 + }) + }; }; const serializeAws_restJson1_1SamplingRule = ( input: SamplingRule, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1AttributeMap( - input.Attributes, - context - ); - } - if (input.FixedRate !== undefined) { - bodyParams["FixedRate"] = input.FixedRate; - } - if (input.HTTPMethod !== undefined) { - bodyParams["HTTPMethod"] = input.HTTPMethod; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.ReservoirSize !== undefined) { - bodyParams["ReservoirSize"] = input.ReservoirSize; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RuleARN !== undefined) { - bodyParams["RuleARN"] = input.RuleARN; - } - if (input.RuleName !== undefined) { - bodyParams["RuleName"] = input.RuleName; - } - if (input.ServiceName !== undefined) { - bodyParams["ServiceName"] = input.ServiceName; - } - if (input.ServiceType !== undefined) { - bodyParams["ServiceType"] = input.ServiceType; - } - if (input.URLPath !== undefined) { - bodyParams["URLPath"] = input.URLPath; - } - if (input.Version !== undefined) { - bodyParams["Version"] = input.Version; - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1AttributeMap( + 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 }) + }; }; const serializeAws_restJson1_1SamplingRuleUpdate = ( input: SamplingRuleUpdate, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Attributes !== undefined) { - bodyParams["Attributes"] = serializeAws_restJson1_1AttributeMap( - input.Attributes, - context - ); - } - if (input.FixedRate !== undefined) { - bodyParams["FixedRate"] = input.FixedRate; - } - if (input.HTTPMethod !== undefined) { - bodyParams["HTTPMethod"] = input.HTTPMethod; - } - if (input.Host !== undefined) { - bodyParams["Host"] = input.Host; - } - if (input.Priority !== undefined) { - bodyParams["Priority"] = input.Priority; - } - if (input.ReservoirSize !== undefined) { - bodyParams["ReservoirSize"] = input.ReservoirSize; - } - if (input.ResourceARN !== undefined) { - bodyParams["ResourceARN"] = input.ResourceARN; - } - if (input.RuleARN !== undefined) { - bodyParams["RuleARN"] = input.RuleARN; - } - if (input.RuleName !== undefined) { - bodyParams["RuleName"] = input.RuleName; - } - if (input.ServiceName !== undefined) { - bodyParams["ServiceName"] = input.ServiceName; - } - if (input.ServiceType !== undefined) { - bodyParams["ServiceType"] = input.ServiceType; - } - if (input.URLPath !== undefined) { - bodyParams["URLPath"] = input.URLPath; - } - return bodyParams; + return { + ...(input.Attributes !== undefined && { + Attributes: serializeAws_restJson1_1AttributeMap( + 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 }) + }; }; const serializeAws_restJson1_1SamplingStatisticsDocument = ( input: SamplingStatisticsDocument, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BorrowCount !== undefined) { - bodyParams["BorrowCount"] = input.BorrowCount; - } - if (input.ClientID !== undefined) { - bodyParams["ClientID"] = input.ClientID; - } - if (input.RequestCount !== undefined) { - bodyParams["RequestCount"] = input.RequestCount; - } - if (input.RuleName !== undefined) { - bodyParams["RuleName"] = input.RuleName; - } - if (input.SampledCount !== undefined) { - bodyParams["SampledCount"] = input.SampledCount; - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - return bodyParams; + 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) + }) + }; }; const serializeAws_restJson1_1SamplingStatisticsDocumentList = ( @@ -2601,45 +2551,39 @@ const serializeAws_restJson1_1SamplingStrategy = ( input: SamplingStrategy, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Name !== undefined) { - bodyParams["Name"] = input.Name; - } - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Name !== undefined && { Name: input.Name }), + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_restJson1_1TelemetryRecord = ( input: TelemetryRecord, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.BackendConnectionErrors !== undefined) { - bodyParams[ - "BackendConnectionErrors" - ] = serializeAws_restJson1_1BackendConnectionErrors( - input.BackendConnectionErrors, - context - ); - } - if (input.SegmentsReceivedCount !== undefined) { - bodyParams["SegmentsReceivedCount"] = input.SegmentsReceivedCount; - } - if (input.SegmentsRejectedCount !== undefined) { - bodyParams["SegmentsRejectedCount"] = input.SegmentsRejectedCount; - } - if (input.SegmentsSentCount !== undefined) { - bodyParams["SegmentsSentCount"] = input.SegmentsSentCount; - } - if (input.SegmentsSpilloverCount !== undefined) { - bodyParams["SegmentsSpilloverCount"] = input.SegmentsSpilloverCount; - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - return bodyParams; + return { + ...(input.BackendConnectionErrors !== undefined && { + BackendConnectionErrors: serializeAws_restJson1_1BackendConnectionErrors( + 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) + }) + }; }; const serializeAws_restJson1_1TelemetryRecordList = ( diff --git a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/JsonShapeSerVisitor.java b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/JsonShapeSerVisitor.java index 31c56ad08aca..8eca09b825ef 100644 --- a/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/JsonShapeSerVisitor.java +++ b/codegen/smithy-aws-typescript-codegen/src/main/java/software/amazon/smithy/aws/typescript/codegen/JsonShapeSerVisitor.java @@ -25,6 +25,7 @@ import software.amazon.smithy.model.shapes.Shape; import software.amazon.smithy.model.shapes.StructureShape; import software.amazon.smithy.model.shapes.UnionShape; +import software.amazon.smithy.model.traits.IdempotencyTokenTrait; import software.amazon.smithy.model.traits.JsonNameTrait; import software.amazon.smithy.model.traits.TimestampFormatTrait; import software.amazon.smithy.model.traits.TimestampFormatTrait.Format; @@ -88,35 +89,31 @@ public void serializeMap(GenerationContext context, MapShape shape) { public void serializeStructure(GenerationContext context, StructureShape shape) { TypeScriptWriter writer = context.getWriter(); - writer.write("const bodyParams: any = {};"); - // Use a TreeMap to sort the members. - Map members = new TreeMap<>(shape.getAllMembers()); - members.forEach((memberName, memberShape) -> { - // Use the jsonName trait value if present, otherwise use the member name. - String locationName = memberShape.getTrait(JsonNameTrait.class) - .map(JsonNameTrait::getValue) - .orElse(memberName); - Shape target = context.getModel().expectShape(memberShape.getTarget()); - String inputLocation = "input." + memberName; - - // Handle if the member is an idempotency token that should be auto-filled. - AwsProtocolUtils.writeIdempotencyAutofill(context, memberShape, inputLocation); - - // Generate an if statement to set the bodyParam if the member is set. - writer.openBlock("if ($L !== undefined) {", "}", inputLocation, () -> { - String dataSource = "input." + memberName; + writer.openBlock("return {", "};", () -> { + // Use a TreeMap to sort the members. + Map members = new TreeMap<>(shape.getAllMembers()); + members.forEach((memberName, memberShape) -> { + // Use the jsonName trait value if present, otherwise use the member name. + String locationName = memberShape.getTrait(JsonNameTrait.class) + .map(JsonNameTrait::getValue) + .orElse(memberName); + Shape target = context.getModel().expectShape(memberShape.getTarget()); + String inputLocation = "input." + memberName; // Handle @timestampFormat on members not just the targeted shape. String valueProvider = memberShape.hasTrait(TimestampFormatTrait.class) ? AwsProtocolUtils.getInputTimestampValueProvider(context, memberShape, - TIMESTAMP_FORMAT, dataSource) - : target.accept(getMemberVisitor(dataSource)); - - // Dispatch to the input value provider for any additional handling. - writer.write("bodyParams['$L'] = $L;", locationName, valueProvider); + TIMESTAMP_FORMAT, inputLocation) + : target.accept(getMemberVisitor(inputLocation)); + + if (memberShape.hasTrait(IdempotencyTokenTrait.class)) { + writer.write("'$L': $L ?? generateIdempotencyToken(),", locationName, valueProvider); + } else { + writer.write("...($L !== undefined && { '$L': $L }),", inputLocation, locationName, valueProvider); + } }); + }); - writer.write("return bodyParams;"); } @Override diff --git a/protocol_tests/aws-json/protocols/Aws_json1_1.ts b/protocol_tests/aws-json/protocols/Aws_json1_1.ts index 3bc61c36bea4..7222f4bc28aa 100644 --- a/protocol_tests/aws-json/protocols/Aws_json1_1.ts +++ b/protocol_tests/aws-json/protocols/Aws_json1_1.ts @@ -284,143 +284,117 @@ const serializeAws_json1_1EmptyStruct = ( input: EmptyStruct, context: __SerdeContext ): any => { - const bodyParams: any = {}; - return bodyParams; + return {}; }; const serializeAws_json1_1KitchenSink = ( input: KitchenSink, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Blob !== undefined) { - bodyParams["Blob"] = context.base64Encoder(input.Blob); - } - if (input.Boolean !== undefined) { - bodyParams["Boolean"] = input.Boolean; - } - if (input.Double !== undefined) { - bodyParams["Double"] = input.Double; - } - if (input.EmptyStruct !== undefined) { - bodyParams["EmptyStruct"] = serializeAws_json1_1EmptyStruct( - input.EmptyStruct, - context - ); - } - if (input.Float !== undefined) { - bodyParams["Float"] = input.Float; - } - if (input.HttpdateTimestamp !== undefined) { - bodyParams["HttpdateTimestamp"] = __dateToUtcString( - input.HttpdateTimestamp - ); - } - if (input.Integer !== undefined) { - bodyParams["Integer"] = input.Integer; - } - if (input.Iso8601Timestamp !== undefined) { - bodyParams["Iso8601Timestamp"] = - input.Iso8601Timestamp.toISOString().split(".")[0] + "Z"; - } - if (input.JsonValue !== undefined) { - bodyParams["JsonValue"] = __LazyJsonString.fromObject(input.JsonValue); - } - if (input.ListOfLists !== undefined) { - bodyParams["ListOfLists"] = serializeAws_json1_1ListOfListOfStrings( - input.ListOfLists, - context - ); - } - if (input.ListOfMapsOfStrings !== undefined) { - bodyParams["ListOfMapsOfStrings"] = serializeAws_json1_1ListOfMapsOfStrings( - input.ListOfMapsOfStrings, - context - ); - } - if (input.ListOfStrings !== undefined) { - bodyParams["ListOfStrings"] = serializeAws_json1_1ListOfStrings( - input.ListOfStrings, - context - ); - } - if (input.ListOfStructs !== undefined) { - bodyParams["ListOfStructs"] = serializeAws_json1_1ListOfStructs( - input.ListOfStructs, - context - ); - } - if (input.Long !== undefined) { - bodyParams["Long"] = input.Long; - } - if (input.MapOfListsOfStrings !== undefined) { - bodyParams["MapOfListsOfStrings"] = serializeAws_json1_1MapOfListsOfStrings( - input.MapOfListsOfStrings, - context - ); - } - if (input.MapOfMaps !== undefined) { - bodyParams["MapOfMaps"] = serializeAws_json1_1MapOfMapOfStrings( - input.MapOfMaps, - context - ); - } - if (input.MapOfStrings !== undefined) { - bodyParams["MapOfStrings"] = serializeAws_json1_1MapOfStrings( - input.MapOfStrings, - context - ); - } - if (input.MapOfStructs !== undefined) { - bodyParams["MapOfStructs"] = serializeAws_json1_1MapOfStructs( - input.MapOfStructs, - context - ); - } - if (input.RecursiveList !== undefined) { - bodyParams["RecursiveList"] = serializeAws_json1_1ListOfKitchenSinks( - input.RecursiveList, - context - ); - } - if (input.RecursiveMap !== undefined) { - bodyParams["RecursiveMap"] = serializeAws_json1_1MapOfKitchenSinks( - input.RecursiveMap, - context - ); - } - if (input.RecursiveStruct !== undefined) { - bodyParams["RecursiveStruct"] = serializeAws_json1_1KitchenSink( - input.RecursiveStruct, - context - ); - } - if (input.SimpleStruct !== undefined) { - bodyParams["SimpleStruct"] = serializeAws_json1_1SimpleStruct( - input.SimpleStruct, - context - ); - } - if (input.String !== undefined) { - bodyParams["String"] = input.String; - } - if (input.StructWithLocationName !== undefined) { - bodyParams[ - "StructWithLocationName" - ] = serializeAws_json1_1StructWithLocationName( - input.StructWithLocationName, - context - ); - } - if (input.Timestamp !== undefined) { - bodyParams["Timestamp"] = Math.round(input.Timestamp.getTime() / 1000); - } - if (input.UnixTimestamp !== undefined) { - bodyParams["UnixTimestamp"] = Math.round( - input.UnixTimestamp.getTime() / 1000 - ); - } - return bodyParams; + return { + ...(input.Blob !== undefined && { + Blob: context.base64Encoder(input.Blob) + }), + ...(input.Boolean !== undefined && { Boolean: input.Boolean }), + ...(input.Double !== undefined && { Double: input.Double }), + ...(input.EmptyStruct !== undefined && { + EmptyStruct: serializeAws_json1_1EmptyStruct(input.EmptyStruct, context) + }), + ...(input.Float !== undefined && { Float: input.Float }), + ...(input.HttpdateTimestamp !== undefined && { + HttpdateTimestamp: __dateToUtcString(input.HttpdateTimestamp) + }), + ...(input.Integer !== undefined && { Integer: input.Integer }), + ...(input.Iso8601Timestamp !== undefined && { + Iso8601Timestamp: input.Iso8601Timestamp.toISOString().split(".")[0] + "Z" + }), + ...(input.JsonValue !== undefined && { + JsonValue: __LazyJsonString.fromObject(input.JsonValue) + }), + ...(input.ListOfLists !== undefined && { + ListOfLists: serializeAws_json1_1ListOfListOfStrings( + input.ListOfLists, + context + ) + }), + ...(input.ListOfMapsOfStrings !== undefined && { + ListOfMapsOfStrings: serializeAws_json1_1ListOfMapsOfStrings( + input.ListOfMapsOfStrings, + context + ) + }), + ...(input.ListOfStrings !== undefined && { + ListOfStrings: serializeAws_json1_1ListOfStrings( + input.ListOfStrings, + context + ) + }), + ...(input.ListOfStructs !== undefined && { + ListOfStructs: serializeAws_json1_1ListOfStructs( + input.ListOfStructs, + context + ) + }), + ...(input.Long !== undefined && { Long: input.Long }), + ...(input.MapOfListsOfStrings !== undefined && { + MapOfListsOfStrings: serializeAws_json1_1MapOfListsOfStrings( + input.MapOfListsOfStrings, + context + ) + }), + ...(input.MapOfMaps !== undefined && { + MapOfMaps: serializeAws_json1_1MapOfMapOfStrings(input.MapOfMaps, context) + }), + ...(input.MapOfStrings !== undefined && { + MapOfStrings: serializeAws_json1_1MapOfStrings( + input.MapOfStrings, + context + ) + }), + ...(input.MapOfStructs !== undefined && { + MapOfStructs: serializeAws_json1_1MapOfStructs( + input.MapOfStructs, + context + ) + }), + ...(input.RecursiveList !== undefined && { + RecursiveList: serializeAws_json1_1ListOfKitchenSinks( + input.RecursiveList, + context + ) + }), + ...(input.RecursiveMap !== undefined && { + RecursiveMap: serializeAws_json1_1MapOfKitchenSinks( + input.RecursiveMap, + context + ) + }), + ...(input.RecursiveStruct !== undefined && { + RecursiveStruct: serializeAws_json1_1KitchenSink( + input.RecursiveStruct, + context + ) + }), + ...(input.SimpleStruct !== undefined && { + SimpleStruct: serializeAws_json1_1SimpleStruct( + input.SimpleStruct, + context + ) + }), + ...(input.String !== undefined && { String: input.String }), + ...(input.StructWithLocationName !== undefined && { + StructWithLocationName: serializeAws_json1_1StructWithLocationName( + input.StructWithLocationName, + context + ) + }), + ...(input.Timestamp !== undefined && { + Timestamp: Math.round(input.Timestamp.getTime() / 1000) + }), + ...(input.UnixTimestamp !== undefined && { + UnixTimestamp: Math.round(input.UnixTimestamp.getTime() / 1000) + }) + }; }; const serializeAws_json1_1ListOfKitchenSinks = ( @@ -512,22 +486,18 @@ const serializeAws_json1_1SimpleStruct = ( input: SimpleStruct, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Value !== undefined) { - bodyParams["Value"] = input.Value; - } - return bodyParams; + return { + ...(input.Value !== undefined && { Value: input.Value }) + }; }; const serializeAws_json1_1StructWithLocationName = ( input: StructWithLocationName, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.Value !== undefined) { - bodyParams["RenamedMember"] = input.Value; - } - return bodyParams; + return { + ...(input.Value !== undefined && { RenamedMember: input.Value }) + }; }; const deserializeAws_json1_1EmptyStruct = ( diff --git a/protocol_tests/aws-restjson/protocols/Aws_restJson1_1.ts b/protocol_tests/aws-restjson/protocols/Aws_restJson1_1.ts index 3a3527844469..0dbc217c2132 100644 --- a/protocol_tests/aws-restjson/protocols/Aws_restJson1_1.ts +++ b/protocol_tests/aws-restjson/protocols/Aws_restJson1_1.ts @@ -3089,52 +3089,40 @@ const serializeAws_restJson1_1NestedPayload = ( input: NestedPayload, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.greeting !== undefined) { - bodyParams["greeting"] = input.greeting; - } - if (input.name !== undefined) { - bodyParams["name"] = input.name; - } - return bodyParams; + return { + ...(input.greeting !== undefined && { greeting: input.greeting }), + ...(input.name !== undefined && { name: input.name }) + }; }; const serializeAws_restJson1_1RecursiveShapesInputOutputNested1 = ( input: RecursiveShapesInputOutputNested1, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.foo !== undefined) { - bodyParams["foo"] = input.foo; - } - if (input.nested !== undefined) { - bodyParams[ - "nested" - ] = serializeAws_restJson1_1RecursiveShapesInputOutputNested2( - input.nested, - context - ); - } - return bodyParams; + return { + ...(input.foo !== undefined && { foo: input.foo }), + ...(input.nested !== undefined && { + nested: serializeAws_restJson1_1RecursiveShapesInputOutputNested2( + input.nested, + context + ) + }) + }; }; const serializeAws_restJson1_1RecursiveShapesInputOutputNested2 = ( input: RecursiveShapesInputOutputNested2, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.bar !== undefined) { - bodyParams["bar"] = input.bar; - } - if (input.recursiveMember !== undefined) { - bodyParams[ - "recursiveMember" - ] = serializeAws_restJson1_1RecursiveShapesInputOutputNested1( - input.recursiveMember, - context - ); - } - return bodyParams; + return { + ...(input.bar !== undefined && { bar: input.bar }), + ...(input.recursiveMember !== undefined && { + recursiveMember: serializeAws_restJson1_1RecursiveShapesInputOutputNested1( + input.recursiveMember, + context + ) + }) + }; }; const serializeAws_restJson1_1StructureList = ( @@ -3150,14 +3138,10 @@ const serializeAws_restJson1_1StructureListMember = ( input: StructureListMember, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.a !== undefined) { - bodyParams["value"] = input.a; - } - if (input.b !== undefined) { - bodyParams["other"] = input.b; - } - return bodyParams; + return { + ...(input.a !== undefined && { value: input.a }), + ...(input.b !== undefined && { other: input.b }) + }; }; const serializeAws_restJson1_1BooleanList = ( @@ -3195,11 +3179,9 @@ const serializeAws_restJson1_1GreetingStruct = ( input: GreetingStruct, context: __SerdeContext ): any => { - const bodyParams: any = {}; - if (input.hi !== undefined) { - bodyParams["hi"] = input.hi; - } - return bodyParams; + return { + ...(input.hi !== undefined && { hi: input.hi }) + }; }; const serializeAws_restJson1_1IntegerList = (