import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectNonNull as __expectNonNull , expectString as __expectString , extendedEncodeURIComponent as __extendedEncodeURIComponent , getArrayIfSingleItem as __getArrayIfSingleItem , getValueFromTextNode as __getValueFromTextNode , parseBoolean as __parseBoolean , parseRfc3339DateTime as __parseRfc3339DateTime , strictParseFloat as __strictParseFloat , strictParseInt32 as __strictParseInt32 , strictParseLong as __strictParseLong , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { decodeHTML } from "entities" ; import { parse as xmlParse } from "fast-xml-parser" ; import { AbortEnvironmentUpdateCommandInput , AbortEnvironmentUpdateCommandOutput , } from "../commands/AbortEnvironmentUpdateCommand" ; import { ApplyEnvironmentManagedActionCommandInput , ApplyEnvironmentManagedActionCommandOutput , } from "../commands/ApplyEnvironmentManagedActionCommand" ; import { AssociateEnvironmentOperationsRoleCommandInput , AssociateEnvironmentOperationsRoleCommandOutput , } from "../commands/AssociateEnvironmentOperationsRoleCommand" ; import { CheckDNSAvailabilityCommandInput , CheckDNSAvailabilityCommandOutput , } from "../commands/CheckDNSAvailabilityCommand" ; import { ComposeEnvironmentsCommandInput , ComposeEnvironmentsCommandOutput , } from "../commands/ComposeEnvironmentsCommand" ; import { CreateApplicationCommandInput , CreateApplicationCommandOutput } from "../commands/CreateApplicationCommand" ; import { CreateApplicationVersionCommandInput , CreateApplicationVersionCommandOutput , } from "../commands/CreateApplicationVersionCommand" ; import { CreateConfigurationTemplateCommandInput , CreateConfigurationTemplateCommandOutput , } from "../commands/CreateConfigurationTemplateCommand" ; import { CreateEnvironmentCommandInput , CreateEnvironmentCommandOutput } from "../commands/CreateEnvironmentCommand" ; import { CreatePlatformVersionCommandInput , CreatePlatformVersionCommandOutput , } from "../commands/CreatePlatformVersionCommand" ; import { CreateStorageLocationCommandInput , CreateStorageLocationCommandOutput , } from "../commands/CreateStorageLocationCommand" ; import { DeleteApplicationCommandInput , DeleteApplicationCommandOutput } from "../commands/DeleteApplicationCommand" ; import { DeleteApplicationVersionCommandInput , DeleteApplicationVersionCommandOutput , } from "../commands/DeleteApplicationVersionCommand" ; import { DeleteConfigurationTemplateCommandInput , DeleteConfigurationTemplateCommandOutput , } from "../commands/DeleteConfigurationTemplateCommand" ; import { DeleteEnvironmentConfigurationCommandInput , DeleteEnvironmentConfigurationCommandOutput , } from "../commands/DeleteEnvironmentConfigurationCommand" ; import { DeletePlatformVersionCommandInput , DeletePlatformVersionCommandOutput , } from "../commands/DeletePlatformVersionCommand" ; import { DescribeAccountAttributesCommandInput , DescribeAccountAttributesCommandOutput , } from "../commands/DescribeAccountAttributesCommand" ; import { DescribeApplicationsCommandInput , DescribeApplicationsCommandOutput , } from "../commands/DescribeApplicationsCommand" ; import { DescribeApplicationVersionsCommandInput , DescribeApplicationVersionsCommandOutput , } from "../commands/DescribeApplicationVersionsCommand" ; import { DescribeConfigurationOptionsCommandInput , DescribeConfigurationOptionsCommandOutput , } from "../commands/DescribeConfigurationOptionsCommand" ; import { DescribeConfigurationSettingsCommandInput , DescribeConfigurationSettingsCommandOutput , } from "../commands/DescribeConfigurationSettingsCommand" ; import { DescribeEnvironmentHealthCommandInput , DescribeEnvironmentHealthCommandOutput , } from "../commands/DescribeEnvironmentHealthCommand" ; import { DescribeEnvironmentManagedActionHistoryCommandInput , DescribeEnvironmentManagedActionHistoryCommandOutput , } from "../commands/DescribeEnvironmentManagedActionHistoryCommand" ; import { DescribeEnvironmentManagedActionsCommandInput , DescribeEnvironmentManagedActionsCommandOutput , } from "../commands/DescribeEnvironmentManagedActionsCommand" ; import { DescribeEnvironmentResourcesCommandInput , DescribeEnvironmentResourcesCommandOutput , } from "../commands/DescribeEnvironmentResourcesCommand" ; import { DescribeEnvironmentsCommandInput , DescribeEnvironmentsCommandOutput , } from "../commands/DescribeEnvironmentsCommand" ; import { DescribeEventsCommandInput , DescribeEventsCommandOutput } from "../commands/DescribeEventsCommand" ; import { DescribeInstancesHealthCommandInput , DescribeInstancesHealthCommandOutput , } from "../commands/DescribeInstancesHealthCommand" ; import { DescribePlatformVersionCommandInput , DescribePlatformVersionCommandOutput , } from "../commands/DescribePlatformVersionCommand" ; import { DisassociateEnvironmentOperationsRoleCommandInput , DisassociateEnvironmentOperationsRoleCommandOutput , } from "../commands/DisassociateEnvironmentOperationsRoleCommand" ; import { ListAvailableSolutionStacksCommandInput , ListAvailableSolutionStacksCommandOutput , } from "../commands/ListAvailableSolutionStacksCommand" ; import { ListPlatformBranchesCommandInput , ListPlatformBranchesCommandOutput , } from "../commands/ListPlatformBranchesCommand" ; import { ListPlatformVersionsCommandInput , ListPlatformVersionsCommandOutput , } from "../commands/ListPlatformVersionsCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { RebuildEnvironmentCommandInput , RebuildEnvironmentCommandOutput } from "../commands/RebuildEnvironmentCommand" ; import { RequestEnvironmentInfoCommandInput , RequestEnvironmentInfoCommandOutput , } from "../commands/RequestEnvironmentInfoCommand" ; import { RestartAppServerCommandInput , RestartAppServerCommandOutput } from "../commands/RestartAppServerCommand" ; import { RetrieveEnvironmentInfoCommandInput , RetrieveEnvironmentInfoCommandOutput , } from "../commands/RetrieveEnvironmentInfoCommand" ; import { SwapEnvironmentCNAMEsCommandInput , SwapEnvironmentCNAMEsCommandOutput , } from "../commands/SwapEnvironmentCNAMEsCommand" ; import { TerminateEnvironmentCommandInput , TerminateEnvironmentCommandOutput , } from "../commands/TerminateEnvironmentCommand" ; import { UpdateApplicationCommandInput , UpdateApplicationCommandOutput } from "../commands/UpdateApplicationCommand" ; import { UpdateApplicationResourceLifecycleCommandInput , UpdateApplicationResourceLifecycleCommandOutput , } from "../commands/UpdateApplicationResourceLifecycleCommand" ; import { UpdateApplicationVersionCommandInput , UpdateApplicationVersionCommandOutput , } from "../commands/UpdateApplicationVersionCommand" ; import { UpdateConfigurationTemplateCommandInput , UpdateConfigurationTemplateCommandOutput , } from "../commands/UpdateConfigurationTemplateCommand" ; import { UpdateEnvironmentCommandInput , UpdateEnvironmentCommandOutput } from "../commands/UpdateEnvironmentCommand" ; import { UpdateTagsForResourceCommandInput , UpdateTagsForResourceCommandOutput , } from "../commands/UpdateTagsForResourceCommand" ; import { ValidateConfigurationSettingsCommandInput , ValidateConfigurationSettingsCommandOutput , } from "../commands/ValidateConfigurationSettingsCommand" ; import { AbortEnvironmentUpdateMessage , ApplicationDescription , ApplicationDescriptionMessage , ApplicationDescriptionsMessage , ApplicationMetrics , ApplicationResourceLifecycleConfig , ApplicationResourceLifecycleDescriptionMessage , ApplicationVersionDescription , ApplicationVersionDescriptionMessage , ApplicationVersionDescriptionsMessage , ApplicationVersionLifecycleConfig , ApplyEnvironmentManagedActionRequest , ApplyEnvironmentManagedActionResult , AssociateEnvironmentOperationsRoleMessage , AutoScalingGroup , BuildConfiguration , Builder , CheckDNSAvailabilityMessage , CheckDNSAvailabilityResultMessage , CodeBuildNotInServiceRegionException , ComposeEnvironmentsMessage , ConfigurationOptionDescription , ConfigurationOptionsDescription , ConfigurationOptionSetting , ConfigurationSettingsDescription , ConfigurationSettingsDescriptions , ConfigurationSettingsValidationMessages , CPUUtilization , CreateApplicationMessage , CreateApplicationVersionMessage , CreateConfigurationTemplateMessage , CreateEnvironmentMessage , CreatePlatformVersionRequest , CreatePlatformVersionResult , CreateStorageLocationResultMessage , CustomAmi , DeleteApplicationMessage , DeleteApplicationVersionMessage , DeleteConfigurationTemplateMessage , DeleteEnvironmentConfigurationMessage , DeletePlatformVersionRequest , DeletePlatformVersionResult , Deployment , DescribeAccountAttributesResult , DescribeApplicationsMessage , DescribeApplicationVersionsMessage , DescribeConfigurationOptionsMessage , DescribeConfigurationSettingsMessage , DescribeEnvironmentHealthRequest , DescribeEnvironmentHealthResult , DescribeEnvironmentManagedActionHistoryRequest , DescribeEnvironmentManagedActionHistoryResult , DescribeEnvironmentManagedActionsRequest , DescribeEnvironmentManagedActionsResult , DescribeEnvironmentResourcesMessage , DescribeEnvironmentsMessage , DescribeEventsMessage , DescribeInstancesHealthRequest , DescribeInstancesHealthResult , DescribePlatformVersionRequest , DescribePlatformVersionResult , DisassociateEnvironmentOperationsRoleMessage , ElasticBeanstalkServiceException , EnvironmentDescription , EnvironmentDescriptionsMessage , EnvironmentHealthAttribute , EnvironmentInfoDescription , EnvironmentLink , EnvironmentResourceDescription , EnvironmentResourceDescriptionsMessage , EnvironmentResourcesDescription , EnvironmentTier , EventDescription , EventDescriptionsMessage , Instance , InstanceHealthSummary , InstancesHealthAttribute , InsufficientPrivilegesException , InvalidRequestException , Latency , LaunchConfiguration , LaunchTemplate , ListAvailableSolutionStacksResultMessage , Listener , ListPlatformBranchesRequest , ListPlatformBranchesResult , ListPlatformVersionsRequest , ListPlatformVersionsResult , ListTagsForResourceMessage , LoadBalancer , LoadBalancerDescription , ManagedAction , ManagedActionHistoryItem , ManagedActionInvalidStateException , MaxAgeRule , MaxCountRule , OperationInProgressException , OptionRestrictionRegex , OptionSpecification , PlatformBranchSummary , PlatformDescription , PlatformFilter , PlatformFramework , PlatformProgrammingLanguage , PlatformSummary , PlatformVersionStillReferencedException , Queue , RebuildEnvironmentMessage , RequestEnvironmentInfoMessage , ResourceNotFoundException , ResourceQuota , ResourceQuotas , ResourceTagsDescriptionMessage , ResourceTypeNotSupportedException , RestartAppServerMessage , RetrieveEnvironmentInfoMessage , RetrieveEnvironmentInfoResultMessage , S3Location , S3LocationNotInServiceRegionException , S3SubscriptionRequiredException , SearchFilter , SingleInstanceHealth , SolutionStackDescription , SourceBuildInformation , SourceBundleDeletionException , SourceConfiguration , StatusCodes , SwapEnvironmentCNAMEsMessage , SystemStatus , Tag , TerminateEnvironmentMessage , TooManyApplicationsException , TooManyApplicationVersionsException , TooManyBucketsException , TooManyConfigurationTemplatesException , TooManyEnvironmentsException , TooManyPlatformsException , TooManyTagsException , Trigger , UpdateApplicationMessage , UpdateApplicationResourceLifecycleMessage , UpdateApplicationVersionMessage , UpdateConfigurationTemplateMessage , UpdateEnvironmentMessage , UpdateTagsForResourceMessage , ValidateConfigurationSettingsMessage , ValidationMessage , } from "../models/models_0" ; export const serializeAws_queryAbortEnvironmentUpdateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAbortEnvironmentUpdateMessage ( input , context ) , Action : "AbortEnvironmentUpdate" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryApplyEnvironmentManagedActionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryApplyEnvironmentManagedActionRequest ( input , context ) , Action : "ApplyEnvironmentManagedAction" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryAssociateEnvironmentOperationsRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAssociateEnvironmentOperationsRoleMessage ( input , context ) , Action : "AssociateEnvironmentOperationsRole" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCheckDNSAvailabilityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCheckDNSAvailabilityMessage ( input , context ) , Action : "CheckDNSAvailability" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryComposeEnvironmentsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryComposeEnvironmentsMessage ( input , context ) , Action : "ComposeEnvironments" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateApplicationMessage ( input , context ) , Action : "CreateApplication" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateApplicationVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateApplicationVersionMessage ( input , context ) , Action : "CreateApplicationVersion" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateConfigurationTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateConfigurationTemplateMessage ( input , context ) , Action : "CreateConfigurationTemplate" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateEnvironmentMessage ( input , context ) , Action : "CreateEnvironment" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreatePlatformVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreatePlatformVersionRequest ( input , context ) , Action : "CreatePlatformVersion" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateStorageLocationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "CreateStorageLocation" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteApplicationMessage ( input , context ) , Action : "DeleteApplication" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteApplicationVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteApplicationVersionMessage ( input , context ) , Action : "DeleteApplicationVersion" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteConfigurationTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteConfigurationTemplateMessage ( input , context ) , Action : "DeleteConfigurationTemplate" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteEnvironmentConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteEnvironmentConfigurationMessage ( input , context ) , Action : "DeleteEnvironmentConfiguration" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeletePlatformVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeletePlatformVersionRequest ( input , context ) , Action : "DeletePlatformVersion" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeAccountAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "DescribeAccountAttributes" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeApplicationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeApplicationsMessage ( input , context ) , Action : "DescribeApplications" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeApplicationVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeApplicationVersionsMessage ( input , context ) , Action : "DescribeApplicationVersions" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeConfigurationOptionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeConfigurationOptionsMessage ( input , context ) , Action : "DescribeConfigurationOptions" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeConfigurationSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeConfigurationSettingsMessage ( input , context ) , Action : "DescribeConfigurationSettings" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeEnvironmentHealthCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeEnvironmentHealthRequest ( input , context ) , Action : "DescribeEnvironmentHealth" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeEnvironmentManagedActionHistoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeEnvironmentManagedActionHistoryRequest ( input , context ) , Action : "DescribeEnvironmentManagedActionHistory" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeEnvironmentManagedActionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeEnvironmentManagedActionsRequest ( input , context ) , Action : "DescribeEnvironmentManagedActions" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeEnvironmentResourcesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeEnvironmentResourcesMessage ( input , context ) , Action : "DescribeEnvironmentResources" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeEnvironmentsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeEnvironmentsMessage ( input , context ) , Action : "DescribeEnvironments" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeEventsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeEventsMessage ( input , context ) , Action : "DescribeEvents" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribeInstancesHealthCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribeInstancesHealthRequest ( input , context ) , Action : "DescribeInstancesHealth" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDescribePlatformVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDescribePlatformVersionRequest ( input , context ) , Action : "DescribePlatformVersion" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDisassociateEnvironmentOperationsRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDisassociateEnvironmentOperationsRoleMessage ( input , context ) , Action : "DisassociateEnvironmentOperationsRole" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListAvailableSolutionStacksCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "ListAvailableSolutionStacks" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListPlatformBranchesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListPlatformBranchesRequest ( input , context ) , Action : "ListPlatformBranches" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListPlatformVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListPlatformVersionsRequest ( input , context ) , Action : "ListPlatformVersions" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListTagsForResourceMessage ( input , context ) , Action : "ListTagsForResource" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRebuildEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRebuildEnvironmentMessage ( input , context ) , Action : "RebuildEnvironment" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRequestEnvironmentInfoCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRequestEnvironmentInfoMessage ( input , context ) , Action : "RequestEnvironmentInfo" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRestartAppServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRestartAppServerMessage ( input , context ) , Action : "RestartAppServer" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRetrieveEnvironmentInfoCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRetrieveEnvironmentInfoMessage ( input , context ) , Action : "RetrieveEnvironmentInfo" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_querySwapEnvironmentCNAMEsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_querySwapEnvironmentCNAMEsMessage ( input , context ) , Action : "SwapEnvironmentCNAMEs" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTerminateEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTerminateEnvironmentMessage ( input , context ) , Action : "TerminateEnvironment" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateApplicationMessage ( input , context ) , Action : "UpdateApplication" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateApplicationResourceLifecycleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateApplicationResourceLifecycleMessage ( input , context ) , Action : "UpdateApplicationResourceLifecycle" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateApplicationVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateApplicationVersionMessage ( input , context ) , Action : "UpdateApplicationVersion" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateConfigurationTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateConfigurationTemplateMessage ( input , context ) , Action : "UpdateConfigurationTemplate" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateEnvironmentMessage ( input , context ) , Action : "UpdateEnvironment" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateTagsForResourceMessage ( input , context ) , Action : "UpdateTagsForResource" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryValidateConfigurationSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryValidateConfigurationSettingsMessage ( input , context ) , Action : "ValidateConfigurationSettings" , Version : "2010-12-01" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_queryAbortEnvironmentUpdateCommand = async ( output , context ) : Promise < AbortEnvironmentUpdateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAbortEnvironmentUpdateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAbortEnvironmentUpdateCommandError = async ( output , context ) : Promise < AbortEnvironmentUpdateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryApplyEnvironmentManagedActionCommand = async ( output , context ) : Promise < ApplyEnvironmentManagedActionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryApplyEnvironmentManagedActionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplyEnvironmentManagedActionResult ( data . ApplyEnvironmentManagedActionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryApplyEnvironmentManagedActionCommandError = async ( output , context ) : Promise < ApplyEnvironmentManagedActionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ManagedActionInvalidStateException" : case "com.amazonaws.elasticbeanstalk#ManagedActionInvalidStateException" : response = { ... ( await deserializeAws_queryManagedActionInvalidStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryAssociateEnvironmentOperationsRoleCommand = async ( output , context ) : Promise < AssociateEnvironmentOperationsRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAssociateEnvironmentOperationsRoleCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAssociateEnvironmentOperationsRoleCommandError = async ( output , context ) : Promise < AssociateEnvironmentOperationsRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCheckDNSAvailabilityCommand = async ( output , context ) : Promise < CheckDNSAvailabilityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCheckDNSAvailabilityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCheckDNSAvailabilityResultMessage ( data . CheckDNSAvailabilityResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCheckDNSAvailabilityCommandError = async ( output , context ) : Promise < CheckDNSAvailabilityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryComposeEnvironmentsCommand = async ( output , context ) : Promise < ComposeEnvironmentsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryComposeEnvironmentsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEnvironmentDescriptionsMessage ( data . ComposeEnvironmentsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryComposeEnvironmentsCommandError = async ( output , context ) : Promise < ComposeEnvironmentsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyEnvironmentsException" : case "com.amazonaws.elasticbeanstalk#TooManyEnvironmentsException" : response = { ... ( await deserializeAws_queryTooManyEnvironmentsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateApplicationCommand = async ( output , context ) : Promise < CreateApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateApplicationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationDescriptionMessage ( data . CreateApplicationResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateApplicationCommandError = async ( output , context ) : Promise < CreateApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "TooManyApplicationsException" : case "com.amazonaws.elasticbeanstalk#TooManyApplicationsException" : response = { ... ( await deserializeAws_queryTooManyApplicationsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateApplicationVersionCommand = async ( output , context ) : Promise < CreateApplicationVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateApplicationVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationVersionDescriptionMessage ( data . CreateApplicationVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateApplicationVersionCommandError = async ( output , context ) : Promise < CreateApplicationVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeBuildNotInServiceRegionException" : case "com.amazonaws.elasticbeanstalk#CodeBuildNotInServiceRegionException" : response = { ... ( await deserializeAws_queryCodeBuildNotInServiceRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "S3LocationNotInServiceRegionException" : case "com.amazonaws.elasticbeanstalk#S3LocationNotInServiceRegionException" : response = { ... ( await deserializeAws_queryS3LocationNotInServiceRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyApplicationsException" : case "com.amazonaws.elasticbeanstalk#TooManyApplicationsException" : response = { ... ( await deserializeAws_queryTooManyApplicationsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyApplicationVersionsException" : case "com.amazonaws.elasticbeanstalk#TooManyApplicationVersionsException" : response = { ... ( await deserializeAws_queryTooManyApplicationVersionsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateConfigurationTemplateCommand = async ( output , context ) : Promise < CreateConfigurationTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateConfigurationTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryConfigurationSettingsDescription ( data . CreateConfigurationTemplateResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateConfigurationTemplateCommandError = async ( output , context ) : Promise < CreateConfigurationTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyConfigurationTemplatesException" : case "com.amazonaws.elasticbeanstalk#TooManyConfigurationTemplatesException" : response = { ... ( await deserializeAws_queryTooManyConfigurationTemplatesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateEnvironmentCommand = async ( output , context ) : Promise < CreateEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEnvironmentDescription ( data . CreateEnvironmentResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateEnvironmentCommandError = async ( output , context ) : Promise < CreateEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyEnvironmentsException" : case "com.amazonaws.elasticbeanstalk#TooManyEnvironmentsException" : response = { ... ( await deserializeAws_queryTooManyEnvironmentsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreatePlatformVersionCommand = async ( output , context ) : Promise < CreatePlatformVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreatePlatformVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreatePlatformVersionResult ( data . CreatePlatformVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreatePlatformVersionCommandError = async ( output , context ) : Promise < CreatePlatformVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyPlatformsException" : case "com.amazonaws.elasticbeanstalk#TooManyPlatformsException" : response = { ... ( await deserializeAws_queryTooManyPlatformsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateStorageLocationCommand = async ( output , context ) : Promise < CreateStorageLocationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateStorageLocationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateStorageLocationResultMessage ( data . CreateStorageLocationResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateStorageLocationCommandError = async ( output , context ) : Promise < CreateStorageLocationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "S3SubscriptionRequiredException" : case "com.amazonaws.elasticbeanstalk#S3SubscriptionRequiredException" : response = { ... ( await deserializeAws_queryS3SubscriptionRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteApplicationCommand = async ( output , context ) : Promise < DeleteApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteApplicationCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteApplicationCommandError = async ( output , context ) : Promise < DeleteApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "OperationInProgressException" : case "com.amazonaws.elasticbeanstalk#OperationInProgressException" : response = { ... ( await deserializeAws_queryOperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteApplicationVersionCommand = async ( output , context ) : Promise < DeleteApplicationVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteApplicationVersionCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteApplicationVersionCommandError = async ( output , context ) : Promise < DeleteApplicationVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationInProgressException" : case "com.amazonaws.elasticbeanstalk#OperationInProgressException" : response = { ... ( await deserializeAws_queryOperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "S3LocationNotInServiceRegionException" : case "com.amazonaws.elasticbeanstalk#S3LocationNotInServiceRegionException" : response = { ... ( await deserializeAws_queryS3LocationNotInServiceRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SourceBundleDeletionException" : case "com.amazonaws.elasticbeanstalk#SourceBundleDeletionException" : response = { ... ( await deserializeAws_querySourceBundleDeletionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteConfigurationTemplateCommand = async ( output , context ) : Promise < DeleteConfigurationTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteConfigurationTemplateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteConfigurationTemplateCommandError = async ( output , context ) : Promise < DeleteConfigurationTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "OperationInProgressException" : case "com.amazonaws.elasticbeanstalk#OperationInProgressException" : response = { ... ( await deserializeAws_queryOperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteEnvironmentConfigurationCommand = async ( output , context ) : Promise < DeleteEnvironmentConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteEnvironmentConfigurationCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteEnvironmentConfigurationCommandError = async ( output , context ) : Promise < DeleteEnvironmentConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeletePlatformVersionCommand = async ( output , context ) : Promise < DeletePlatformVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeletePlatformVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDeletePlatformVersionResult ( data . DeletePlatformVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeletePlatformVersionCommandError = async ( output , context ) : Promise < DeletePlatformVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationInProgressException" : case "com.amazonaws.elasticbeanstalk#OperationInProgressException" : response = { ... ( await deserializeAws_queryOperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PlatformVersionStillReferencedException" : case "com.amazonaws.elasticbeanstalk#PlatformVersionStillReferencedException" : response = { ... ( await deserializeAws_queryPlatformVersionStillReferencedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeAccountAttributesCommand = async ( output , context ) : Promise < DescribeAccountAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeAccountAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDescribeAccountAttributesResult ( data . DescribeAccountAttributesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeAccountAttributesCommandError = async ( output , context ) : Promise < DescribeAccountAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeApplicationsCommand = async ( output , context ) : Promise < DescribeApplicationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeApplicationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationDescriptionsMessage ( data . DescribeApplicationsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeApplicationsCommandError = async ( output , context ) : Promise < DescribeApplicationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeApplicationVersionsCommand = async ( output , context ) : Promise < DescribeApplicationVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeApplicationVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationVersionDescriptionsMessage ( data . DescribeApplicationVersionsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeApplicationVersionsCommandError = async ( output , context ) : Promise < DescribeApplicationVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeConfigurationOptionsCommand = async ( output , context ) : Promise < DescribeConfigurationOptionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeConfigurationOptionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryConfigurationOptionsDescription ( data . DescribeConfigurationOptionsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeConfigurationOptionsCommandError = async ( output , context ) : Promise < DescribeConfigurationOptionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeConfigurationSettingsCommand = async ( output , context ) : Promise < DescribeConfigurationSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeConfigurationSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryConfigurationSettingsDescriptions ( data . DescribeConfigurationSettingsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeConfigurationSettingsCommandError = async ( output , context ) : Promise < DescribeConfigurationSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeEnvironmentHealthCommand = async ( output , context ) : Promise < DescribeEnvironmentHealthCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeEnvironmentHealthCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDescribeEnvironmentHealthResult ( data . DescribeEnvironmentHealthResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeEnvironmentHealthCommandError = async ( output , context ) : Promise < DescribeEnvironmentHealthCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.elasticbeanstalk#InvalidRequestException" : response = { ... ( await deserializeAws_queryInvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeEnvironmentManagedActionHistoryCommand = async ( output , context ) : Promise < DescribeEnvironmentManagedActionHistoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeEnvironmentManagedActionHistoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDescribeEnvironmentManagedActionHistoryResult ( data . DescribeEnvironmentManagedActionHistoryResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeEnvironmentManagedActionHistoryCommandError = async ( output , context ) : Promise < DescribeEnvironmentManagedActionHistoryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeEnvironmentManagedActionsCommand = async ( output , context ) : Promise < DescribeEnvironmentManagedActionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeEnvironmentManagedActionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDescribeEnvironmentManagedActionsResult ( data . DescribeEnvironmentManagedActionsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeEnvironmentManagedActionsCommandError = async ( output , context ) : Promise < DescribeEnvironmentManagedActionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeEnvironmentResourcesCommand = async ( output , context ) : Promise < DescribeEnvironmentResourcesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeEnvironmentResourcesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEnvironmentResourceDescriptionsMessage ( data . DescribeEnvironmentResourcesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeEnvironmentResourcesCommandError = async ( output , context ) : Promise < DescribeEnvironmentResourcesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeEnvironmentsCommand = async ( output , context ) : Promise < DescribeEnvironmentsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeEnvironmentsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEnvironmentDescriptionsMessage ( data . DescribeEnvironmentsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeEnvironmentsCommandError = async ( output , context ) : Promise < DescribeEnvironmentsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeEventsCommand = async ( output , context ) : Promise < DescribeEventsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeEventsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEventDescriptionsMessage ( data . DescribeEventsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeEventsCommandError = async ( output , context ) : Promise < DescribeEventsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribeInstancesHealthCommand = async ( output , context ) : Promise < DescribeInstancesHealthCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribeInstancesHealthCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDescribeInstancesHealthResult ( data . DescribeInstancesHealthResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribeInstancesHealthCommandError = async ( output , context ) : Promise < DescribeInstancesHealthCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.elasticbeanstalk#InvalidRequestException" : response = { ... ( await deserializeAws_queryInvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDescribePlatformVersionCommand = async ( output , context ) : Promise < DescribePlatformVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDescribePlatformVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDescribePlatformVersionResult ( data . DescribePlatformVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDescribePlatformVersionCommandError = async ( output , context ) : Promise < DescribePlatformVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDisassociateEnvironmentOperationsRoleCommand = async ( output , context ) : Promise < DisassociateEnvironmentOperationsRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDisassociateEnvironmentOperationsRoleCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDisassociateEnvironmentOperationsRoleCommandError = async ( output , context ) : Promise < DisassociateEnvironmentOperationsRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListAvailableSolutionStacksCommand = async ( output , context ) : Promise < ListAvailableSolutionStacksCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListAvailableSolutionStacksCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListAvailableSolutionStacksResultMessage ( data . ListAvailableSolutionStacksResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListAvailableSolutionStacksCommandError = async ( output , context ) : Promise < ListAvailableSolutionStacksCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListPlatformBranchesCommand = async ( output , context ) : Promise < ListPlatformBranchesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListPlatformBranchesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListPlatformBranchesResult ( data . ListPlatformBranchesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListPlatformBranchesCommandError = async ( output , context ) : Promise < ListPlatformBranchesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListPlatformVersionsCommand = async ( output , context ) : Promise < ListPlatformVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListPlatformVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListPlatformVersionsResult ( data . ListPlatformVersionsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListPlatformVersionsCommandError = async ( output , context ) : Promise < ListPlatformVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ElasticBeanstalkServiceException" : case "com.amazonaws.elasticbeanstalk#ElasticBeanstalkServiceException" : response = { ... ( await deserializeAws_queryElasticBeanstalkServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryResourceTagsDescriptionMessage ( data . ListTagsForResourceResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.elasticbeanstalk#ResourceNotFoundException" : response = { ... ( await deserializeAws_queryResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceTypeNotSupportedException" : case "com.amazonaws.elasticbeanstalk#ResourceTypeNotSupportedException" : response = { ... ( await deserializeAws_queryResourceTypeNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRebuildEnvironmentCommand = async ( output , context ) : Promise < RebuildEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRebuildEnvironmentCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRebuildEnvironmentCommandError = async ( output , context ) : Promise < RebuildEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRequestEnvironmentInfoCommand = async ( output , context ) : Promise < RequestEnvironmentInfoCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRequestEnvironmentInfoCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRequestEnvironmentInfoCommandError = async ( output , context ) : Promise < RequestEnvironmentInfoCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRestartAppServerCommand = async ( output , context ) : Promise < RestartAppServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRestartAppServerCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRestartAppServerCommandError = async ( output , context ) : Promise < RestartAppServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRetrieveEnvironmentInfoCommand = async ( output , context ) : Promise < RetrieveEnvironmentInfoCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRetrieveEnvironmentInfoCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryRetrieveEnvironmentInfoResultMessage ( data . RetrieveEnvironmentInfoResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRetrieveEnvironmentInfoCommandError = async ( output , context ) : Promise < RetrieveEnvironmentInfoCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_querySwapEnvironmentCNAMEsCommand = async ( output , context ) : Promise < SwapEnvironmentCNAMEsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_querySwapEnvironmentCNAMEsCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_querySwapEnvironmentCNAMEsCommandError = async ( output , context ) : Promise < SwapEnvironmentCNAMEsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTerminateEnvironmentCommand = async ( output , context ) : Promise < TerminateEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTerminateEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEnvironmentDescription ( data . TerminateEnvironmentResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTerminateEnvironmentCommandError = async ( output , context ) : Promise < TerminateEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateApplicationCommand = async ( output , context ) : Promise < UpdateApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateApplicationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationDescriptionMessage ( data . UpdateApplicationResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateApplicationCommandError = async ( output , context ) : Promise < UpdateApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateApplicationResourceLifecycleCommand = async ( output , context ) : Promise < UpdateApplicationResourceLifecycleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateApplicationResourceLifecycleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationResourceLifecycleDescriptionMessage ( data . UpdateApplicationResourceLifecycleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateApplicationResourceLifecycleCommandError = async ( output , context ) : Promise < UpdateApplicationResourceLifecycleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateApplicationVersionCommand = async ( output , context ) : Promise < UpdateApplicationVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateApplicationVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryApplicationVersionDescriptionMessage ( data . UpdateApplicationVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateApplicationVersionCommandError = async ( output , context ) : Promise < UpdateApplicationVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateConfigurationTemplateCommand = async ( output , context ) : Promise < UpdateConfigurationTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateConfigurationTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryConfigurationSettingsDescription ( data . UpdateConfigurationTemplateResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateConfigurationTemplateCommandError = async ( output , context ) : Promise < UpdateConfigurationTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateEnvironmentCommand = async ( output , context ) : Promise < UpdateEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryEnvironmentDescription ( data . UpdateEnvironmentResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateEnvironmentCommandError = async ( output , context ) : Promise < UpdateEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateTagsForResourceCommand = async ( output , context ) : Promise < UpdateTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateTagsForResourceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateTagsForResourceCommandError = async ( output , context ) : Promise < UpdateTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationInProgressException" : case "com.amazonaws.elasticbeanstalk#OperationInProgressException" : response = { ... ( await deserializeAws_queryOperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.elasticbeanstalk#ResourceNotFoundException" : response = { ... ( await deserializeAws_queryResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceTypeNotSupportedException" : case "com.amazonaws.elasticbeanstalk#ResourceTypeNotSupportedException" : response = { ... ( await deserializeAws_queryResourceTypeNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTagsException" : case "com.amazonaws.elasticbeanstalk#TooManyTagsException" : response = { ... ( await deserializeAws_queryTooManyTagsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryValidateConfigurationSettingsCommand = async ( output , context ) : Promise < ValidateConfigurationSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryValidateConfigurationSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryConfigurationSettingsValidationMessages ( data . ValidateConfigurationSettingsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryValidateConfigurationSettingsCommandError = async ( output , context ) : Promise < ValidateConfigurationSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InsufficientPrivilegesException" : case "com.amazonaws.elasticbeanstalk#InsufficientPrivilegesException" : response = { ... ( await deserializeAws_queryInsufficientPrivilegesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyBucketsException" : case "com.amazonaws.elasticbeanstalk#TooManyBucketsException" : response = { ... ( await deserializeAws_queryTooManyBucketsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_queryCodeBuildNotInServiceRegionExceptionResponse = async ( parsedOutput , context ) : Promise < CodeBuildNotInServiceRegionException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryCodeBuildNotInServiceRegionException ( body . Error , context ) ; const contents = { name : "CodeBuildNotInServiceRegionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryElasticBeanstalkServiceExceptionResponse = async ( parsedOutput , context ) : Promise < ElasticBeanstalkServiceException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryElasticBeanstalkServiceException ( body . Error , context ) ; const contents = { name : "ElasticBeanstalkServiceException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInsufficientPrivilegesExceptionResponse = async ( parsedOutput , context ) : Promise < InsufficientPrivilegesException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInsufficientPrivilegesException ( body . Error , context ) ; const contents = { name : "InsufficientPrivilegesException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInvalidRequestExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidRequestException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInvalidRequestException ( body . Error , context ) ; const contents = { name : "InvalidRequestException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryManagedActionInvalidStateExceptionResponse = async ( parsedOutput , context ) : Promise < ManagedActionInvalidStateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryManagedActionInvalidStateException ( body . Error , context ) ; const contents = { name : "ManagedActionInvalidStateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryOperationInProgressExceptionResponse = async ( parsedOutput , context ) : Promise < OperationInProgressException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryOperationInProgressException ( body . Error , context ) ; const contents = { name : "OperationInProgressException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryPlatformVersionStillReferencedExceptionResponse = async ( parsedOutput , context ) : Promise < PlatformVersionStillReferencedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryPlatformVersionStillReferencedException ( body . Error , context ) ; const contents = { name : "PlatformVersionStillReferencedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryResourceNotFoundException ( body . Error , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryResourceTypeNotSupportedExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceTypeNotSupportedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryResourceTypeNotSupportedException ( body . Error , context ) ; const contents = { name : "ResourceTypeNotSupportedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryS3LocationNotInServiceRegionExceptionResponse = async ( parsedOutput , context ) : Promise < S3LocationNotInServiceRegionException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryS3LocationNotInServiceRegionException ( body . Error , context ) ; const contents = { name : "S3LocationNotInServiceRegionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryS3SubscriptionRequiredExceptionResponse = async ( parsedOutput , context ) : Promise < S3SubscriptionRequiredException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryS3SubscriptionRequiredException ( body . Error , context ) ; const contents = { name : "S3SubscriptionRequiredException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_querySourceBundleDeletionExceptionResponse = async ( parsedOutput , context ) : Promise < SourceBundleDeletionException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_querySourceBundleDeletionException ( body . Error , context ) ; const contents = { name : "SourceBundleDeletionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyApplicationsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyApplicationsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyApplicationsException ( body . Error , context ) ; const contents = { name : "TooManyApplicationsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyApplicationVersionsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyApplicationVersionsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyApplicationVersionsException ( body . Error , context ) ; const contents = { name : "TooManyApplicationVersionsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyBucketsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyBucketsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyBucketsException ( body . Error , context ) ; const contents = { name : "TooManyBucketsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyConfigurationTemplatesExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyConfigurationTemplatesException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyConfigurationTemplatesException ( body . Error , context ) ; const contents = { name : "TooManyConfigurationTemplatesException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyEnvironmentsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyEnvironmentsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyEnvironmentsException ( body . Error , context ) ; const contents = { name : "TooManyEnvironmentsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyPlatformsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyPlatformsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyPlatformsException ( body . Error , context ) ; const contents = { name : "TooManyPlatformsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryTooManyTagsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyTagsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryTooManyTagsException ( body . Error , context ) ; const contents = { name : "TooManyTagsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_queryAbortEnvironmentUpdateMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryApplicationNamesList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryApplicationResourceLifecycleConfig = ( input , context ) : any => { const entries = { } ; if ( input . ServiceRole !== undefined && input . ServiceRole !== null ) { entries [ "ServiceRole" ] = input . ServiceRole ; } if ( input . VersionLifecycleConfig !== undefined && input . VersionLifecycleConfig !== null ) { const memberEntries = serializeAws_queryApplicationVersionLifecycleConfig ( input . VersionLifecycleConfig , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `VersionLifecycleConfig.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryApplicationVersionLifecycleConfig = ( input , context ) : any => { const entries = { } ; if ( input . MaxCountRule !== undefined && input . MaxCountRule !== null ) { const memberEntries = serializeAws_queryMaxCountRule ( input . MaxCountRule , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `MaxCountRule.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . MaxAgeRule !== undefined && input . MaxAgeRule !== null ) { const memberEntries = serializeAws_queryMaxAgeRule ( input . MaxAgeRule , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `MaxAgeRule.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryApplyEnvironmentManagedActionRequest = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . ActionId !== undefined && input . ActionId !== null ) { entries [ "ActionId" ] = input . ActionId ; } return entries ; } ; const serializeAws_queryAssociateEnvironmentOperationsRoleMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . OperationsRole !== undefined && input . OperationsRole !== null ) { entries [ "OperationsRole" ] = input . OperationsRole ; } return entries ; } ; const serializeAws_queryBuildConfiguration = ( input , context ) : any => { const entries = { } ; if ( input . ArtifactName !== undefined && input . ArtifactName !== null ) { entries [ "ArtifactName" ] = input . ArtifactName ; } if ( input . CodeBuildServiceRole !== undefined && input . CodeBuildServiceRole !== null ) { entries [ "CodeBuildServiceRole" ] = input . CodeBuildServiceRole ; } if ( input . ComputeType !== undefined && input . ComputeType !== null ) { entries [ "ComputeType" ] = input . ComputeType ; } if ( input . Image !== undefined && input . Image !== null ) { entries [ "Image" ] = input . Image ; } if ( input . TimeoutInMinutes !== undefined && input . TimeoutInMinutes !== null ) { entries [ "TimeoutInMinutes" ] = input . TimeoutInMinutes ; } return entries ; } ; const serializeAws_queryCheckDNSAvailabilityMessage = ( input , context ) : any => { const entries = { } ; if ( input . CNAMEPrefix !== undefined && input . CNAMEPrefix !== null ) { entries [ "CNAMEPrefix" ] = input . CNAMEPrefix ; } return entries ; } ; const serializeAws_queryComposeEnvironmentsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . VersionLabels !== undefined && input . VersionLabels !== null ) { const memberEntries = serializeAws_queryVersionLabels ( input . VersionLabels , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `VersionLabels.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryConfigurationOptionSetting = ( input , context ) : any => { const entries = { } ; if ( input . ResourceName !== undefined && input . ResourceName !== null ) { entries [ "ResourceName" ] = input . ResourceName ; } if ( input . Namespace !== undefined && input . Namespace !== null ) { entries [ "Namespace" ] = input . Namespace ; } if ( input . OptionName !== undefined && input . OptionName !== null ) { entries [ "OptionName" ] = input . OptionName ; } if ( input . Value !== undefined && input . Value !== null ) { entries [ "Value" ] = input . Value ; } return entries ; } ; const serializeAws_queryConfigurationOptionSettingsList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryConfigurationOptionSetting ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryCreateApplicationMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . ResourceLifecycleConfig !== undefined && input . ResourceLifecycleConfig !== null ) { const memberEntries = serializeAws_queryApplicationResourceLifecycleConfig ( input . ResourceLifecycleConfig , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ResourceLifecycleConfig.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_queryTags ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateApplicationVersionMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . SourceBuildInformation !== undefined && input . SourceBuildInformation !== null ) { const memberEntries = serializeAws_querySourceBuildInformation ( input . SourceBuildInformation , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `SourceBuildInformation.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . SourceBundle !== undefined && input . SourceBundle !== null ) { const memberEntries = serializeAws_queryS3Location ( input . SourceBundle , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `SourceBundle.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . BuildConfiguration !== undefined && input . BuildConfiguration !== null ) { const memberEntries = serializeAws_queryBuildConfiguration ( input . BuildConfiguration , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `BuildConfiguration.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . AutoCreateApplication !== undefined && input . AutoCreateApplication !== null ) { entries [ "AutoCreateApplication" ] = input . AutoCreateApplication ; } if ( input . Process !== undefined && input . Process !== null ) { entries [ "Process" ] = input . Process ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_queryTags ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateConfigurationTemplateMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . SolutionStackName !== undefined && input . SolutionStackName !== null ) { entries [ "SolutionStackName" ] = input . SolutionStackName ; } if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } if ( input . SourceConfiguration !== undefined && input . SourceConfiguration !== null ) { const memberEntries = serializeAws_querySourceConfiguration ( input . SourceConfiguration , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `SourceConfiguration.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . OptionSettings !== undefined && input . OptionSettings !== null ) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList ( input . OptionSettings , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionSettings.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_queryTags ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateEnvironmentMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . CNAMEPrefix !== undefined && input . CNAMEPrefix !== null ) { entries [ "CNAMEPrefix" ] = input . CNAMEPrefix ; } if ( input . Tier !== undefined && input . Tier !== null ) { const memberEntries = serializeAws_queryEnvironmentTier ( input . Tier , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tier.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_queryTags ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . SolutionStackName !== undefined && input . SolutionStackName !== null ) { entries [ "SolutionStackName" ] = input . SolutionStackName ; } if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } if ( input . OptionSettings !== undefined && input . OptionSettings !== null ) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList ( input . OptionSettings , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionSettings.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . OptionsToRemove !== undefined && input . OptionsToRemove !== null ) { const memberEntries = serializeAws_queryOptionsSpecifierList ( input . OptionsToRemove , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionsToRemove.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . OperationsRole !== undefined && input . OperationsRole !== null ) { entries [ "OperationsRole" ] = input . OperationsRole ; } return entries ; } ; const serializeAws_queryCreatePlatformVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PlatformName !== undefined && input . PlatformName !== null ) { entries [ "PlatformName" ] = input . PlatformName ; } if ( input . PlatformVersion !== undefined && input . PlatformVersion !== null ) { entries [ "PlatformVersion" ] = input . PlatformVersion ; } if ( input . PlatformDefinitionBundle !== undefined && input . PlatformDefinitionBundle !== null ) { const memberEntries = serializeAws_queryS3Location ( input . PlatformDefinitionBundle , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PlatformDefinitionBundle.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . OptionSettings !== undefined && input . OptionSettings !== null ) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList ( input . OptionSettings , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionSettings.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_queryTags ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryDeleteApplicationMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TerminateEnvByForce !== undefined && input . TerminateEnvByForce !== null ) { entries [ "TerminateEnvByForce" ] = input . TerminateEnvByForce ; } return entries ; } ; const serializeAws_queryDeleteApplicationVersionMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . DeleteSourceBundle !== undefined && input . DeleteSourceBundle !== null ) { entries [ "DeleteSourceBundle" ] = input . DeleteSourceBundle ; } return entries ; } ; const serializeAws_queryDeleteConfigurationTemplateMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } return entries ; } ; const serializeAws_queryDeleteEnvironmentConfigurationMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryDeletePlatformVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } return entries ; } ; const serializeAws_queryDescribeApplicationsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationNames !== undefined && input . ApplicationNames !== null ) { const memberEntries = serializeAws_queryApplicationNamesList ( input . ApplicationNames , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ApplicationNames.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryDescribeApplicationVersionsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . VersionLabels !== undefined && input . VersionLabels !== null ) { const memberEntries = serializeAws_queryVersionLabelsList ( input . VersionLabels , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `VersionLabels.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . MaxRecords !== undefined && input . MaxRecords !== null ) { entries [ "MaxRecords" ] = input . MaxRecords ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } return entries ; } ; const serializeAws_queryDescribeConfigurationOptionsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . SolutionStackName !== undefined && input . SolutionStackName !== null ) { entries [ "SolutionStackName" ] = input . SolutionStackName ; } if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } if ( input . Options !== undefined && input . Options !== null ) { const memberEntries = serializeAws_queryOptionsSpecifierList ( input . Options , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Options.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryDescribeConfigurationSettingsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryDescribeEnvironmentHealthRequest = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . AttributeNames !== undefined && input . AttributeNames !== null ) { const memberEntries = serializeAws_queryEnvironmentHealthAttributes ( input . AttributeNames , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `AttributeNames.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryDescribeEnvironmentManagedActionHistoryRequest = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryDescribeEnvironmentManagedActionsRequest = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . Status !== undefined && input . Status !== null ) { entries [ "Status" ] = input . Status ; } return entries ; } ; const serializeAws_queryDescribeEnvironmentResourcesMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryDescribeEnvironmentsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . EnvironmentIds !== undefined && input . EnvironmentIds !== null ) { const memberEntries = serializeAws_queryEnvironmentIdList ( input . EnvironmentIds , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `EnvironmentIds.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . EnvironmentNames !== undefined && input . EnvironmentNames !== null ) { const memberEntries = serializeAws_queryEnvironmentNamesList ( input . EnvironmentNames , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `EnvironmentNames.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . IncludeDeleted !== undefined && input . IncludeDeleted !== null ) { entries [ "IncludeDeleted" ] = input . IncludeDeleted ; } if ( input . IncludedDeletedBackTo !== undefined && input . IncludedDeletedBackTo !== null ) { entries [ "IncludedDeletedBackTo" ] = input . IncludedDeletedBackTo . toISOString ( ) . split ( "." ) [ 0 ] + "Z" ; } if ( input . MaxRecords !== undefined && input . MaxRecords !== null ) { entries [ "MaxRecords" ] = input . MaxRecords ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } return entries ; } ; const serializeAws_queryDescribeEventsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } if ( input . RequestId !== undefined && input . RequestId !== null ) { entries [ "RequestId" ] = input . RequestId ; } if ( input . Severity !== undefined && input . Severity !== null ) { entries [ "Severity" ] = input . Severity ; } if ( input . StartTime !== undefined && input . StartTime !== null ) { entries [ "StartTime" ] = input . StartTime . toISOString ( ) . split ( "." ) [ 0 ] + "Z" ; } if ( input . EndTime !== undefined && input . EndTime !== null ) { entries [ "EndTime" ] = input . EndTime . toISOString ( ) . split ( "." ) [ 0 ] + "Z" ; } if ( input . MaxRecords !== undefined && input . MaxRecords !== null ) { entries [ "MaxRecords" ] = input . MaxRecords ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } return entries ; } ; const serializeAws_queryDescribeInstancesHealthRequest = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . AttributeNames !== undefined && input . AttributeNames !== null ) { const memberEntries = serializeAws_queryInstancesHealthAttributes ( input . AttributeNames , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `AttributeNames.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } return entries ; } ; const serializeAws_queryDescribePlatformVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } return entries ; } ; const serializeAws_queryDisassociateEnvironmentOperationsRoleMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryEnvironmentHealthAttributes = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryEnvironmentIdList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryEnvironmentNamesList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryEnvironmentTier = ( input , context ) : any => { const entries = { } ; if ( input . Name !== undefined && input . Name !== null ) { entries [ "Name" ] = input . Name ; } if ( input . Type !== undefined && input . Type !== null ) { entries [ "Type" ] = input . Type ; } if ( input . Version !== undefined && input . Version !== null ) { entries [ "Version" ] = input . Version ; } return entries ; } ; const serializeAws_queryInstancesHealthAttributes = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryListPlatformBranchesRequest = ( input , context ) : any => { const entries = { } ; if ( input . Filters !== undefined && input . Filters !== null ) { const memberEntries = serializeAws_querySearchFilters ( input . Filters , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Filters.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . MaxRecords !== undefined && input . MaxRecords !== null ) { entries [ "MaxRecords" ] = input . MaxRecords ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } return entries ; } ; const serializeAws_queryListPlatformVersionsRequest = ( input , context ) : any => { const entries = { } ; if ( input . Filters !== undefined && input . Filters !== null ) { const memberEntries = serializeAws_queryPlatformFilters ( input . Filters , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Filters.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . MaxRecords !== undefined && input . MaxRecords !== null ) { entries [ "MaxRecords" ] = input . MaxRecords ; } if ( input . NextToken !== undefined && input . NextToken !== null ) { entries [ "NextToken" ] = input . NextToken ; } return entries ; } ; const serializeAws_queryListTagsForResourceMessage = ( input , context ) : any => { const entries = { } ; if ( input . ResourceArn !== undefined && input . ResourceArn !== null ) { entries [ "ResourceArn" ] = input . ResourceArn ; } return entries ; } ; const serializeAws_queryMaxAgeRule = ( input , context ) : any => { const entries = { } ; if ( input . Enabled !== undefined && input . Enabled !== null ) { entries [ "Enabled" ] = input . Enabled ; } if ( input . MaxAgeInDays !== undefined && input . MaxAgeInDays !== null ) { entries [ "MaxAgeInDays" ] = input . MaxAgeInDays ; } if ( input . DeleteSourceFromS3 !== undefined && input . DeleteSourceFromS3 !== null ) { entries [ "DeleteSourceFromS3" ] = input . DeleteSourceFromS3 ; } return entries ; } ; const serializeAws_queryMaxCountRule = ( input , context ) : any => { const entries = { } ; if ( input . Enabled !== undefined && input . Enabled !== null ) { entries [ "Enabled" ] = input . Enabled ; } if ( input . MaxCount !== undefined && input . MaxCount !== null ) { entries [ "MaxCount" ] = input . MaxCount ; } if ( input . DeleteSourceFromS3 !== undefined && input . DeleteSourceFromS3 !== null ) { entries [ "DeleteSourceFromS3" ] = input . DeleteSourceFromS3 ; } return entries ; } ; const serializeAws_queryOptionSpecification = ( input , context ) : any => { const entries = { } ; if ( input . ResourceName !== undefined && input . ResourceName !== null ) { entries [ "ResourceName" ] = input . ResourceName ; } if ( input . Namespace !== undefined && input . Namespace !== null ) { entries [ "Namespace" ] = input . Namespace ; } if ( input . OptionName !== undefined && input . OptionName !== null ) { entries [ "OptionName" ] = input . OptionName ; } return entries ; } ; const serializeAws_queryOptionsSpecifierList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryOptionSpecification ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryPlatformFilter = ( input , context ) : any => { const entries = { } ; if ( input . Type !== undefined && input . Type !== null ) { entries [ "Type" ] = input . Type ; } if ( input . Operator !== undefined && input . Operator !== null ) { entries [ "Operator" ] = input . Operator ; } if ( input . Values !== undefined && input . Values !== null ) { const memberEntries = serializeAws_queryPlatformFilterValueList ( input . Values , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Values.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryPlatformFilters = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryPlatformFilter ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryPlatformFilterValueList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryRebuildEnvironmentMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryRequestEnvironmentInfoMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . InfoType !== undefined && input . InfoType !== null ) { entries [ "InfoType" ] = input . InfoType ; } return entries ; } ; const serializeAws_queryRestartAppServerMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } return entries ; } ; const serializeAws_queryRetrieveEnvironmentInfoMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . InfoType !== undefined && input . InfoType !== null ) { entries [ "InfoType" ] = input . InfoType ; } return entries ; } ; const serializeAws_queryS3Location = ( input , context ) : any => { const entries = { } ; if ( input . S3Bucket !== undefined && input . S3Bucket !== null ) { entries [ "S3Bucket" ] = input . S3Bucket ; } if ( input . S3Key !== undefined && input . S3Key !== null ) { entries [ "S3Key" ] = input . S3Key ; } return entries ; } ; const serializeAws_querySearchFilter = ( input , context ) : any => { const entries = { } ; if ( input . Attribute !== undefined && input . Attribute !== null ) { entries [ "Attribute" ] = input . Attribute ; } if ( input . Operator !== undefined && input . Operator !== null ) { entries [ "Operator" ] = input . Operator ; } if ( input . Values !== undefined && input . Values !== null ) { const memberEntries = serializeAws_querySearchFilterValues ( input . Values , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Values.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_querySearchFilters = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_querySearchFilter ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_querySearchFilterValues = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_querySourceBuildInformation = ( input , context ) : any => { const entries = { } ; if ( input . SourceType !== undefined && input . SourceType !== null ) { entries [ "SourceType" ] = input . SourceType ; } if ( input . SourceRepository !== undefined && input . SourceRepository !== null ) { entries [ "SourceRepository" ] = input . SourceRepository ; } if ( input . SourceLocation !== undefined && input . SourceLocation !== null ) { entries [ "SourceLocation" ] = input . SourceLocation ; } return entries ; } ; const serializeAws_querySourceConfiguration = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } return entries ; } ; const serializeAws_querySwapEnvironmentCNAMEsMessage = ( input , context ) : any => { const entries = { } ; if ( input . SourceEnvironmentId !== undefined && input . SourceEnvironmentId !== null ) { entries [ "SourceEnvironmentId" ] = input . SourceEnvironmentId ; } if ( input . SourceEnvironmentName !== undefined && input . SourceEnvironmentName !== null ) { entries [ "SourceEnvironmentName" ] = input . SourceEnvironmentName ; } if ( input . DestinationEnvironmentId !== undefined && input . DestinationEnvironmentId !== null ) { entries [ "DestinationEnvironmentId" ] = input . DestinationEnvironmentId ; } if ( input . DestinationEnvironmentName !== undefined && input . DestinationEnvironmentName !== null ) { entries [ "DestinationEnvironmentName" ] = input . DestinationEnvironmentName ; } return entries ; } ; const serializeAws_queryTag = ( input , context ) : any => { const entries = { } ; if ( input . Key !== undefined && input . Key !== null ) { entries [ "Key" ] = input . Key ; } if ( input . Value !== undefined && input . Value !== null ) { entries [ "Value" ] = input . Value ; } return entries ; } ; const serializeAws_queryTagKeyList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryTagList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryTag ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryTags = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryTag ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryTerminateEnvironmentMessage = ( input , context ) : any => { const entries = { } ; if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . TerminateResources !== undefined && input . TerminateResources !== null ) { entries [ "TerminateResources" ] = input . TerminateResources ; } if ( input . ForceTerminate !== undefined && input . ForceTerminate !== null ) { entries [ "ForceTerminate" ] = input . ForceTerminate ; } return entries ; } ; const serializeAws_queryUpdateApplicationMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } return entries ; } ; const serializeAws_queryUpdateApplicationResourceLifecycleMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . ResourceLifecycleConfig !== undefined && input . ResourceLifecycleConfig !== null ) { const memberEntries = serializeAws_queryApplicationResourceLifecycleConfig ( input . ResourceLifecycleConfig , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ResourceLifecycleConfig.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUpdateApplicationVersionMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } return entries ; } ; const serializeAws_queryUpdateConfigurationTemplateMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . OptionSettings !== undefined && input . OptionSettings !== null ) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList ( input . OptionSettings , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionSettings.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . OptionsToRemove !== undefined && input . OptionsToRemove !== null ) { const memberEntries = serializeAws_queryOptionsSpecifierList ( input . OptionsToRemove , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionsToRemove.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUpdateEnvironmentMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . EnvironmentId !== undefined && input . EnvironmentId !== null ) { entries [ "EnvironmentId" ] = input . EnvironmentId ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . Tier !== undefined && input . Tier !== null ) { const memberEntries = serializeAws_queryEnvironmentTier ( input . Tier , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tier.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . VersionLabel !== undefined && input . VersionLabel !== null ) { entries [ "VersionLabel" ] = input . VersionLabel ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . SolutionStackName !== undefined && input . SolutionStackName !== null ) { entries [ "SolutionStackName" ] = input . SolutionStackName ; } if ( input . PlatformArn !== undefined && input . PlatformArn !== null ) { entries [ "PlatformArn" ] = input . PlatformArn ; } if ( input . OptionSettings !== undefined && input . OptionSettings !== null ) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList ( input . OptionSettings , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionSettings.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . OptionsToRemove !== undefined && input . OptionsToRemove !== null ) { const memberEntries = serializeAws_queryOptionsSpecifierList ( input . OptionsToRemove , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionsToRemove.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUpdateTagsForResourceMessage = ( input , context ) : any => { const entries = { } ; if ( input . ResourceArn !== undefined && input . ResourceArn !== null ) { entries [ "ResourceArn" ] = input . ResourceArn ; } if ( input . TagsToAdd !== undefined && input . TagsToAdd !== null ) { const memberEntries = serializeAws_queryTagList ( input . TagsToAdd , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagsToAdd.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . TagsToRemove !== undefined && input . TagsToRemove !== null ) { const memberEntries = serializeAws_queryTagKeyList ( input . TagsToRemove , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagsToRemove.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryValidateConfigurationSettingsMessage = ( input , context ) : any => { const entries = { } ; if ( input . ApplicationName !== undefined && input . ApplicationName !== null ) { entries [ "ApplicationName" ] = input . ApplicationName ; } if ( input . TemplateName !== undefined && input . TemplateName !== null ) { entries [ "TemplateName" ] = input . TemplateName ; } if ( input . EnvironmentName !== undefined && input . EnvironmentName !== null ) { entries [ "EnvironmentName" ] = input . EnvironmentName ; } if ( input . OptionSettings !== undefined && input . OptionSettings !== null ) { const memberEntries = serializeAws_queryConfigurationOptionSettingsList ( input . OptionSettings , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `OptionSettings.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryVersionLabels = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryVersionLabelsList = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const deserializeAws_queryApplicationDescription = ( output , context ) : ApplicationDescription => { const contents = { ApplicationArn : undefined , ApplicationName : undefined , Description : undefined , DateCreated : undefined , DateUpdated : undefined , Versions : undefined , ConfigurationTemplates : undefined , ResourceLifecycleConfig : undefined , } ; if ( output [ "ApplicationArn" ] !== undefined ) { contents . ApplicationArn = __expectString ( output [ "ApplicationArn" ] ) ; } if ( output [ "ApplicationName" ] !== undefined ) { contents . ApplicationName = __expectString ( output [ "ApplicationName" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "DateCreated" ] !== undefined ) { contents . DateCreated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateCreated" ] ) ) ; } if ( output [ "DateUpdated" ] !== undefined ) { contents . DateUpdated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateUpdated" ] ) ) ; } if ( output . Versions === "" ) { contents . Versions = [ ] ; } if ( output [ "Versions" ] !== undefined && output [ "Versions" ] [ "member" ] !== undefined ) { contents . Versions = deserializeAws_queryVersionLabelsList ( __getArrayIfSingleItem ( output [ "Versions" ] [ "member" ] ) , context ) ; } if ( output . ConfigurationTemplates === "" ) { contents . ConfigurationTemplates = [ ] ; } if ( output [ "ConfigurationTemplates" ] !== undefined && output [ "ConfigurationTemplates" ] [ "member" ] !== undefined ) { contents . ConfigurationTemplates = deserializeAws_queryConfigurationTemplateNamesList ( __getArrayIfSingleItem ( output [ "ConfigurationTemplates" ] [ "member" ] ) , context ) ; } if ( output [ "ResourceLifecycleConfig" ] !== undefined ) { contents . ResourceLifecycleConfig = deserializeAws_queryApplicationResourceLifecycleConfig ( output [ "ResourceLifecycleConfig" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplicationDescriptionList = ( output , context ) : ApplicationDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryApplicationDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryApplicationDescriptionMessage = ( output , context ) : ApplicationDescriptionMessage => { const contents = { Application : undefined , } ; if ( output [ "Application" ] !== undefined ) { contents . Application = deserializeAws_queryApplicationDescription ( output [ "Application" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplicationDescriptionsMessage = ( output , context ) : ApplicationDescriptionsMessage => { const contents = { Applications : undefined , } ; if ( output . Applications === "" ) { contents . Applications = [ ] ; } if ( output [ "Applications" ] !== undefined && output [ "Applications" ] [ "member" ] !== undefined ) { contents . Applications = deserializeAws_queryApplicationDescriptionList ( __getArrayIfSingleItem ( output [ "Applications" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryApplicationMetrics = ( output , context ) : ApplicationMetrics => { const contents = { Duration : undefined , RequestCount : undefined , StatusCodes : undefined , Latency : undefined , } ; if ( output [ "Duration" ] !== undefined ) { contents . Duration = __strictParseInt32 ( output [ "Duration" ] ) as number ; } if ( output [ "RequestCount" ] !== undefined ) { contents . RequestCount = __strictParseInt32 ( output [ "RequestCount" ] ) as number ; } if ( output [ "StatusCodes" ] !== undefined ) { contents . StatusCodes = deserializeAws_queryStatusCodes ( output [ "StatusCodes" ] , context ) ; } if ( output [ "Latency" ] !== undefined ) { contents . Latency = deserializeAws_queryLatency ( output [ "Latency" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplicationResourceLifecycleConfig = ( output , context ) : ApplicationResourceLifecycleConfig => { const contents = { ServiceRole : undefined , VersionLifecycleConfig : undefined , } ; if ( output [ "ServiceRole" ] !== undefined ) { contents . ServiceRole = __expectString ( output [ "ServiceRole" ] ) ; } if ( output [ "VersionLifecycleConfig" ] !== undefined ) { contents . VersionLifecycleConfig = deserializeAws_queryApplicationVersionLifecycleConfig ( output [ "VersionLifecycleConfig" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplicationResourceLifecycleDescriptionMessage = ( output , context ) : ApplicationResourceLifecycleDescriptionMessage => { const contents = { ApplicationName : undefined , ResourceLifecycleConfig : undefined , } ; if ( output [ "ApplicationName" ] !== undefined ) { contents . ApplicationName = __expectString ( output [ "ApplicationName" ] ) ; } if ( output [ "ResourceLifecycleConfig" ] !== undefined ) { contents . ResourceLifecycleConfig = deserializeAws_queryApplicationResourceLifecycleConfig ( output [ "ResourceLifecycleConfig" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplicationVersionDescription = ( output , context ) : ApplicationVersionDescription => { const contents = { ApplicationVersionArn : undefined , ApplicationName : undefined , Description : undefined , VersionLabel : undefined , SourceBuildInformation : undefined , BuildArn : undefined , SourceBundle : undefined , DateCreated : undefined , DateUpdated : undefined , Status : undefined , } ; if ( output [ "ApplicationVersionArn" ] !== undefined ) { contents . ApplicationVersionArn = __expectString ( output [ "ApplicationVersionArn" ] ) ; } if ( output [ "ApplicationName" ] !== undefined ) { contents . ApplicationName = __expectString ( output [ "ApplicationName" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "VersionLabel" ] !== undefined ) { contents . VersionLabel = __expectString ( output [ "VersionLabel" ] ) ; } if ( output [ "SourceBuildInformation" ] !== undefined ) { contents . SourceBuildInformation = deserializeAws_querySourceBuildInformation ( output [ "SourceBuildInformation" ] , context ) ; } if ( output [ "BuildArn" ] !== undefined ) { contents . BuildArn = __expectString ( output [ "BuildArn" ] ) ; } if ( output [ "SourceBundle" ] !== undefined ) { contents . SourceBundle = deserializeAws_queryS3Location ( output [ "SourceBundle" ] , context ) ; } if ( output [ "DateCreated" ] !== undefined ) { contents . DateCreated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateCreated" ] ) ) ; } if ( output [ "DateUpdated" ] !== undefined ) { contents . DateUpdated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateUpdated" ] ) ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } return contents ; } ; const deserializeAws_queryApplicationVersionDescriptionList = ( output , context ) : ApplicationVersionDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryApplicationVersionDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryApplicationVersionDescriptionMessage = ( output , context ) : ApplicationVersionDescriptionMessage => { const contents = { ApplicationVersion : undefined , } ; if ( output [ "ApplicationVersion" ] !== undefined ) { contents . ApplicationVersion = deserializeAws_queryApplicationVersionDescription ( output [ "ApplicationVersion" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplicationVersionDescriptionsMessage = ( output , context ) : ApplicationVersionDescriptionsMessage => { const contents = { ApplicationVersions : undefined , NextToken : undefined , } ; if ( output . ApplicationVersions === "" ) { contents . ApplicationVersions = [ ] ; } if ( output [ "ApplicationVersions" ] !== undefined && output [ "ApplicationVersions" ] [ "member" ] !== undefined ) { contents . ApplicationVersions = deserializeAws_queryApplicationVersionDescriptionList ( __getArrayIfSingleItem ( output [ "ApplicationVersions" ] [ "member" ] ) , context ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryApplicationVersionLifecycleConfig = ( output , context ) : ApplicationVersionLifecycleConfig => { const contents = { MaxCountRule : undefined , MaxAgeRule : undefined , } ; if ( output [ "MaxCountRule" ] !== undefined ) { contents . MaxCountRule = deserializeAws_queryMaxCountRule ( output [ "MaxCountRule" ] , context ) ; } if ( output [ "MaxAgeRule" ] !== undefined ) { contents . MaxAgeRule = deserializeAws_queryMaxAgeRule ( output [ "MaxAgeRule" ] , context ) ; } return contents ; } ; const deserializeAws_queryApplyEnvironmentManagedActionResult = ( output , context ) : ApplyEnvironmentManagedActionResult => { const contents = { ActionId : undefined , ActionDescription : undefined , ActionType : undefined , Status : undefined , } ; if ( output [ "ActionId" ] !== undefined ) { contents . ActionId = __expectString ( output [ "ActionId" ] ) ; } if ( output [ "ActionDescription" ] !== undefined ) { contents . ActionDescription = __expectString ( output [ "ActionDescription" ] ) ; } if ( output [ "ActionType" ] !== undefined ) { contents . ActionType = __expectString ( output [ "ActionType" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } return contents ; } ; const deserializeAws_queryAutoScalingGroup = ( output , context ) : AutoScalingGroup => { const contents = { Name : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } return contents ; } ; const deserializeAws_queryAutoScalingGroupList = ( output , context ) : AutoScalingGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryAutoScalingGroup ( entry , context ) ; } ) ; } ; const deserializeAws_queryAvailableSolutionStackDetailsList = ( output , context ) : SolutionStackDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_querySolutionStackDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryAvailableSolutionStackNamesList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_queryBuilder = ( output , context ) : Builder => { const contents = { ARN : undefined , } ; if ( output [ "ARN" ] !== undefined ) { contents . ARN = __expectString ( output [ "ARN" ] ) ; } return contents ; } ; const deserializeAws_queryCauses = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_queryCheckDNSAvailabilityResultMessage = ( output , context ) : CheckDNSAvailabilityResultMessage => { const contents = { Available : undefined , FullyQualifiedCNAME : undefined , } ; if ( output [ "Available" ] !== undefined ) { contents . Available = __parseBoolean ( output [ "Available" ] ) ; } if ( output [ "FullyQualifiedCNAME" ] !== undefined ) { contents . FullyQualifiedCNAME = __expectString ( output [ "FullyQualifiedCNAME" ] ) ; } return contents ; } ; const deserializeAws_queryCodeBuildNotInServiceRegionException = ( output , context ) : CodeBuildNotInServiceRegionException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryConfigurationOptionDescription = ( output , context ) : ConfigurationOptionDescription => { const contents = { Namespace : undefined , Name : undefined , DefaultValue : undefined , ChangeSeverity : undefined , UserDefined : undefined , ValueType : undefined , ValueOptions : undefined , MinValue : undefined , MaxValue : undefined , MaxLength : undefined , Regex : undefined , } ; if ( output [ "Namespace" ] !== undefined ) { contents . Namespace = __expectString ( output [ "Namespace" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "DefaultValue" ] !== undefined ) { contents . DefaultValue = __expectString ( output [ "DefaultValue" ] ) ; } if ( output [ "ChangeSeverity" ] !== undefined ) { contents . ChangeSeverity = __expectString ( output [ "ChangeSeverity" ] ) ; } if ( output [ "UserDefined" ] !== undefined ) { contents . UserDefined = __parseBoolean ( output [ "UserDefined" ] ) ; } if ( output [ "ValueType" ] !== undefined ) { contents . ValueType = __expectString ( output [ "ValueType" ] ) ; } if ( output . ValueOptions === "" ) { contents . ValueOptions = [ ] ; } if ( output [ "ValueOptions" ] !== undefined && output [ "ValueOptions" ] [ "member" ] !== undefined ) { contents . ValueOptions = deserializeAws_queryConfigurationOptionPossibleValues ( __getArrayIfSingleItem ( output [ "ValueOptions" ] [ "member" ] ) , context ) ; } if ( output [ "MinValue" ] !== undefined ) { contents . MinValue = __strictParseInt32 ( output [ "MinValue" ] ) as number ; } if ( output [ "MaxValue" ] !== undefined ) { contents . MaxValue = __strictParseInt32 ( output [ "MaxValue" ] ) as number ; } if ( output [ "MaxLength" ] !== undefined ) { contents . MaxLength = __strictParseInt32 ( output [ "MaxLength" ] ) as number ; } if ( output [ "Regex" ] !== undefined ) { contents . Regex = deserializeAws_queryOptionRestrictionRegex ( output [ "Regex" ] , context ) ; } return contents ; } ; const deserializeAws_queryConfigurationOptionDescriptionsList = ( output , context ) : ConfigurationOptionDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryConfigurationOptionDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryConfigurationOptionPossibleValues = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_queryConfigurationOptionsDescription = ( output , context ) : ConfigurationOptionsDescription => { const contents = { SolutionStackName : undefined , PlatformArn : undefined , Options : undefined , } ; if ( output [ "SolutionStackName" ] !== undefined ) { contents . SolutionStackName = __expectString ( output [ "SolutionStackName" ] ) ; } if ( output [ "PlatformArn" ] !== undefined ) { contents . PlatformArn = __expectString ( output [ "PlatformArn" ] ) ; } if ( output . Options === "" ) { contents . Options = [ ] ; } if ( output [ "Options" ] !== undefined && output [ "Options" ] [ "member" ] !== undefined ) { contents . Options = deserializeAws_queryConfigurationOptionDescriptionsList ( __getArrayIfSingleItem ( output [ "Options" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryConfigurationOptionSetting = ( output , context ) : ConfigurationOptionSetting => { const contents = { ResourceName : undefined , Namespace : undefined , OptionName : undefined , Value : undefined , } ; if ( output [ "ResourceName" ] !== undefined ) { contents . ResourceName = __expectString ( output [ "ResourceName" ] ) ; } if ( output [ "Namespace" ] !== undefined ) { contents . Namespace = __expectString ( output [ "Namespace" ] ) ; } if ( output [ "OptionName" ] !== undefined ) { contents . OptionName = __expectString ( output [ "OptionName" ] ) ; } if ( output [ "Value" ] !== undefined ) { contents . Value = __expectString ( output [ "Value" ] ) ; } return contents ; } ; const deserializeAws_queryConfigurationOptionSettingsList = ( output , context ) : ConfigurationOptionSetting [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryConfigurationOptionSetting ( entry , context ) ; } ) ; } ; const deserializeAws_queryConfigurationSettingsDescription = ( output , context ) : ConfigurationSettingsDescription => { const contents = { SolutionStackName : undefined , PlatformArn : undefined , ApplicationName : undefined , TemplateName : undefined , Description : undefined , EnvironmentName : undefined , DeploymentStatus : undefined , DateCreated : undefined , DateUpdated : undefined , OptionSettings : undefined , } ; if ( output [ "SolutionStackName" ] !== undefined ) { contents . SolutionStackName = __expectString ( output [ "SolutionStackName" ] ) ; } if ( output [ "PlatformArn" ] !== undefined ) { contents . PlatformArn = __expectString ( output [ "PlatformArn" ] ) ; } if ( output [ "ApplicationName" ] !== undefined ) { contents . ApplicationName = __expectString ( output [ "ApplicationName" ] ) ; } if ( output [ "TemplateName" ] !== undefined ) { contents . TemplateName = __expectString ( output [ "TemplateName" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "EnvironmentName" ] !== undefined ) { contents . EnvironmentName = __expectString ( output [ "EnvironmentName" ] ) ; } if ( output [ "DeploymentStatus" ] !== undefined ) { contents . DeploymentStatus = __expectString ( output [ "DeploymentStatus" ] ) ; } if ( output [ "DateCreated" ] !== undefined ) { contents . DateCreated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateCreated" ] ) ) ; } if ( output [ "DateUpdated" ] !== undefined ) { contents . DateUpdated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateUpdated" ] ) ) ; } if ( output . OptionSettings === "" ) { contents . OptionSettings = [ ] ; } if ( output [ "OptionSettings" ] !== undefined && output [ "OptionSettings" ] [ "member" ] !== undefined ) { contents . OptionSettings = deserializeAws_queryConfigurationOptionSettingsList ( __getArrayIfSingleItem ( output [ "OptionSettings" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryConfigurationSettingsDescriptionList = ( output , context ) : ConfigurationSettingsDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryConfigurationSettingsDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryConfigurationSettingsDescriptions = ( output , context ) : ConfigurationSettingsDescriptions => { const contents = { ConfigurationSettings : undefined , } ; if ( output . ConfigurationSettings === "" ) { contents . ConfigurationSettings = [ ] ; } if ( output [ "ConfigurationSettings" ] !== undefined && output [ "ConfigurationSettings" ] [ "member" ] !== undefined ) { contents . ConfigurationSettings = deserializeAws_queryConfigurationSettingsDescriptionList ( __getArrayIfSingleItem ( output [ "ConfigurationSettings" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryConfigurationSettingsValidationMessages = ( output , context ) : ConfigurationSettingsValidationMessages => { const contents = { Messages : undefined , } ; if ( output . Messages === "" ) { contents . Messages = [ ] ; } if ( output [ "Messages" ] !== undefined && output [ "Messages" ] [ "member" ] !== undefined ) { contents . Messages = deserializeAws_queryValidationMessagesList ( __getArrayIfSingleItem ( output [ "Messages" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryConfigurationTemplateNamesList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_queryCPUUtilization = ( output , context ) : CPUUtilization => { const contents = { User : undefined , Nice : undefined , System : undefined , Idle : undefined , IOWait : undefined , IRQ : undefined , SoftIRQ : undefined , Privileged : undefined , } ; if ( output [ "User" ] !== undefined ) { contents . User = __strictParseFloat ( output [ "User" ] ) as number ; } if ( output [ "Nice" ] !== undefined ) { contents . Nice = __strictParseFloat ( output [ "Nice" ] ) as number ; } if ( output [ "System" ] !== undefined ) { contents . System = __strictParseFloat ( output [ "System" ] ) as number ; } if ( output [ "Idle" ] !== undefined ) { contents . Idle = __strictParseFloat ( output [ "Idle" ] ) as number ; } if ( output [ "IOWait" ] !== undefined ) { contents . IOWait = __strictParseFloat ( output [ "IOWait" ] ) as number ; } if ( output [ "IRQ" ] !== undefined ) { contents . IRQ = __strictParseFloat ( output [ "IRQ" ] ) as number ; } if ( output [ "SoftIRQ" ] !== undefined ) { contents . SoftIRQ = __strictParseFloat ( output [ "SoftIRQ" ] ) as number ; } if ( output [ "Privileged" ] !== undefined ) { contents . Privileged = __strictParseFloat ( output [ "Privileged" ] ) as number ; } return contents ; } ; const deserializeAws_queryCreatePlatformVersionResult = ( output , context ) : CreatePlatformVersionResult => { const contents = { PlatformSummary : undefined , Builder : undefined , } ; if ( output [ "PlatformSummary" ] !== undefined ) { contents . PlatformSummary = deserializeAws_queryPlatformSummary ( output [ "PlatformSummary" ] , context ) ; } if ( output [ "Builder" ] !== undefined ) { contents . Builder = deserializeAws_queryBuilder ( output [ "Builder" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateStorageLocationResultMessage = ( output , context ) : CreateStorageLocationResultMessage => { const contents = { S3Bucket : undefined , } ; if ( output [ "S3Bucket" ] !== undefined ) { contents . S3Bucket = __expectString ( output [ "S3Bucket" ] ) ; } return contents ; } ; const deserializeAws_queryCustomAmi = ( output , context ) : CustomAmi => { const contents = { VirtualizationType : undefined , ImageId : undefined , } ; if ( output [ "VirtualizationType" ] !== undefined ) { contents . VirtualizationType = __expectString ( output [ "VirtualizationType" ] ) ; } if ( output [ "ImageId" ] !== undefined ) { contents . ImageId = __expectString ( output [ "ImageId" ] ) ; } return contents ; } ; const deserializeAws_queryCustomAmiList = ( output , context ) : CustomAmi [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryCustomAmi ( entry , context ) ; } ) ; } ; const deserializeAws_queryDeletePlatformVersionResult = ( output , context ) : DeletePlatformVersionResult => { const contents = { PlatformSummary : undefined , } ; if ( output [ "PlatformSummary" ] !== undefined ) { contents . PlatformSummary = deserializeAws_queryPlatformSummary ( output [ "PlatformSummary" ] , context ) ; } return contents ; } ; const deserializeAws_queryDeployment = ( output , context ) : Deployment => { const contents = { VersionLabel : undefined , DeploymentId : undefined , Status : undefined , DeploymentTime : undefined , } ; if ( output [ "VersionLabel" ] !== undefined ) { contents . VersionLabel = __expectString ( output [ "VersionLabel" ] ) ; } if ( output [ "DeploymentId" ] !== undefined ) { contents . DeploymentId = __strictParseLong ( output [ "DeploymentId" ] ) as number ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "DeploymentTime" ] !== undefined ) { contents . DeploymentTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "DeploymentTime" ] ) ) ; } return contents ; } ; const deserializeAws_queryDescribeAccountAttributesResult = ( output , context ) : DescribeAccountAttributesResult => { const contents = { ResourceQuotas : undefined , } ; if ( output [ "ResourceQuotas" ] !== undefined ) { contents . ResourceQuotas = deserializeAws_queryResourceQuotas ( output [ "ResourceQuotas" ] , context ) ; } return contents ; } ; const deserializeAws_queryDescribeEnvironmentHealthResult = ( output , context ) : DescribeEnvironmentHealthResult => { const contents = { EnvironmentName : undefined , HealthStatus : undefined , Status : undefined , Color : undefined , Causes : undefined , ApplicationMetrics : undefined , InstancesHealth : undefined , RefreshedAt : undefined , } ; if ( output [ "EnvironmentName" ] !== undefined ) { contents . EnvironmentName = __expectString ( output [ "EnvironmentName" ] ) ; } if ( output [ "HealthStatus" ] !== undefined ) { contents . HealthStatus = __expectString ( output [ "HealthStatus" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "Color" ] !== undefined ) { contents . Color = __expectString ( output [ "Color" ] ) ; } if ( output . Causes === "" ) { contents . Causes = [ ] ; } if ( output [ "Causes" ] !== undefined && output [ "Causes" ] [ "member" ] !== undefined ) { contents . Causes = deserializeAws_queryCauses ( __getArrayIfSingleItem ( output [ "Causes" ] [ "member" ] ) , context ) ; } if ( output [ "ApplicationMetrics" ] !== undefined ) { contents . ApplicationMetrics = deserializeAws_queryApplicationMetrics ( output [ "ApplicationMetrics" ] , context ) ; } if ( output [ "InstancesHealth" ] !== undefined ) { contents . InstancesHealth = deserializeAws_queryInstanceHealthSummary ( output [ "InstancesHealth" ] , context ) ; } if ( output [ "RefreshedAt" ] !== undefined ) { contents . RefreshedAt = __expectNonNull ( __parseRfc3339DateTime ( output [ "RefreshedAt" ] ) ) ; } return contents ; } ; const deserializeAws_queryDescribeEnvironmentManagedActionHistoryResult = ( output , context ) : DescribeEnvironmentManagedActionHistoryResult => { const contents = { ManagedActionHistoryItems : undefined , NextToken : undefined , } ; if ( output . ManagedActionHistoryItems === "" ) { contents . ManagedActionHistoryItems = [ ] ; } if ( output [ "ManagedActionHistoryItems" ] !== undefined && output [ "ManagedActionHistoryItems" ] [ "member" ] !== undefined ) { contents . ManagedActionHistoryItems = deserializeAws_queryManagedActionHistoryItems ( __getArrayIfSingleItem ( output [ "ManagedActionHistoryItems" ] [ "member" ] ) , context ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryDescribeEnvironmentManagedActionsResult = ( output , context ) : DescribeEnvironmentManagedActionsResult => { const contents = { ManagedActions : undefined , } ; if ( output . ManagedActions === "" ) { contents . ManagedActions = [ ] ; } if ( output [ "ManagedActions" ] !== undefined && output [ "ManagedActions" ] [ "member" ] !== undefined ) { contents . ManagedActions = deserializeAws_queryManagedActions ( __getArrayIfSingleItem ( output [ "ManagedActions" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryDescribeInstancesHealthResult = ( output , context ) : DescribeInstancesHealthResult => { const contents = { InstanceHealthList : undefined , RefreshedAt : undefined , NextToken : undefined , } ; if ( output . InstanceHealthList === "" ) { contents . InstanceHealthList = [ ] ; } if ( output [ "InstanceHealthList" ] !== undefined && output [ "InstanceHealthList" ] [ "member" ] !== undefined ) { contents . InstanceHealthList = deserializeAws_queryInstanceHealthList ( __getArrayIfSingleItem ( output [ "InstanceHealthList" ] [ "member" ] ) , context ) ; } if ( output [ "RefreshedAt" ] !== undefined ) { contents . RefreshedAt = __expectNonNull ( __parseRfc3339DateTime ( output [ "RefreshedAt" ] ) ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryDescribePlatformVersionResult = ( output , context ) : DescribePlatformVersionResult => { const contents = { PlatformDescription : undefined , } ; if ( output [ "PlatformDescription" ] !== undefined ) { contents . PlatformDescription = deserializeAws_queryPlatformDescription ( output [ "PlatformDescription" ] , context ) ; } return contents ; } ; const deserializeAws_queryElasticBeanstalkServiceException = ( output , context ) : ElasticBeanstalkServiceException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryEnvironmentDescription = ( output , context ) : EnvironmentDescription => { const contents = { EnvironmentName : undefined , EnvironmentId : undefined , ApplicationName : undefined , VersionLabel : undefined , SolutionStackName : undefined , PlatformArn : undefined , TemplateName : undefined , Description : undefined , EndpointURL : undefined , CNAME : undefined , DateCreated : undefined , DateUpdated : undefined , Status : undefined , AbortableOperationInProgress : undefined , Health : undefined , HealthStatus : undefined , Resources : undefined , Tier : undefined , EnvironmentLinks : undefined , EnvironmentArn : undefined , OperationsRole : undefined , } ; if ( output [ "EnvironmentName" ] !== undefined ) { contents . EnvironmentName = __expectString ( output [ "EnvironmentName" ] ) ; } if ( output [ "EnvironmentId" ] !== undefined ) { contents . EnvironmentId = __expectString ( output [ "EnvironmentId" ] ) ; } if ( output [ "ApplicationName" ] !== undefined ) { contents . ApplicationName = __expectString ( output [ "ApplicationName" ] ) ; } if ( output [ "VersionLabel" ] !== undefined ) { contents . VersionLabel = __expectString ( output [ "VersionLabel" ] ) ; } if ( output [ "SolutionStackName" ] !== undefined ) { contents . SolutionStackName = __expectString ( output [ "SolutionStackName" ] ) ; } if ( output [ "PlatformArn" ] !== undefined ) { contents . PlatformArn = __expectString ( output [ "PlatformArn" ] ) ; } if ( output [ "TemplateName" ] !== undefined ) { contents . TemplateName = __expectString ( output [ "TemplateName" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "EndpointURL" ] !== undefined ) { contents . EndpointURL = __expectString ( output [ "EndpointURL" ] ) ; } if ( output [ "CNAME" ] !== undefined ) { contents . CNAME = __expectString ( output [ "CNAME" ] ) ; } if ( output [ "DateCreated" ] !== undefined ) { contents . DateCreated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateCreated" ] ) ) ; } if ( output [ "DateUpdated" ] !== undefined ) { contents . DateUpdated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateUpdated" ] ) ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "AbortableOperationInProgress" ] !== undefined ) { contents . AbortableOperationInProgress = __parseBoolean ( output [ "AbortableOperationInProgress" ] ) ; } if ( output [ "Health" ] !== undefined ) { contents . Health = __expectString ( output [ "Health" ] ) ; } if ( output [ "HealthStatus" ] !== undefined ) { contents . HealthStatus = __expectString ( output [ "HealthStatus" ] ) ; } if ( output [ "Resources" ] !== undefined ) { contents . Resources = deserializeAws_queryEnvironmentResourcesDescription ( output [ "Resources" ] , context ) ; } if ( output [ "Tier" ] !== undefined ) { contents . Tier = deserializeAws_queryEnvironmentTier ( output [ "Tier" ] , context ) ; } if ( output . EnvironmentLinks === "" ) { contents . EnvironmentLinks = [ ] ; } if ( output [ "EnvironmentLinks" ] !== undefined && output [ "EnvironmentLinks" ] [ "member" ] !== undefined ) { contents . EnvironmentLinks = deserializeAws_queryEnvironmentLinks ( __getArrayIfSingleItem ( output [ "EnvironmentLinks" ] [ "member" ] ) , context ) ; } if ( output [ "EnvironmentArn" ] !== undefined ) { contents . EnvironmentArn = __expectString ( output [ "EnvironmentArn" ] ) ; } if ( output [ "OperationsRole" ] !== undefined ) { contents . OperationsRole = __expectString ( output [ "OperationsRole" ] ) ; } return contents ; } ; const deserializeAws_queryEnvironmentDescriptionsList = ( output , context ) : EnvironmentDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryEnvironmentDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryEnvironmentDescriptionsMessage = ( output , context ) : EnvironmentDescriptionsMessage => { const contents = { Environments : undefined , NextToken : undefined , } ; if ( output . Environments === "" ) { contents . Environments = [ ] ; } if ( output [ "Environments" ] !== undefined && output [ "Environments" ] [ "member" ] !== undefined ) { contents . Environments = deserializeAws_queryEnvironmentDescriptionsList ( __getArrayIfSingleItem ( output [ "Environments" ] [ "member" ] ) , context ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryEnvironmentInfoDescription = ( output , context ) : EnvironmentInfoDescription => { const contents = { InfoType : undefined , Ec2InstanceId : undefined , SampleTimestamp : undefined , Message : undefined , } ; if ( output [ "InfoType" ] !== undefined ) { contents . InfoType = __expectString ( output [ "InfoType" ] ) ; } if ( output [ "Ec2InstanceId" ] !== undefined ) { contents . Ec2InstanceId = __expectString ( output [ "Ec2InstanceId" ] ) ; } if ( output [ "SampleTimestamp" ] !== undefined ) { contents . SampleTimestamp = __expectNonNull ( __parseRfc3339DateTime ( output [ "SampleTimestamp" ] ) ) ; } if ( output [ "Message" ] !== undefined ) { contents . Message = __expectString ( output [ "Message" ] ) ; } return contents ; } ; const deserializeAws_queryEnvironmentInfoDescriptionList = ( output , context ) : EnvironmentInfoDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryEnvironmentInfoDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryEnvironmentLink = ( output , context ) : EnvironmentLink => { const contents = { LinkName : undefined , EnvironmentName : undefined , } ; if ( output [ "LinkName" ] !== undefined ) { contents . LinkName = __expectString ( output [ "LinkName" ] ) ; } if ( output [ "EnvironmentName" ] !== undefined ) { contents . EnvironmentName = __expectString ( output [ "EnvironmentName" ] ) ; } return contents ; } ; const deserializeAws_queryEnvironmentLinks = ( output , context ) : EnvironmentLink [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryEnvironmentLink ( entry , context ) ; } ) ; } ; const deserializeAws_queryEnvironmentResourceDescription = ( output , context ) : EnvironmentResourceDescription => { const contents = { EnvironmentName : undefined , AutoScalingGroups : undefined , Instances : undefined , LaunchConfigurations : undefined , LaunchTemplates : undefined , LoadBalancers : undefined , Triggers : undefined , Queues : undefined , } ; if ( output [ "EnvironmentName" ] !== undefined ) { contents . EnvironmentName = __expectString ( output [ "EnvironmentName" ] ) ; } if ( output . AutoScalingGroups === "" ) { contents . AutoScalingGroups = [ ] ; } if ( output [ "AutoScalingGroups" ] !== undefined && output [ "AutoScalingGroups" ] [ "member" ] !== undefined ) { contents . AutoScalingGroups = deserializeAws_queryAutoScalingGroupList ( __getArrayIfSingleItem ( output [ "AutoScalingGroups" ] [ "member" ] ) , context ) ; } if ( output . Instances === "" ) { contents . Instances = [ ] ; } if ( output [ "Instances" ] !== undefined && output [ "Instances" ] [ "member" ] !== undefined ) { contents . Instances = deserializeAws_queryInstanceList ( __getArrayIfSingleItem ( output [ "Instances" ] [ "member" ] ) , context ) ; } if ( output . LaunchConfigurations === "" ) { contents . LaunchConfigurations = [ ] ; } if ( output [ "LaunchConfigurations" ] !== undefined && output [ "LaunchConfigurations" ] [ "member" ] !== undefined ) { contents . LaunchConfigurations = deserializeAws_queryLaunchConfigurationList ( __getArrayIfSingleItem ( output [ "LaunchConfigurations" ] [ "member" ] ) , context ) ; } if ( output . LaunchTemplates === "" ) { contents . LaunchTemplates = [ ] ; } if ( output [ "LaunchTemplates" ] !== undefined && output [ "LaunchTemplates" ] [ "member" ] !== undefined ) { contents . LaunchTemplates = deserializeAws_queryLaunchTemplateList ( __getArrayIfSingleItem ( output [ "LaunchTemplates" ] [ "member" ] ) , context ) ; } if ( output . LoadBalancers === "" ) { contents . LoadBalancers = [ ] ; } if ( output [ "LoadBalancers" ] !== undefined && output [ "LoadBalancers" ] [ "member" ] !== undefined ) { contents . LoadBalancers = deserializeAws_queryLoadBalancerList ( __getArrayIfSingleItem ( output [ "LoadBalancers" ] [ "member" ] ) , context ) ; } if ( output . Triggers === "" ) { contents . Triggers = [ ] ; } if ( output [ "Triggers" ] !== undefined && output [ "Triggers" ] [ "member" ] !== undefined ) { contents . Triggers = deserializeAws_queryTriggerList ( __getArrayIfSingleItem ( output [ "Triggers" ] [ "member" ] ) , context ) ; } if ( output . Queues === "" ) { contents . Queues = [ ] ; } if ( output [ "Queues" ] !== undefined && output [ "Queues" ] [ "member" ] !== undefined ) { contents . Queues = deserializeAws_queryQueueList ( __getArrayIfSingleItem ( output [ "Queues" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryEnvironmentResourceDescriptionsMessage = ( output , context ) : EnvironmentResourceDescriptionsMessage => { const contents = { EnvironmentResources : undefined , } ; if ( output [ "EnvironmentResources" ] !== undefined ) { contents . EnvironmentResources = deserializeAws_queryEnvironmentResourceDescription ( output [ "EnvironmentResources" ] , context ) ; } return contents ; } ; const deserializeAws_queryEnvironmentResourcesDescription = ( output , context ) : EnvironmentResourcesDescription => { const contents = { LoadBalancer : undefined , } ; if ( output [ "LoadBalancer" ] !== undefined ) { contents . LoadBalancer = deserializeAws_queryLoadBalancerDescription ( output [ "LoadBalancer" ] , context ) ; } return contents ; } ; const deserializeAws_queryEnvironmentTier = ( output , context ) : EnvironmentTier => { const contents = { Name : undefined , Type : undefined , Version : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "Type" ] !== undefined ) { contents . Type = __expectString ( output [ "Type" ] ) ; } if ( output [ "Version" ] !== undefined ) { contents . Version = __expectString ( output [ "Version" ] ) ; } return contents ; } ; const deserializeAws_queryEventDescription = ( output , context ) : EventDescription => { const contents = { EventDate : undefined , Message : undefined , ApplicationName : undefined , VersionLabel : undefined , TemplateName : undefined , EnvironmentName : undefined , PlatformArn : undefined , RequestId : undefined , Severity : undefined , } ; if ( output [ "EventDate" ] !== undefined ) { contents . EventDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "EventDate" ] ) ) ; } if ( output [ "Message" ] !== undefined ) { contents . Message = __expectString ( output [ "Message" ] ) ; } if ( output [ "ApplicationName" ] !== undefined ) { contents . ApplicationName = __expectString ( output [ "ApplicationName" ] ) ; } if ( output [ "VersionLabel" ] !== undefined ) { contents . VersionLabel = __expectString ( output [ "VersionLabel" ] ) ; } if ( output [ "TemplateName" ] !== undefined ) { contents . TemplateName = __expectString ( output [ "TemplateName" ] ) ; } if ( output [ "EnvironmentName" ] !== undefined ) { contents . EnvironmentName = __expectString ( output [ "EnvironmentName" ] ) ; } if ( output [ "PlatformArn" ] !== undefined ) { contents . PlatformArn = __expectString ( output [ "PlatformArn" ] ) ; } if ( output [ "RequestId" ] !== undefined ) { contents . RequestId = __expectString ( output [ "RequestId" ] ) ; } if ( output [ "Severity" ] !== undefined ) { contents . Severity = __expectString ( output [ "Severity" ] ) ; } return contents ; } ; const deserializeAws_queryEventDescriptionList = ( output , context ) : EventDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryEventDescription ( entry , context ) ; } ) ; } ; const deserializeAws_queryEventDescriptionsMessage = ( output , context ) : EventDescriptionsMessage => { const contents = { Events : undefined , NextToken : undefined , } ; if ( output . Events === "" ) { contents . Events = [ ] ; } if ( output [ "Events" ] !== undefined && output [ "Events" ] [ "member" ] !== undefined ) { contents . Events = deserializeAws_queryEventDescriptionList ( __getArrayIfSingleItem ( output [ "Events" ] [ "member" ] ) , context ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryInstance = ( output , context ) : Instance => { const contents = { Id : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } return contents ; } ; const deserializeAws_queryInstanceHealthList = ( output , context ) : SingleInstanceHealth [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_querySingleInstanceHealth ( entry , context ) ; } ) ; } ; const deserializeAws_queryInstanceHealthSummary = ( output , context ) : InstanceHealthSummary => { const contents = { NoData : undefined , Unknown : undefined , Pending : undefined , Ok : undefined , Info : undefined , Warning : undefined , Degraded : undefined , Severe : undefined , } ; if ( output [ "NoData" ] !== undefined ) { contents . NoData = __strictParseInt32 ( output [ "NoData" ] ) as number ; } if ( output [ "Unknown" ] !== undefined ) { contents . Unknown = __strictParseInt32 ( output [ "Unknown" ] ) as number ; } if ( output [ "Pending" ] !== undefined ) { contents . Pending = __strictParseInt32 ( output [ "Pending" ] ) as number ; } if ( output [ "Ok" ] !== undefined ) { contents . Ok = __strictParseInt32 ( output [ "Ok" ] ) as number ; } if ( output [ "Info" ] !== undefined ) { contents . Info = __strictParseInt32 ( output [ "Info" ] ) as number ; } if ( output [ "Warning" ] !== undefined ) { contents . Warning = __strictParseInt32 ( output [ "Warning" ] ) as number ; } if ( output [ "Degraded" ] !== undefined ) { contents . Degraded = __strictParseInt32 ( output [ "Degraded" ] ) as number ; } if ( output [ "Severe" ] !== undefined ) { contents . Severe = __strictParseInt32 ( output [ "Severe" ] ) as number ; } return contents ; } ; const deserializeAws_queryInstanceList = ( output , context ) : Instance [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryInstance ( entry , context ) ; } ) ; } ; const deserializeAws_queryInsufficientPrivilegesException = ( output , context ) : InsufficientPrivilegesException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryInvalidRequestException = ( output , context ) : InvalidRequestException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryLatency = ( output , context ) : Latency => { const contents = { P999 : undefined , P99 : undefined , P95 : undefined , P90 : undefined , P85 : undefined , P75 : undefined , P50 : undefined , P10 : undefined , } ; if ( output [ "P999" ] !== undefined ) { contents . P999 = __strictParseFloat ( output [ "P999" ] ) as number ; } if ( output [ "P99" ] !== undefined ) { contents . P99 = __strictParseFloat ( output [ "P99" ] ) as number ; } if ( output [ "P95" ] !== undefined ) { contents . P95 = __strictParseFloat ( output [ "P95" ] ) as number ; } if ( output [ "P90" ] !== undefined ) { contents . P90 = __strictParseFloat ( output [ "P90" ] ) as number ; } if ( output [ "P85" ] !== undefined ) { contents . P85 = __strictParseFloat ( output [ "P85" ] ) as number ; } if ( output [ "P75" ] !== undefined ) { contents . P75 = __strictParseFloat ( output [ "P75" ] ) as number ; } if ( output [ "P50" ] !== undefined ) { contents . P50 = __strictParseFloat ( output [ "P50" ] ) as number ; } if ( output [ "P10" ] !== undefined ) { contents . P10 = __strictParseFloat ( output [ "P10" ] ) as number ; } return contents ; } ; const deserializeAws_queryLaunchConfiguration = ( output , context ) : LaunchConfiguration => { const contents = { Name : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } return contents ; } ; const deserializeAws_queryLaunchConfigurationList = ( output , context ) : LaunchConfiguration [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryLaunchConfiguration ( entry , context ) ; } ) ; } ; const deserializeAws_queryLaunchTemplate = ( output , context ) : LaunchTemplate => { const contents = { Id : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } return contents ; } ; const deserializeAws_queryLaunchTemplateList = ( output , context ) : LaunchTemplate [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryLaunchTemplate ( entry , context ) ; } ) ; } ; const deserializeAws_queryListAvailableSolutionStacksResultMessage = ( output , context ) : ListAvailableSolutionStacksResultMessage => { const contents = { SolutionStacks : undefined , SolutionStackDetails : undefined , } ; if ( output . SolutionStacks === "" ) { contents . SolutionStacks = [ ] ; } if ( output [ "SolutionStacks" ] !== undefined && output [ "SolutionStacks" ] [ "member" ] !== undefined ) { contents . SolutionStacks = deserializeAws_queryAvailableSolutionStackNamesList ( __getArrayIfSingleItem ( output [ "SolutionStacks" ] [ "member" ] ) , context ) ; } if ( output . SolutionStackDetails === "" ) { contents . SolutionStackDetails = [ ] ; } if ( output [ "SolutionStackDetails" ] !== undefined && output [ "SolutionStackDetails" ] [ "member" ] !== undefined ) { contents . SolutionStackDetails = deserializeAws_queryAvailableSolutionStackDetailsList ( __getArrayIfSingleItem ( output [ "SolutionStackDetails" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryListener = ( output , context ) : Listener => { const contents = { Protocol : undefined , Port : undefined , } ; if ( output [ "Protocol" ] !== undefined ) { contents . Protocol = __expectString ( output [ "Protocol" ] ) ; } if ( output [ "Port" ] !== undefined ) { contents . Port = __strictParseInt32 ( output [ "Port" ] ) as number ; } return contents ; } ; const deserializeAws_queryListPlatformBranchesResult = ( output , context ) : ListPlatformBranchesResult => { const contents = { PlatformBranchSummaryList : undefined , NextToken : undefined , } ; if ( output . PlatformBranchSummaryList === "" ) { contents . PlatformBranchSummaryList = [ ] ; } if ( output [ "PlatformBranchSummaryList" ] !== undefined && output [ "PlatformBranchSummaryList" ] [ "member" ] !== undefined ) { contents . PlatformBranchSummaryList = deserializeAws_queryPlatformBranchSummaryList ( __getArrayIfSingleItem ( output [ "PlatformBranchSummaryList" ] [ "member" ] ) , context ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryListPlatformVersionsResult = ( output , context ) : ListPlatformVersionsResult => { const contents = { PlatformSummaryList : undefined , NextToken : undefined , } ; if ( output . PlatformSummaryList === "" ) { contents . PlatformSummaryList = [ ] ; } if ( output [ "PlatformSummaryList" ] !== undefined && output [ "PlatformSummaryList" ] [ "member" ] !== undefined ) { contents . PlatformSummaryList = deserializeAws_queryPlatformSummaryList ( __getArrayIfSingleItem ( output [ "PlatformSummaryList" ] [ "member" ] ) , context ) ; } if ( output [ "NextToken" ] !== undefined ) { contents . NextToken = __expectString ( output [ "NextToken" ] ) ; } return contents ; } ; const deserializeAws_queryLoadAverage = ( output , context ) : number [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __strictParseFloat ( entry ) as number ; } ) ; } ; const deserializeAws_queryLoadBalancer = ( output , context ) : LoadBalancer => { const contents = { Name : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } return contents ; } ; const deserializeAws_queryLoadBalancerDescription = ( output , context ) : LoadBalancerDescription => { const contents = { LoadBalancerName : undefined , Domain : undefined , Listeners : undefined , } ; if ( output [ "LoadBalancerName" ] !== undefined ) { contents . LoadBalancerName = __expectString ( output [ "LoadBalancerName" ] ) ; } if ( output [ "Domain" ] !== undefined ) { contents . Domain = __expectString ( output [ "Domain" ] ) ; } if ( output . Listeners === "" ) { contents . Listeners = [ ] ; } if ( output [ "Listeners" ] !== undefined && output [ "Listeners" ] [ "member" ] !== undefined ) { contents . Listeners = deserializeAws_queryLoadBalancerListenersDescription ( __getArrayIfSingleItem ( output [ "Listeners" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryLoadBalancerList = ( output , context ) : LoadBalancer [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryLoadBalancer ( entry , context ) ; } ) ; } ; const deserializeAws_queryLoadBalancerListenersDescription = ( output , context ) : Listener [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryListener ( entry , context ) ; } ) ; } ; const deserializeAws_queryManagedAction = ( output , context ) : ManagedAction => { const contents = { ActionId : undefined , ActionDescription : undefined , ActionType : undefined , Status : undefined , WindowStartTime : undefined , } ; if ( output [ "ActionId" ] !== undefined ) { contents . ActionId = __expectString ( output [ "ActionId" ] ) ; } if ( output [ "ActionDescription" ] !== undefined ) { contents . ActionDescription = __expectString ( output [ "ActionDescription" ] ) ; } if ( output [ "ActionType" ] !== undefined ) { contents . ActionType = __expectString ( output [ "ActionType" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "WindowStartTime" ] !== undefined ) { contents . WindowStartTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "WindowStartTime" ] ) ) ; } return contents ; } ; const deserializeAws_queryManagedActionHistoryItem = ( output , context ) : ManagedActionHistoryItem => { const contents = { ActionId : undefined , ActionType : undefined , ActionDescription : undefined , FailureType : undefined , Status : undefined , FailureDescription : undefined , ExecutedTime : undefined , FinishedTime : undefined , } ; if ( output [ "ActionId" ] !== undefined ) { contents . ActionId = __expectString ( output [ "ActionId" ] ) ; } if ( output [ "ActionType" ] !== undefined ) { contents . ActionType = __expectString ( output [ "ActionType" ] ) ; } if ( output [ "ActionDescription" ] !== undefined ) { contents . ActionDescription = __expectString ( output [ "ActionDescription" ] ) ; } if ( output [ "FailureType" ] !== undefined ) { contents . FailureType = __expectString ( output [ "FailureType" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "FailureDescription" ] !== undefined ) { contents . FailureDescription = __expectString ( output [ "FailureDescription" ] ) ; } if ( output [ "ExecutedTime" ] !== undefined ) { contents . ExecutedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "ExecutedTime" ] ) ) ; } if ( output [ "FinishedTime" ] !== undefined ) { contents . FinishedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "FinishedTime" ] ) ) ; } return contents ; } ; const deserializeAws_queryManagedActionHistoryItems = ( output , context ) : ManagedActionHistoryItem [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryManagedActionHistoryItem ( entry , context ) ; } ) ; } ; const deserializeAws_queryManagedActionInvalidStateException = ( output , context ) : ManagedActionInvalidStateException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryManagedActions = ( output , context ) : ManagedAction [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryManagedAction ( entry , context ) ; } ) ; } ; const deserializeAws_queryMaxAgeRule = ( output , context ) : MaxAgeRule => { const contents = { Enabled : undefined , MaxAgeInDays : undefined , DeleteSourceFromS3 : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "MaxAgeInDays" ] !== undefined ) { contents . MaxAgeInDays = __strictParseInt32 ( output [ "MaxAgeInDays" ] ) as number ; } if ( output [ "DeleteSourceFromS3" ] !== undefined ) { contents . DeleteSourceFromS3 = __parseBoolean ( output [ "DeleteSourceFromS3" ] ) ; } return contents ; } ; const deserializeAws_queryMaxCountRule = ( output , context ) : MaxCountRule => { const contents = { Enabled : undefined , MaxCount : undefined , DeleteSourceFromS3 : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "MaxCount" ] !== undefined ) { contents . MaxCount = __strictParseInt32 ( output [ "MaxCount" ] ) as number ; } if ( output [ "DeleteSourceFromS3" ] !== undefined ) { contents . DeleteSourceFromS3 = __parseBoolean ( output [ "DeleteSourceFromS3" ] ) ; } return contents ; } ; const deserializeAws_queryOperationInProgressException = ( output , context ) : OperationInProgressException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryOptionRestrictionRegex = ( output , context ) : OptionRestrictionRegex => { const contents = { Pattern : undefined , Label : undefined , } ; if ( output [ "Pattern" ] !== undefined ) { contents . Pattern = __expectString ( output [ "Pattern" ] ) ; } if ( output [ "Label" ] !== undefined ) { contents . Label = __expectString ( output [ "Label" ] ) ; } return contents ; } ; const deserializeAws_queryPlatformBranchSummary = ( output , context ) : PlatformBranchSummary => { const contents = { PlatformName : undefined , BranchName : undefined , LifecycleState : undefined , BranchOrder : undefined , SupportedTierList : undefined , } ; if ( output [ "PlatformName" ] !== undefined ) { contents . PlatformName = __expectString ( output [ "PlatformName" ] ) ; } if ( output [ "BranchName" ] !== undefined ) { contents . BranchName = __expectString ( output [ "BranchName" ] ) ; } if ( output [ "LifecycleState" ] !== undefined ) { contents . LifecycleState = __expectString ( output [ "LifecycleState" ] ) ; } if ( output [ "BranchOrder" ] !== undefined ) { contents . BranchOrder = __strictParseInt32 ( output [ "BranchOrder" ] ) as number ; } if ( output . SupportedTierList === "" ) { contents . SupportedTierList = [ ] ; } if ( output [ "SupportedTierList" ] !== undefined && output [ "SupportedTierList" ] [ "member" ] !== undefined ) { contents . SupportedTierList = deserializeAws_querySupportedTierList ( __getArrayIfSingleItem ( output [ "SupportedTierList" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryPlatformBranchSummaryList = ( output , context ) : PlatformBranchSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPlatformBranchSummary ( entry , context ) ; } ) ; } ; const deserializeAws_queryPlatformDescription = ( output , context ) : PlatformDescription => { const contents = { PlatformArn : undefined , PlatformOwner : undefined , PlatformName : undefined , PlatformVersion : undefined , SolutionStackName : undefined , PlatformStatus : undefined , DateCreated : undefined , DateUpdated : undefined , PlatformCategory : undefined , Description : undefined , Maintainer : undefined , OperatingSystemName : undefined , OperatingSystemVersion : undefined , ProgrammingLanguages : undefined , Frameworks : undefined , CustomAmiList : undefined , SupportedTierList : undefined , SupportedAddonList : undefined , PlatformLifecycleState : undefined , PlatformBranchName : undefined , PlatformBranchLifecycleState : undefined , } ; if ( output [ "PlatformArn" ] !== undefined ) { contents . PlatformArn = __expectString ( output [ "PlatformArn" ] ) ; } if ( output [ "PlatformOwner" ] !== undefined ) { contents . PlatformOwner = __expectString ( output [ "PlatformOwner" ] ) ; } if ( output [ "PlatformName" ] !== undefined ) { contents . PlatformName = __expectString ( output [ "PlatformName" ] ) ; } if ( output [ "PlatformVersion" ] !== undefined ) { contents . PlatformVersion = __expectString ( output [ "PlatformVersion" ] ) ; } if ( output [ "SolutionStackName" ] !== undefined ) { contents . SolutionStackName = __expectString ( output [ "SolutionStackName" ] ) ; } if ( output [ "PlatformStatus" ] !== undefined ) { contents . PlatformStatus = __expectString ( output [ "PlatformStatus" ] ) ; } if ( output [ "DateCreated" ] !== undefined ) { contents . DateCreated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateCreated" ] ) ) ; } if ( output [ "DateUpdated" ] !== undefined ) { contents . DateUpdated = __expectNonNull ( __parseRfc3339DateTime ( output [ "DateUpdated" ] ) ) ; } if ( output [ "PlatformCategory" ] !== undefined ) { contents . PlatformCategory = __expectString ( output [ "PlatformCategory" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "Maintainer" ] !== undefined ) { contents . Maintainer = __expectString ( output [ "Maintainer" ] ) ; } if ( output [ "OperatingSystemName" ] !== undefined ) { contents . OperatingSystemName = __expectString ( output [ "OperatingSystemName" ] ) ; } if ( output [ "OperatingSystemVersion" ] !== undefined ) { contents . OperatingSystemVersion = __expectString ( output [ "OperatingSystemVersion" ] ) ; } if ( output . ProgrammingLanguages === "" ) { contents . ProgrammingLanguages = [ ] ; } if ( output [ "ProgrammingLanguages" ] !== undefined && output [ "ProgrammingLanguages" ] [ "member" ] !== undefined ) { contents . ProgrammingLanguages = deserializeAws_queryPlatformProgrammingLanguages ( __getArrayIfSingleItem ( output [ "ProgrammingLanguages" ] [ "member" ] ) , context ) ; } if ( output . Frameworks === "" ) { contents . Frameworks = [ ] ; } if ( output [ "Frameworks" ] !== undefined && output [ "Frameworks" ] [ "member" ] !== undefined ) { contents . Frameworks = deserializeAws_queryPlatformFrameworks ( __getArrayIfSingleItem ( output [ "Frameworks" ] [ "member" ] ) , context ) ; } if ( output . CustomAmiList === "" ) { contents . CustomAmiList = [ ] ; } if ( output [ "CustomAmiList" ] !== undefined && output [ "CustomAmiList" ] [ "member" ] !== undefined ) { contents . CustomAmiList = deserializeAws_queryCustomAmiList ( __getArrayIfSingleItem ( output [ "CustomAmiList" ] [ "member" ] ) , context ) ; } if ( output . SupportedTierList === "" ) { contents . SupportedTierList = [ ] ; } if ( output [ "SupportedTierList" ] !== undefined && output [ "SupportedTierList" ] [ "member" ] !== undefined ) { contents . SupportedTierList = deserializeAws_querySupportedTierList ( __getArrayIfSingleItem ( output [ "SupportedTierList" ] [ "member" ] ) , context ) ; } if ( output . SupportedAddonList === "" ) { contents . SupportedAddonList = [ ] ; } if ( output [ "SupportedAddonList" ] !== undefined && output [ "SupportedAddonList" ] [ "member" ] !== undefined ) { contents . SupportedAddonList = deserializeAws_querySupportedAddonList ( __getArrayIfSingleItem ( output [ "SupportedAddonList" ] [ "member" ] ) , context ) ; } if ( output [ "PlatformLifecycleState" ] !== undefined ) { contents . PlatformLifecycleState = __expectString ( output [ "PlatformLifecycleState" ] ) ; } if ( output [ "PlatformBranchName" ] !== undefined ) { contents . PlatformBranchName = __expectString ( output [ "PlatformBranchName" ] ) ; } if ( output [ "PlatformBranchLifecycleState" ] !== undefined ) { contents . PlatformBranchLifecycleState = __expectString ( output [ "PlatformBranchLifecycleState" ] ) ; } return contents ; } ; const deserializeAws_queryPlatformFramework = ( output , context ) : PlatformFramework => { const contents = { Name : undefined , Version : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "Version" ] !== undefined ) { contents . Version = __expectString ( output [ "Version" ] ) ; } return contents ; } ; const deserializeAws_queryPlatformFrameworks = ( output , context ) : PlatformFramework [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPlatformFramework ( entry , context ) ; } ) ; } ; const deserializeAws_queryPlatformProgrammingLanguage = ( output , context ) : PlatformProgrammingLanguage => { const contents = { Name : undefined , Version : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "Version" ] !== undefined ) { contents . Version = __expectString ( output [ "Version" ] ) ; } return contents ; } ; const deserializeAws_queryPlatformProgrammingLanguages = ( output , context ) : PlatformProgrammingLanguage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPlatformProgrammingLanguage ( entry , context ) ; } ) ; } ; const deserializeAws_queryPlatformSummary = ( output , context ) : PlatformSummary => { const contents = { PlatformArn : undefined , PlatformOwner : undefined , PlatformStatus : undefined , PlatformCategory : undefined , OperatingSystemName : undefined , OperatingSystemVersion : undefined , SupportedTierList : undefined , SupportedAddonList : undefined , PlatformLifecycleState : undefined , PlatformVersion : undefined , PlatformBranchName : undefined , PlatformBranchLifecycleState : undefined , } ; if ( output [ "PlatformArn" ] !== undefined ) { contents . PlatformArn = __expectString ( output [ "PlatformArn" ] ) ; } if ( output [ "PlatformOwner" ] !== undefined ) { contents . PlatformOwner = __expectString ( output [ "PlatformOwner" ] ) ; } if ( output [ "PlatformStatus" ] !== undefined ) { contents . PlatformStatus = __expectString ( output [ "PlatformStatus" ] ) ; } if ( output [ "PlatformCategory" ] !== undefined ) { contents . PlatformCategory = __expectString ( output [ "PlatformCategory" ] ) ; } if ( output [ "OperatingSystemName" ] !== undefined ) { contents . OperatingSystemName = __expectString ( output [ "OperatingSystemName" ] ) ; } if ( output [ "OperatingSystemVersion" ] !== undefined ) { contents . OperatingSystemVersion = __expectString ( output [ "OperatingSystemVersion" ] ) ; } if ( output . SupportedTierList === "" ) { contents . SupportedTierList = [ ] ; } if ( output [ "SupportedTierList" ] !== undefined && output [ "SupportedTierList" ] [ "member" ] !== undefined ) { contents . SupportedTierList = deserializeAws_querySupportedTierList ( __getArrayIfSingleItem ( output [ "SupportedTierList" ] [ "member" ] ) , context ) ; } if ( output . SupportedAddonList === "" ) { contents . SupportedAddonList = [ ] ; } if ( output [ "SupportedAddonList" ] !== undefined && output [ "SupportedAddonList" ] [ "member" ] !== undefined ) { contents . SupportedAddonList = deserializeAws_querySupportedAddonList ( __getArrayIfSingleItem ( output [ "SupportedAddonList" ] [ "member" ] ) , context ) ; } if ( output [ "PlatformLifecycleState" ] !== undefined ) { contents . PlatformLifecycleState = __expectString ( output [ "PlatformLifecycleState" ] ) ; } if ( output [ "PlatformVersion" ] !== undefined ) { contents . PlatformVersion = __expectString ( output [ "PlatformVersion" ] ) ; } if ( output [ "PlatformBranchName" ] !== undefined ) { contents . PlatformBranchName = __expectString ( output [ "PlatformBranchName" ] ) ; } if ( output [ "PlatformBranchLifecycleState" ] !== undefined ) { contents . PlatformBranchLifecycleState = __expectString ( output [ "PlatformBranchLifecycleState" ] ) ; } return contents ; } ; const deserializeAws_queryPlatformSummaryList = ( output , context ) : PlatformSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPlatformSummary ( entry , context ) ; } ) ; } ; const deserializeAws_queryPlatformVersionStillReferencedException = ( output , context ) : PlatformVersionStillReferencedException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryQueue = ( output , context ) : Queue => { const contents = { Name : undefined , URL : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "URL" ] !== undefined ) { contents . URL = __expectString ( output [ "URL" ] ) ; } return contents ; } ; const deserializeAws_queryQueueList = ( output , context ) : Queue [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryQueue ( entry , context ) ; } ) ; } ; const deserializeAws_queryResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryResourceQuota = ( output , context ) : ResourceQuota => { const contents = { Maximum : undefined , } ; if ( output [ "Maximum" ] !== undefined ) { contents . Maximum = __strictParseInt32 ( output [ "Maximum" ] ) as number ; } return contents ; } ; const deserializeAws_queryResourceQuotas = ( output , context ) : ResourceQuotas => { const contents = { ApplicationQuota : undefined , ApplicationVersionQuota : undefined , EnvironmentQuota : undefined , ConfigurationTemplateQuota : undefined , CustomPlatformQuota : undefined , } ; if ( output [ "ApplicationQuota" ] !== undefined ) { contents . ApplicationQuota = deserializeAws_queryResourceQuota ( output [ "ApplicationQuota" ] , context ) ; } if ( output [ "ApplicationVersionQuota" ] !== undefined ) { contents . ApplicationVersionQuota = deserializeAws_queryResourceQuota ( output [ "ApplicationVersionQuota" ] , context ) ; } if ( output [ "EnvironmentQuota" ] !== undefined ) { contents . EnvironmentQuota = deserializeAws_queryResourceQuota ( output [ "EnvironmentQuota" ] , context ) ; } if ( output [ "ConfigurationTemplateQuota" ] !== undefined ) { contents . ConfigurationTemplateQuota = deserializeAws_queryResourceQuota ( output [ "ConfigurationTemplateQuota" ] , context ) ; } if ( output [ "CustomPlatformQuota" ] !== undefined ) { contents . CustomPlatformQuota = deserializeAws_queryResourceQuota ( output [ "CustomPlatformQuota" ] , context ) ; } return contents ; } ; const deserializeAws_queryResourceTagsDescriptionMessage = ( output , context ) : ResourceTagsDescriptionMessage => { const contents = { ResourceArn : undefined , ResourceTags : undefined , } ; if ( output [ "ResourceArn" ] !== undefined ) { contents . ResourceArn = __expectString ( output [ "ResourceArn" ] ) ; } if ( output . ResourceTags === "" ) { contents . ResourceTags = [ ] ; } if ( output [ "ResourceTags" ] !== undefined && output [ "ResourceTags" ] [ "member" ] !== undefined ) { contents . ResourceTags = deserializeAws_queryTagList ( __getArrayIfSingleItem ( output [ "ResourceTags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryResourceTypeNotSupportedException = ( output , context ) : ResourceTypeNotSupportedException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryRetrieveEnvironmentInfoResultMessage = ( output , context ) : RetrieveEnvironmentInfoResultMessage => { const contents = { EnvironmentInfo : undefined , } ; if ( output . EnvironmentInfo === "" ) { contents . EnvironmentInfo = [ ] ; } if ( output [ "EnvironmentInfo" ] !== undefined && output [ "EnvironmentInfo" ] [ "member" ] !== undefined ) { contents . EnvironmentInfo = deserializeAws_queryEnvironmentInfoDescriptionList ( __getArrayIfSingleItem ( output [ "EnvironmentInfo" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryS3Location = ( output , context ) : S3Location => { const contents = { S3Bucket : undefined , S3Key : undefined , } ; if ( output [ "S3Bucket" ] !== undefined ) { contents . S3Bucket = __expectString ( output [ "S3Bucket" ] ) ; } if ( output [ "S3Key" ] !== undefined ) { contents . S3Key = __expectString ( output [ "S3Key" ] ) ; } return contents ; } ; const deserializeAws_queryS3LocationNotInServiceRegionException = ( output , context ) : S3LocationNotInServiceRegionException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryS3SubscriptionRequiredException = ( output , context ) : S3SubscriptionRequiredException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_querySingleInstanceHealth = ( output , context ) : SingleInstanceHealth => { const contents = { InstanceId : undefined , HealthStatus : undefined , Color : undefined , Causes : undefined , LaunchedAt : undefined , ApplicationMetrics : undefined , System : undefined , Deployment : undefined , AvailabilityZone : undefined , InstanceType : undefined , } ; if ( output [ "InstanceId" ] !== undefined ) { contents . InstanceId = __expectString ( output [ "InstanceId" ] ) ; } if ( output [ "HealthStatus" ] !== undefined ) { contents . HealthStatus = __expectString ( output [ "HealthStatus" ] ) ; } if ( output [ "Color" ] !== undefined ) { contents . Color = __expectString ( output [ "Color" ] ) ; } if ( output . Causes === "" ) { contents . Causes = [ ] ; } if ( output [ "Causes" ] !== undefined && output [ "Causes" ] [ "member" ] !== undefined ) { contents . Causes = deserializeAws_queryCauses ( __getArrayIfSingleItem ( output [ "Causes" ] [ "member" ] ) , context ) ; } if ( output [ "LaunchedAt" ] !== undefined ) { contents . LaunchedAt = __expectNonNull ( __parseRfc3339DateTime ( output [ "LaunchedAt" ] ) ) ; } if ( output [ "ApplicationMetrics" ] !== undefined ) { contents . ApplicationMetrics = deserializeAws_queryApplicationMetrics ( output [ "ApplicationMetrics" ] , context ) ; } if ( output [ "System" ] !== undefined ) { contents . System = deserializeAws_querySystemStatus ( output [ "System" ] , context ) ; } if ( output [ "Deployment" ] !== undefined ) { contents . Deployment = deserializeAws_queryDeployment ( output [ "Deployment" ] , context ) ; } if ( output [ "AvailabilityZone" ] !== undefined ) { contents . AvailabilityZone = __expectString ( output [ "AvailabilityZone" ] ) ; } if ( output [ "InstanceType" ] !== undefined ) { contents . InstanceType = __expectString ( output [ "InstanceType" ] ) ; } return contents ; } ; const deserializeAws_querySolutionStackDescription = ( output , context ) : SolutionStackDescription => { const contents = { SolutionStackName : undefined , PermittedFileTypes : undefined , } ; if ( output [ "SolutionStackName" ] !== undefined ) { contents . SolutionStackName = __expectString ( output [ "SolutionStackName" ] ) ; } if ( output . PermittedFileTypes === "" ) { contents . PermittedFileTypes = [ ] ; } if ( output [ "PermittedFileTypes" ] !== undefined && output [ "PermittedFileTypes" ] [ "member" ] !== undefined ) { contents . PermittedFileTypes = deserializeAws_querySolutionStackFileTypeList ( __getArrayIfSingleItem ( output [ "PermittedFileTypes" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_querySolutionStackFileTypeList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_querySourceBuildInformation = ( output , context ) : SourceBuildInformation => { const contents = { SourceType : undefined , SourceRepository : undefined , SourceLocation : undefined , } ; if ( output [ "SourceType" ] !== undefined ) { contents . SourceType = __expectString ( output [ "SourceType" ] ) ; } if ( output [ "SourceRepository" ] !== undefined ) { contents . SourceRepository = __expectString ( output [ "SourceRepository" ] ) ; } if ( output [ "SourceLocation" ] !== undefined ) { contents . SourceLocation = __expectString ( output [ "SourceLocation" ] ) ; } return contents ; } ; const deserializeAws_querySourceBundleDeletionException = ( output , context ) : SourceBundleDeletionException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryStatusCodes = ( output , context ) : StatusCodes => { const contents = { Status2xx : undefined , Status3xx : undefined , Status4xx : undefined , Status5xx : undefined , } ; if ( output [ "Status2xx" ] !== undefined ) { contents . Status2xx = __strictParseInt32 ( output [ "Status2xx" ] ) as number ; } if ( output [ "Status3xx" ] !== undefined ) { contents . Status3xx = __strictParseInt32 ( output [ "Status3xx" ] ) as number ; } if ( output [ "Status4xx" ] !== undefined ) { contents . Status4xx = __strictParseInt32 ( output [ "Status4xx" ] ) as number ; } if ( output [ "Status5xx" ] !== undefined ) { contents . Status5xx = __strictParseInt32 ( output [ "Status5xx" ] ) as number ; } return contents ; } ; const deserializeAws_querySupportedAddonList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_querySupportedTierList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_querySystemStatus = ( output , context ) : SystemStatus => { const contents = { CPUUtilization : undefined , LoadAverage : undefined , } ; if ( output [ "CPUUtilization" ] !== undefined ) { contents . CPUUtilization = deserializeAws_queryCPUUtilization ( output [ "CPUUtilization" ] , context ) ; } if ( output . LoadAverage === "" ) { contents . LoadAverage = [ ] ; } if ( output [ "LoadAverage" ] !== undefined && output [ "LoadAverage" ] [ "member" ] !== undefined ) { contents . LoadAverage = deserializeAws_queryLoadAverage ( __getArrayIfSingleItem ( output [ "LoadAverage" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryTag = ( output , context ) : Tag => { const contents = { Key : undefined , Value : undefined , } ; if ( output [ "Key" ] !== undefined ) { contents . Key = __expectString ( output [ "Key" ] ) ; } if ( output [ "Value" ] !== undefined ) { contents . Value = __expectString ( output [ "Value" ] ) ; } return contents ; } ; const deserializeAws_queryTagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryTag ( entry , context ) ; } ) ; } ; const deserializeAws_queryTooManyApplicationsException = ( output , context ) : TooManyApplicationsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTooManyApplicationVersionsException = ( output , context ) : TooManyApplicationVersionsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTooManyBucketsException = ( output , context ) : TooManyBucketsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTooManyConfigurationTemplatesException = ( output , context ) : TooManyConfigurationTemplatesException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTooManyEnvironmentsException = ( output , context ) : TooManyEnvironmentsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTooManyPlatformsException = ( output , context ) : TooManyPlatformsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTooManyTagsException = ( output , context ) : TooManyTagsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryTrigger = ( output , context ) : Trigger => { const contents = { Name : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } return contents ; } ; const deserializeAws_queryTriggerList = ( output , context ) : Trigger [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryTrigger ( entry , context ) ; } ) ; } ; const deserializeAws_queryValidationMessage = ( output , context ) : ValidationMessage => { const contents = { Message : undefined , Severity : undefined , Namespace : undefined , OptionName : undefined , } ; if ( output [ "Message" ] !== undefined ) { contents . Message = __expectString ( output [ "Message" ] ) ; } if ( output [ "Severity" ] !== undefined ) { contents . Severity = __expectString ( output [ "Severity" ] ) ; } if ( output [ "Namespace" ] !== undefined ) { contents . Namespace = __expectString ( output [ "Namespace" ] ) ; } if ( output [ "OptionName" ] !== undefined ) { contents . OptionName = __expectString ( output [ "OptionName" ] ) ; } return contents ; } ; const deserializeAws_queryValidationMessagesList = ( output , context ) : ValidationMessage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryValidationMessage ( entry , context ) ; } ) ; } ; const deserializeAws_queryVersionLabelsList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { const parsedObj = xmlParse ( encoded , { attributeNamePrefix : "" , ignoreAttributes : false , parseNodeValue : false , trimValues : false , tagValueProcessor : ( val ) => ( val . trim ( ) === "" && val . includes ( "\n" ) ? "" : decodeHTML ( val ) ) , } ) ; const textNodeName = "#text" ; const key = Object . keys ( parsedObj ) [ 0 ] ; const parsedObjToReturn = parsedObj [ key ] ; if ( parsedObjToReturn [ textNodeName ] ) { parsedObjToReturn [ key ] = parsedObjToReturn [ textNodeName ] ; delete parsedObjToReturn [ textNodeName ] ; } return __getValueFromTextNode ( parsedObjToReturn ) ; } return { } ; } ) ; const buildFormUrlencodedString = ( formEntries ) : string => Object . entries ( formEntries ) . map ( ( [ key , value ] ) => __extendedEncodeURIComponent ( key ) + "=" + __extendedEncodeURIComponent ( value ) ) . join ( "&" ) ; const loadQueryErrorCode = ( output , data ) : string => { if ( data . Error . Code !== undefined ) { return data . Error . Code ; } if ( output . statusCode == 404 ) { return "NotFound" ; } return "" ; } ;