import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectNonNull as __expectNonNull , expectObject as __expectObject , expectString as __expectString , extendedEncodeURIComponent as __extendedEncodeURIComponent , getArrayIfSingleItem as __getArrayIfSingleItem , getValueFromTextNode as __getValueFromTextNode , parseBoolean as __parseBoolean , parseRfc3339DateTime as __parseRfc3339DateTime , strictParseInt32 as __strictParseInt32 , strictParseLong as __strictParseLong , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { XmlNode as __XmlNode , XmlText as __XmlText } from "@aws-sdk/xml-builder" ; import { decodeHTML } from "entities" ; import { parse as xmlParse } from "fast-xml-parser" ; import { AssociateAliasCommandInput , AssociateAliasCommandOutput } from "../commands/AssociateAliasCommand" ; import { CreateCachePolicyCommandInput , CreateCachePolicyCommandOutput } from "../commands/CreateCachePolicyCommand" ; import { CreateCloudFrontOriginAccessIdentityCommandInput , CreateCloudFrontOriginAccessIdentityCommandOutput , } from "../commands/CreateCloudFrontOriginAccessIdentityCommand" ; import { CreateDistributionCommandInput , CreateDistributionCommandOutput } from "../commands/CreateDistributionCommand" ; import { CreateDistributionWithTagsCommandInput , CreateDistributionWithTagsCommandOutput , } from "../commands/CreateDistributionWithTagsCommand" ; import { CreateFieldLevelEncryptionConfigCommandInput , CreateFieldLevelEncryptionConfigCommandOutput , } from "../commands/CreateFieldLevelEncryptionConfigCommand" ; import { CreateFieldLevelEncryptionProfileCommandInput , CreateFieldLevelEncryptionProfileCommandOutput , } from "../commands/CreateFieldLevelEncryptionProfileCommand" ; import { CreateFunctionCommandInput , CreateFunctionCommandOutput } from "../commands/CreateFunctionCommand" ; import { CreateInvalidationCommandInput , CreateInvalidationCommandOutput } from "../commands/CreateInvalidationCommand" ; import { CreateKeyGroupCommandInput , CreateKeyGroupCommandOutput } from "../commands/CreateKeyGroupCommand" ; import { CreateMonitoringSubscriptionCommandInput , CreateMonitoringSubscriptionCommandOutput , } from "../commands/CreateMonitoringSubscriptionCommand" ; import { CreateOriginRequestPolicyCommandInput , CreateOriginRequestPolicyCommandOutput , } from "../commands/CreateOriginRequestPolicyCommand" ; import { CreatePublicKeyCommandInput , CreatePublicKeyCommandOutput } from "../commands/CreatePublicKeyCommand" ; import { CreateRealtimeLogConfigCommandInput , CreateRealtimeLogConfigCommandOutput , } from "../commands/CreateRealtimeLogConfigCommand" ; import { CreateResponseHeadersPolicyCommandInput , CreateResponseHeadersPolicyCommandOutput , } from "../commands/CreateResponseHeadersPolicyCommand" ; import { CreateStreamingDistributionCommandInput , CreateStreamingDistributionCommandOutput , } from "../commands/CreateStreamingDistributionCommand" ; import { CreateStreamingDistributionWithTagsCommandInput , CreateStreamingDistributionWithTagsCommandOutput , } from "../commands/CreateStreamingDistributionWithTagsCommand" ; import { DeleteCachePolicyCommandInput , DeleteCachePolicyCommandOutput } from "../commands/DeleteCachePolicyCommand" ; import { DeleteCloudFrontOriginAccessIdentityCommandInput , DeleteCloudFrontOriginAccessIdentityCommandOutput , } from "../commands/DeleteCloudFrontOriginAccessIdentityCommand" ; import { DeleteDistributionCommandInput , DeleteDistributionCommandOutput } from "../commands/DeleteDistributionCommand" ; import { DeleteFieldLevelEncryptionConfigCommandInput , DeleteFieldLevelEncryptionConfigCommandOutput , } from "../commands/DeleteFieldLevelEncryptionConfigCommand" ; import { DeleteFieldLevelEncryptionProfileCommandInput , DeleteFieldLevelEncryptionProfileCommandOutput , } from "../commands/DeleteFieldLevelEncryptionProfileCommand" ; import { DeleteFunctionCommandInput , DeleteFunctionCommandOutput } from "../commands/DeleteFunctionCommand" ; import { DeleteKeyGroupCommandInput , DeleteKeyGroupCommandOutput } from "../commands/DeleteKeyGroupCommand" ; import { DeleteMonitoringSubscriptionCommandInput , DeleteMonitoringSubscriptionCommandOutput , } from "../commands/DeleteMonitoringSubscriptionCommand" ; import { DeleteOriginRequestPolicyCommandInput , DeleteOriginRequestPolicyCommandOutput , } from "../commands/DeleteOriginRequestPolicyCommand" ; import { DeletePublicKeyCommandInput , DeletePublicKeyCommandOutput } from "../commands/DeletePublicKeyCommand" ; import { DeleteRealtimeLogConfigCommandInput , DeleteRealtimeLogConfigCommandOutput , } from "../commands/DeleteRealtimeLogConfigCommand" ; import { DeleteResponseHeadersPolicyCommandInput , DeleteResponseHeadersPolicyCommandOutput , } from "../commands/DeleteResponseHeadersPolicyCommand" ; import { DeleteStreamingDistributionCommandInput , DeleteStreamingDistributionCommandOutput , } from "../commands/DeleteStreamingDistributionCommand" ; import { DescribeFunctionCommandInput , DescribeFunctionCommandOutput } from "../commands/DescribeFunctionCommand" ; import { GetCachePolicyCommandInput , GetCachePolicyCommandOutput } from "../commands/GetCachePolicyCommand" ; import { GetCachePolicyConfigCommandInput , GetCachePolicyConfigCommandOutput , } from "../commands/GetCachePolicyConfigCommand" ; import { GetCloudFrontOriginAccessIdentityCommandInput , GetCloudFrontOriginAccessIdentityCommandOutput , } from "../commands/GetCloudFrontOriginAccessIdentityCommand" ; import { GetCloudFrontOriginAccessIdentityConfigCommandInput , GetCloudFrontOriginAccessIdentityConfigCommandOutput , } from "../commands/GetCloudFrontOriginAccessIdentityConfigCommand" ; import { GetDistributionCommandInput , GetDistributionCommandOutput } from "../commands/GetDistributionCommand" ; import { GetDistributionConfigCommandInput , GetDistributionConfigCommandOutput , } from "../commands/GetDistributionConfigCommand" ; import { GetFieldLevelEncryptionCommandInput , GetFieldLevelEncryptionCommandOutput , } from "../commands/GetFieldLevelEncryptionCommand" ; import { GetFieldLevelEncryptionConfigCommandInput , GetFieldLevelEncryptionConfigCommandOutput , } from "../commands/GetFieldLevelEncryptionConfigCommand" ; import { GetFieldLevelEncryptionProfileCommandInput , GetFieldLevelEncryptionProfileCommandOutput , } from "../commands/GetFieldLevelEncryptionProfileCommand" ; import { GetFieldLevelEncryptionProfileConfigCommandInput , GetFieldLevelEncryptionProfileConfigCommandOutput , } from "../commands/GetFieldLevelEncryptionProfileConfigCommand" ; import { GetFunctionCommandInput , GetFunctionCommandOutput } from "../commands/GetFunctionCommand" ; import { GetInvalidationCommandInput , GetInvalidationCommandOutput } from "../commands/GetInvalidationCommand" ; import { GetKeyGroupCommandInput , GetKeyGroupCommandOutput } from "../commands/GetKeyGroupCommand" ; import { GetKeyGroupConfigCommandInput , GetKeyGroupConfigCommandOutput } from "../commands/GetKeyGroupConfigCommand" ; import { GetMonitoringSubscriptionCommandInput , GetMonitoringSubscriptionCommandOutput , } from "../commands/GetMonitoringSubscriptionCommand" ; import { GetOriginRequestPolicyCommandInput , GetOriginRequestPolicyCommandOutput , } from "../commands/GetOriginRequestPolicyCommand" ; import { GetOriginRequestPolicyConfigCommandInput , GetOriginRequestPolicyConfigCommandOutput , } from "../commands/GetOriginRequestPolicyConfigCommand" ; import { GetPublicKeyCommandInput , GetPublicKeyCommandOutput } from "../commands/GetPublicKeyCommand" ; import { GetPublicKeyConfigCommandInput , GetPublicKeyConfigCommandOutput } from "../commands/GetPublicKeyConfigCommand" ; import { GetRealtimeLogConfigCommandInput , GetRealtimeLogConfigCommandOutput , } from "../commands/GetRealtimeLogConfigCommand" ; import { GetResponseHeadersPolicyCommandInput , GetResponseHeadersPolicyCommandOutput , } from "../commands/GetResponseHeadersPolicyCommand" ; import { GetResponseHeadersPolicyConfigCommandInput , GetResponseHeadersPolicyConfigCommandOutput , } from "../commands/GetResponseHeadersPolicyConfigCommand" ; import { GetStreamingDistributionCommandInput , GetStreamingDistributionCommandOutput , } from "../commands/GetStreamingDistributionCommand" ; import { GetStreamingDistributionConfigCommandInput , GetStreamingDistributionConfigCommandOutput , } from "../commands/GetStreamingDistributionConfigCommand" ; import { ListCachePoliciesCommandInput , ListCachePoliciesCommandOutput } from "../commands/ListCachePoliciesCommand" ; import { ListCloudFrontOriginAccessIdentitiesCommandInput , ListCloudFrontOriginAccessIdentitiesCommandOutput , } from "../commands/ListCloudFrontOriginAccessIdentitiesCommand" ; import { ListConflictingAliasesCommandInput , ListConflictingAliasesCommandOutput , } from "../commands/ListConflictingAliasesCommand" ; import { ListDistributionsByCachePolicyIdCommandInput , ListDistributionsByCachePolicyIdCommandOutput , } from "../commands/ListDistributionsByCachePolicyIdCommand" ; import { ListDistributionsByKeyGroupCommandInput , ListDistributionsByKeyGroupCommandOutput , } from "../commands/ListDistributionsByKeyGroupCommand" ; import { ListDistributionsByOriginRequestPolicyIdCommandInput , ListDistributionsByOriginRequestPolicyIdCommandOutput , } from "../commands/ListDistributionsByOriginRequestPolicyIdCommand" ; import { ListDistributionsByRealtimeLogConfigCommandInput , ListDistributionsByRealtimeLogConfigCommandOutput , } from "../commands/ListDistributionsByRealtimeLogConfigCommand" ; import { ListDistributionsByResponseHeadersPolicyIdCommandInput , ListDistributionsByResponseHeadersPolicyIdCommandOutput , } from "../commands/ListDistributionsByResponseHeadersPolicyIdCommand" ; import { ListDistributionsByWebACLIdCommandInput , ListDistributionsByWebACLIdCommandOutput , } from "../commands/ListDistributionsByWebACLIdCommand" ; import { ListDistributionsCommandInput , ListDistributionsCommandOutput } from "../commands/ListDistributionsCommand" ; import { ListFieldLevelEncryptionConfigsCommandInput , ListFieldLevelEncryptionConfigsCommandOutput , } from "../commands/ListFieldLevelEncryptionConfigsCommand" ; import { ListFieldLevelEncryptionProfilesCommandInput , ListFieldLevelEncryptionProfilesCommandOutput , } from "../commands/ListFieldLevelEncryptionProfilesCommand" ; import { ListFunctionsCommandInput , ListFunctionsCommandOutput } from "../commands/ListFunctionsCommand" ; import { ListInvalidationsCommandInput , ListInvalidationsCommandOutput } from "../commands/ListInvalidationsCommand" ; import { ListKeyGroupsCommandInput , ListKeyGroupsCommandOutput } from "../commands/ListKeyGroupsCommand" ; import { ListOriginRequestPoliciesCommandInput , ListOriginRequestPoliciesCommandOutput , } from "../commands/ListOriginRequestPoliciesCommand" ; import { ListPublicKeysCommandInput , ListPublicKeysCommandOutput } from "../commands/ListPublicKeysCommand" ; import { ListRealtimeLogConfigsCommandInput , ListRealtimeLogConfigsCommandOutput , } from "../commands/ListRealtimeLogConfigsCommand" ; import { ListResponseHeadersPoliciesCommandInput , ListResponseHeadersPoliciesCommandOutput , } from "../commands/ListResponseHeadersPoliciesCommand" ; import { ListStreamingDistributionsCommandInput , ListStreamingDistributionsCommandOutput , } from "../commands/ListStreamingDistributionsCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { PublishFunctionCommandInput , PublishFunctionCommandOutput } from "../commands/PublishFunctionCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { TestFunctionCommandInput , TestFunctionCommandOutput } from "../commands/TestFunctionCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateCachePolicyCommandInput , UpdateCachePolicyCommandOutput } from "../commands/UpdateCachePolicyCommand" ; import { UpdateCloudFrontOriginAccessIdentityCommandInput , UpdateCloudFrontOriginAccessIdentityCommandOutput , } from "../commands/UpdateCloudFrontOriginAccessIdentityCommand" ; import { UpdateDistributionCommandInput , UpdateDistributionCommandOutput } from "../commands/UpdateDistributionCommand" ; import { UpdateFieldLevelEncryptionConfigCommandInput , UpdateFieldLevelEncryptionConfigCommandOutput , } from "../commands/UpdateFieldLevelEncryptionConfigCommand" ; import { UpdateFieldLevelEncryptionProfileCommandInput , UpdateFieldLevelEncryptionProfileCommandOutput , } from "../commands/UpdateFieldLevelEncryptionProfileCommand" ; import { UpdateFunctionCommandInput , UpdateFunctionCommandOutput } from "../commands/UpdateFunctionCommand" ; import { UpdateKeyGroupCommandInput , UpdateKeyGroupCommandOutput } from "../commands/UpdateKeyGroupCommand" ; import { UpdateOriginRequestPolicyCommandInput , UpdateOriginRequestPolicyCommandOutput , } from "../commands/UpdateOriginRequestPolicyCommand" ; import { UpdatePublicKeyCommandInput , UpdatePublicKeyCommandOutput } from "../commands/UpdatePublicKeyCommand" ; import { UpdateRealtimeLogConfigCommandInput , UpdateRealtimeLogConfigCommandOutput , } from "../commands/UpdateRealtimeLogConfigCommand" ; import { UpdateResponseHeadersPolicyCommandInput , UpdateResponseHeadersPolicyCommandOutput , } from "../commands/UpdateResponseHeadersPolicyCommand" ; import { UpdateStreamingDistributionCommandInput , UpdateStreamingDistributionCommandOutput , } from "../commands/UpdateStreamingDistributionCommand" ; import { AccessDenied , ActiveTrustedKeyGroups , ActiveTrustedSigners , Aliases , AliasICPRecordal , AllowedMethods , BatchTooLarge , CacheBehavior , CacheBehaviors , CachedMethods , CachePolicy , CachePolicyAlreadyExists , CachePolicyConfig , CachePolicyCookiesConfig , CachePolicyHeadersConfig , CachePolicyInUse , CachePolicyList , CachePolicyQueryStringsConfig , CachePolicySummary , CannotChangeImmutablePublicKeyFields , CloudFrontOriginAccessIdentity , CloudFrontOriginAccessIdentityAlreadyExists , CloudFrontOriginAccessIdentityConfig , CloudFrontOriginAccessIdentityInUse , CNAMEAlreadyExists , ContentTypeProfile , ContentTypeProfileConfig , ContentTypeProfiles , CookieNames , CookiePreference , CustomErrorResponse , CustomErrorResponses , CustomHeaders , CustomOriginConfig , DefaultCacheBehavior , Distribution , DistributionAlreadyExists , DistributionConfig , DistributionConfigWithTags , DistributionNotDisabled , EncryptionEntities , EncryptionEntity , EndPoint , FieldLevelEncryption , FieldLevelEncryptionConfig , FieldLevelEncryptionConfigAlreadyExists , FieldLevelEncryptionConfigInUse , FieldLevelEncryptionProfile , FieldLevelEncryptionProfileAlreadyExists , FieldLevelEncryptionProfileConfig , FieldLevelEncryptionProfileInUse , FieldLevelEncryptionProfileSizeExceeded , FieldPatterns , ForwardedValues , FunctionAlreadyExists , FunctionAssociation , FunctionAssociations , FunctionConfig , FunctionInUse , FunctionMetadata , FunctionSizeLimitExceeded , FunctionSummary , GeoRestriction , Headers , IllegalDelete , IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior , IllegalUpdate , InconsistentQuantities , InvalidArgument , Invalidation , InvalidationBatch , InvalidDefaultRootObject , InvalidErrorCode , InvalidForwardCookies , InvalidFunctionAssociation , InvalidGeoRestrictionParameter , InvalidHeadersForS3Origin , InvalidIfMatchVersion , InvalidLambdaFunctionAssociation , InvalidLocationCode , InvalidMinimumProtocolVersion , InvalidOrigin , InvalidOriginAccessIdentity , InvalidOriginKeepaliveTimeout , InvalidOriginReadTimeout , InvalidProtocolSettings , InvalidQueryStringParameters , InvalidRelativePath , InvalidRequiredProtocol , InvalidResponseCode , InvalidTagging , InvalidTTLOrder , InvalidViewerCertificate , InvalidWebACLId , KeyGroup , KeyGroupAlreadyExists , KeyGroupConfig , KeyPairIds , KGKeyPairIds , KinesisStreamConfig , LambdaFunctionAssociation , LambdaFunctionAssociations , LoggingConfig , Method , MissingBody , MonitoringSubscription , NoSuchCachePolicy , NoSuchCloudFrontOriginAccessIdentity , NoSuchDistribution , NoSuchFieldLevelEncryptionConfig , NoSuchFieldLevelEncryptionProfile , NoSuchFunctionExists , NoSuchOrigin , NoSuchOriginRequestPolicy , NoSuchPublicKey , NoSuchRealtimeLogConfig , NoSuchResource , NoSuchResponseHeadersPolicy , Origin , OriginCustomHeader , OriginGroup , OriginGroupFailoverCriteria , OriginGroupMember , OriginGroupMembers , OriginGroups , OriginRequestPolicy , OriginRequestPolicyAlreadyExists , OriginRequestPolicyConfig , OriginRequestPolicyCookiesConfig , OriginRequestPolicyHeadersConfig , OriginRequestPolicyQueryStringsConfig , Origins , OriginShield , OriginSslProtocols , ParametersInCacheKeyAndForwardedToOrigin , Paths , PreconditionFailed , PublicKey , PublicKeyAlreadyExists , PublicKeyConfig , QueryArgProfile , QueryArgProfileConfig , QueryArgProfileEmpty , QueryArgProfiles , QueryStringCacheKeys , QueryStringNames , RealtimeLogConfig , RealtimeLogConfigAlreadyExists , RealtimeLogConfigOwnerMismatch , RealtimeMetricsSubscriptionConfig , ResourceInUse , ResponseHeadersPolicy , ResponseHeadersPolicyAccessControlAllowHeaders , ResponseHeadersPolicyAccessControlAllowMethods , ResponseHeadersPolicyAccessControlAllowMethodsValues , ResponseHeadersPolicyAccessControlAllowOrigins , ResponseHeadersPolicyAccessControlExposeHeaders , ResponseHeadersPolicyAlreadyExists , ResponseHeadersPolicyConfig , ResponseHeadersPolicyContentSecurityPolicy , ResponseHeadersPolicyContentTypeOptions , ResponseHeadersPolicyCorsConfig , ResponseHeadersPolicyCustomHeader , ResponseHeadersPolicyCustomHeadersConfig , ResponseHeadersPolicyFrameOptions , ResponseHeadersPolicyReferrerPolicy , ResponseHeadersPolicySecurityHeadersConfig , ResponseHeadersPolicyStrictTransportSecurity , ResponseHeadersPolicyXSSProtection , Restrictions , S3Origin , S3OriginConfig , Signer , SslProtocol , StatusCodes , StreamingDistribution , StreamingDistributionAlreadyExists , StreamingDistributionConfig , StreamingDistributionConfigWithTags , StreamingLoggingConfig , Tag , Tags , TooManyCacheBehaviors , TooManyCachePolicies , TooManyCertificates , TooManyCloudFrontOriginAccessIdentities , TooManyCookieNamesInWhiteList , TooManyCookiesInCachePolicy , TooManyCookiesInOriginRequestPolicy , TooManyCustomHeadersInResponseHeadersPolicy , TooManyDistributionCNAMEs , TooManyDistributions , TooManyDistributionsAssociatedToCachePolicy , TooManyDistributionsAssociatedToFieldLevelEncryptionConfig , TooManyDistributionsAssociatedToKeyGroup , TooManyDistributionsAssociatedToOriginRequestPolicy , TooManyDistributionsAssociatedToResponseHeadersPolicy , TooManyDistributionsWithFunctionAssociations , TooManyDistributionsWithLambdaAssociations , TooManyDistributionsWithSingleFunctionARN , TooManyFieldLevelEncryptionConfigs , TooManyFieldLevelEncryptionContentTypeProfiles , TooManyFieldLevelEncryptionEncryptionEntities , TooManyFieldLevelEncryptionFieldPatterns , TooManyFieldLevelEncryptionProfiles , TooManyFieldLevelEncryptionQueryArgProfiles , TooManyFunctionAssociations , TooManyFunctions , TooManyHeadersInCachePolicy , TooManyHeadersInForwardedValues , TooManyHeadersInOriginRequestPolicy , TooManyInvalidationsInProgress , TooManyKeyGroups , TooManyKeyGroupsAssociatedToDistribution , TooManyLambdaFunctionAssociations , TooManyOriginCustomHeaders , TooManyOriginGroupsPerDistribution , TooManyOriginRequestPolicies , TooManyOrigins , TooManyPublicKeys , TooManyPublicKeysInKeyGroup , TooManyQueryStringParameters , TooManyQueryStringsInCachePolicy , TooManyQueryStringsInOriginRequestPolicy , TooManyRealtimeLogConfigs , TooManyResponseHeadersPolicies , TooManyStreamingDistributionCNAMEs , TooManyStreamingDistributions , TooManyTrustedSigners , TrustedKeyGroupDoesNotExist , TrustedKeyGroups , TrustedSignerDoesNotExist , TrustedSigners , UnsupportedOperation , ViewerCertificate , } from "../models/models_0" ; import { CloudFrontOriginAccessIdentityList , CloudFrontOriginAccessIdentitySummary , ConflictingAlias , ConflictingAliasesList , DistributionIdList , DistributionList , DistributionSummary , FieldLevelEncryptionList , FieldLevelEncryptionProfileList , FieldLevelEncryptionProfileSummary , FieldLevelEncryptionSummary , FunctionList , InvalidationList , InvalidationSummary , KeyGroupList , KeyGroupSummary , NoSuchInvalidation , NoSuchStreamingDistribution , OriginRequestPolicyInUse , OriginRequestPolicyList , OriginRequestPolicySummary , PublicKeyInUse , PublicKeyList , PublicKeySummary , RealtimeLogConfigInUse , RealtimeLogConfigs , ResponseHeadersPolicyInUse , ResponseHeadersPolicyList , ResponseHeadersPolicySummary , StreamingDistributionList , StreamingDistributionNotDisabled , StreamingDistributionSummary , TagKeys , TestFunctionFailed , TestResult , } from "../models/models_1" ; export const serializeAws_restXmlAssociateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{TargetDistributionId}/associate-alias" ; if ( input . TargetDistributionId !== undefined ) { const labelValue = input . TargetDistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TargetDistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{TargetDistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TargetDistributionId." ) ; } const query = { ... ( input . Alias !== undefined && { Alias : input . Alias } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlCreateCachePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/cache-policy" ; let body ; if ( input . CachePolicyConfig !== undefined ) { body = serializeAws_restXmlCachePolicyConfig ( input . CachePolicyConfig , context ) ; } let contents ; if ( input . CachePolicyConfig !== undefined ) { contents = serializeAws_restXmlCachePolicyConfig ( input . CachePolicyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-access-identity/cloudfront" ; let body ; if ( input . CloudFrontOriginAccessIdentityConfig !== undefined ) { body = serializeAws_restXmlCloudFrontOriginAccessIdentityConfig ( input . CloudFrontOriginAccessIdentityConfig , context ) ; } let contents ; if ( input . CloudFrontOriginAccessIdentityConfig !== undefined ) { contents = serializeAws_restXmlCloudFrontOriginAccessIdentityConfig ( input . CloudFrontOriginAccessIdentityConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution" ; let body ; if ( input . DistributionConfig !== undefined ) { body = serializeAws_restXmlDistributionConfig ( input . DistributionConfig , context ) ; } let contents ; if ( input . DistributionConfig !== undefined ) { contents = serializeAws_restXmlDistributionConfig ( input . DistributionConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateDistributionWithTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution" ; const query = { WithTags : "" , } ; let body ; if ( input . DistributionConfigWithTags !== undefined ) { body = serializeAws_restXmlDistributionConfigWithTags ( input . DistributionConfigWithTags , context ) ; } let contents ; if ( input . DistributionConfigWithTags !== undefined ) { contents = serializeAws_restXmlDistributionConfigWithTags ( input . DistributionConfigWithTags , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlCreateFieldLevelEncryptionConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption" ; let body ; if ( input . FieldLevelEncryptionConfig !== undefined ) { body = serializeAws_restXmlFieldLevelEncryptionConfig ( input . FieldLevelEncryptionConfig , context ) ; } let contents ; if ( input . FieldLevelEncryptionConfig !== undefined ) { contents = serializeAws_restXmlFieldLevelEncryptionConfig ( input . FieldLevelEncryptionConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateFieldLevelEncryptionProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption-profile" ; let body ; if ( input . FieldLevelEncryptionProfileConfig !== undefined ) { body = serializeAws_restXmlFieldLevelEncryptionProfileConfig ( input . FieldLevelEncryptionProfileConfig , context ) ; } let contents ; if ( input . FieldLevelEncryptionProfileConfig !== undefined ) { contents = serializeAws_restXmlFieldLevelEncryptionProfileConfig ( input . FieldLevelEncryptionProfileConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function" ; let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "CreateFunctionRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . FunctionCode !== undefined ) { const node = new __XmlNode ( "FunctionBlob" ) . addChildNode ( new __XmlText ( context . base64Encoder ( input . FunctionCode ) ) ) . withName ( "FunctionCode" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FunctionConfig !== undefined ) { const node = serializeAws_restXmlFunctionConfig ( input . FunctionConfig , context ) . withName ( "FunctionConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined ) { const node = new __XmlNode ( "FunctionName" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateInvalidationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{DistributionId}/invalidation" ; if ( input . DistributionId !== undefined ) { const labelValue = input . DistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{DistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DistributionId." ) ; } let body ; if ( input . InvalidationBatch !== undefined ) { body = serializeAws_restXmlInvalidationBatch ( input . InvalidationBatch , context ) ; } let contents ; if ( input . InvalidationBatch !== undefined ) { contents = serializeAws_restXmlInvalidationBatch ( input . InvalidationBatch , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateKeyGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/key-group" ; let body ; if ( input . KeyGroupConfig !== undefined ) { body = serializeAws_restXmlKeyGroupConfig ( input . KeyGroupConfig , context ) ; } let contents ; if ( input . KeyGroupConfig !== undefined ) { contents = serializeAws_restXmlKeyGroupConfig ( input . KeyGroupConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateMonitoringSubscriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributions/{DistributionId}/monitoring-subscription" ; if ( input . DistributionId !== undefined ) { const labelValue = input . DistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{DistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DistributionId." ) ; } let body ; if ( input . MonitoringSubscription !== undefined ) { body = serializeAws_restXmlMonitoringSubscription ( input . MonitoringSubscription , context ) ; } let contents ; if ( input . MonitoringSubscription !== undefined ) { contents = serializeAws_restXmlMonitoringSubscription ( input . MonitoringSubscription , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateOriginRequestPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-request-policy" ; let body ; if ( input . OriginRequestPolicyConfig !== undefined ) { body = serializeAws_restXmlOriginRequestPolicyConfig ( input . OriginRequestPolicyConfig , context ) ; } let contents ; if ( input . OriginRequestPolicyConfig !== undefined ) { contents = serializeAws_restXmlOriginRequestPolicyConfig ( input . OriginRequestPolicyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreatePublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/public-key" ; let body ; if ( input . PublicKeyConfig !== undefined ) { body = serializeAws_restXmlPublicKeyConfig ( input . PublicKeyConfig , context ) ; } let contents ; if ( input . PublicKeyConfig !== undefined ) { contents = serializeAws_restXmlPublicKeyConfig ( input . PublicKeyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateRealtimeLogConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/realtime-log-config" ; let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "CreateRealtimeLogConfigRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . EndPoints !== undefined ) { const nodes = serializeAws_restXmlEndPointList ( input . EndPoints , context ) ; const containerNode = new __XmlNode ( "EndPoints" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } if ( input . Fields !== undefined ) { const nodes = serializeAws_restXmlFieldList ( input . Fields , context ) ; const containerNode = new __XmlNode ( "Fields" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } if ( input . Name !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . SamplingRate !== undefined ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . SamplingRate ) ) ) . withName ( "SamplingRate" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateResponseHeadersPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/response-headers-policy" ; let body ; if ( input . ResponseHeadersPolicyConfig !== undefined ) { body = serializeAws_restXmlResponseHeadersPolicyConfig ( input . ResponseHeadersPolicyConfig , context ) ; } let contents ; if ( input . ResponseHeadersPolicyConfig !== undefined ) { contents = serializeAws_restXmlResponseHeadersPolicyConfig ( input . ResponseHeadersPolicyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateStreamingDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution" ; let body ; if ( input . StreamingDistributionConfig !== undefined ) { body = serializeAws_restXmlStreamingDistributionConfig ( input . StreamingDistributionConfig , context ) ; } let contents ; if ( input . StreamingDistributionConfig !== undefined ) { contents = serializeAws_restXmlStreamingDistributionConfig ( input . StreamingDistributionConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlCreateStreamingDistributionWithTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution" ; const query = { WithTags : "" , } ; let body ; if ( input . StreamingDistributionConfigWithTags !== undefined ) { body = serializeAws_restXmlStreamingDistributionConfigWithTags ( input . StreamingDistributionConfigWithTags , context ) ; } let contents ; if ( input . StreamingDistributionConfigWithTags !== undefined ) { contents = serializeAws_restXmlStreamingDistributionConfigWithTags ( input . StreamingDistributionConfigWithTags , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlDeleteCachePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/cache-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-access-identity/cloudfront/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteFieldLevelEncryptionConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteFieldLevelEncryptionProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption-profile/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function/{Name}" ; if ( input . Name !== undefined ) { const labelValue = input . Name ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Name." ) ; } resolvedPath = resolvedPath . replace ( "{Name}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Name." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteKeyGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/key-group/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteMonitoringSubscriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributions/{DistributionId}/monitoring-subscription" ; if ( input . DistributionId !== undefined ) { const labelValue = input . DistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{DistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DistributionId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteOriginRequestPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-request-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeletePublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/public-key/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteRealtimeLogConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/delete-realtime-log-config" ; let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "DeleteRealtimeLogConfigRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . ARN !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ARN ) ) . withName ( "ARN" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteResponseHeadersPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/response-headers-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDeleteStreamingDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlDescribeFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function/{Name}/describe" ; if ( input . Name !== undefined ) { const labelValue = input . Name ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Name." ) ; } resolvedPath = resolvedPath . replace ( "{Name}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Name." ) ; } const query = { ... ( input . Stage !== undefined && { Stage : input . Stage } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlGetCachePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/cache-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetCachePolicyConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/cache-policy/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetCloudFrontOriginAccessIdentityCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-access-identity/cloudfront/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-access-identity/cloudfront/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetDistributionConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetFieldLevelEncryptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetFieldLevelEncryptionConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetFieldLevelEncryptionProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption-profile/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption-profile/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function/{Name}" ; if ( input . Name !== undefined ) { const labelValue = input . Name ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Name." ) ; } resolvedPath = resolvedPath . replace ( "{Name}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Name." ) ; } const query = { ... ( input . Stage !== undefined && { Stage : input . Stage } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlGetInvalidationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{DistributionId}/invalidation/{Id}" ; if ( input . DistributionId !== undefined ) { const labelValue = input . DistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{DistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DistributionId." ) ; } if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetKeyGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/key-group/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetKeyGroupConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/key-group/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetMonitoringSubscriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributions/{DistributionId}/monitoring-subscription" ; if ( input . DistributionId !== undefined ) { const labelValue = input . DistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{DistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DistributionId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetOriginRequestPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-request-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetOriginRequestPolicyConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-request-policy/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetPublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/public-key/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetPublicKeyConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/public-key/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetRealtimeLogConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/get-realtime-log-config" ; let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "GetRealtimeLogConfigRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . ARN !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ARN ) ) . withName ( "ARN" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetResponseHeadersPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/response-headers-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetResponseHeadersPolicyConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/response-headers-policy/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetStreamingDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlGetStreamingDistributionConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlListCachePoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/cache-policy" ; const query = { ... ( input . Type !== undefined && { Type : input . Type } ) , ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-access-identity/cloudfront" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListConflictingAliasesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/conflicting-alias" ; const query = { ... ( input . DistributionId !== undefined && { DistributionId : input . DistributionId } ) , ... ( input . Alias !== undefined && { Alias : input . Alias } ) , ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListDistributionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListDistributionsByCachePolicyIdCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributionsByCachePolicyId/{CachePolicyId}" ; if ( input . CachePolicyId !== undefined ) { const labelValue = input . CachePolicyId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: CachePolicyId." ) ; } resolvedPath = resolvedPath . replace ( "{CachePolicyId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: CachePolicyId." ) ; } const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListDistributionsByKeyGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributionsByKeyGroupId/{KeyGroupId}" ; if ( input . KeyGroupId !== undefined ) { const labelValue = input . KeyGroupId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: KeyGroupId." ) ; } resolvedPath = resolvedPath . replace ( "{KeyGroupId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: KeyGroupId." ) ; } const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributionsByOriginRequestPolicyId/{OriginRequestPolicyId}" ; if ( input . OriginRequestPolicyId !== undefined ) { const labelValue = input . OriginRequestPolicyId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: OriginRequestPolicyId." ) ; } resolvedPath = resolvedPath . replace ( "{OriginRequestPolicyId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: OriginRequestPolicyId." ) ; } const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListDistributionsByRealtimeLogConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributionsByRealtimeLogConfig" ; let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "ListDistributionsByRealtimeLogConfigRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . Marker !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Marker ) ) . withName ( "Marker" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MaxItems !== undefined ) { const node = new __XmlNode ( "Integer" ) . addChildNode ( new __XmlText ( String ( input . MaxItems ) ) ) . withName ( "MaxItems" ) ; bodyNode . addChildNode ( node ) ; } if ( input . RealtimeLogConfigArn !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . RealtimeLogConfigArn ) ) . withName ( "RealtimeLogConfigArn" ) ; bodyNode . addChildNode ( node ) ; } if ( input . RealtimeLogConfigName !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . RealtimeLogConfigName ) ) . withName ( "RealtimeLogConfigName" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributionsByResponseHeadersPolicyId/{ResponseHeadersPolicyId}" ; if ( input . ResponseHeadersPolicyId !== undefined ) { const labelValue = input . ResponseHeadersPolicyId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ResponseHeadersPolicyId." ) ; } resolvedPath = resolvedPath . replace ( "{ResponseHeadersPolicyId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ResponseHeadersPolicyId." ) ; } const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListDistributionsByWebACLIdCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distributionsByWebACLId/{WebACLId}" ; if ( input . WebACLId !== undefined ) { const labelValue = input . WebACLId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: WebACLId." ) ; } resolvedPath = resolvedPath . replace ( "{WebACLId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: WebACLId." ) ; } const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListFieldLevelEncryptionConfigsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListFieldLevelEncryptionProfilesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption-profile" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListFunctionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , ... ( input . Stage !== undefined && { Stage : input . Stage } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListInvalidationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{DistributionId}/invalidation" ; if ( input . DistributionId !== undefined ) { const labelValue = input . DistributionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DistributionId." ) ; } resolvedPath = resolvedPath . replace ( "{DistributionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DistributionId." ) ; } const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListKeyGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/key-group" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListOriginRequestPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-request-policy" ; const query = { ... ( input . Type !== undefined && { Type : input . Type } ) , ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListPublicKeysCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/public-key" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListRealtimeLogConfigsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/realtime-log-config" ; const query = { ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , ... ( input . Marker !== undefined && { Marker : input . Marker } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListResponseHeadersPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/response-headers-policy" ; const query = { ... ( input . Type !== undefined && { Type : input . Type } ) , ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListStreamingDistributionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution" ; const query = { ... ( input . Marker !== undefined && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && { MaxItems : input . MaxItems . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/tagging" ; const query = { ... ( input . Resource !== undefined && { Resource : input . Resource } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlPublishFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function/{Name}/publish" ; if ( input . Name !== undefined ) { const labelValue = input . Name ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Name." ) ; } resolvedPath = resolvedPath . replace ( "{Name}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Name." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlTagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/tagging" ; const query = { Operation : "Tag" , ... ( input . Resource !== undefined && { Resource : input . Resource } ) , } ; let body ; if ( input . Tags !== undefined ) { body = serializeAws_restXmlTags ( input . Tags , context ) ; } let contents ; if ( input . Tags !== undefined ) { contents = serializeAws_restXmlTags ( input . Tags , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlTestFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function/{Name}/test" ; if ( input . Name !== undefined ) { const labelValue = input . Name ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Name." ) ; } resolvedPath = resolvedPath . replace ( "{Name}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Name." ) ; } let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "TestFunctionRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . EventObject !== undefined ) { const node = new __XmlNode ( "FunctionEventObject" ) . addChildNode ( new __XmlText ( context . base64Encoder ( input . EventObject ) ) ) . withName ( "EventObject" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Stage !== undefined ) { const node = new __XmlNode ( "FunctionStage" ) . addChildNode ( new __XmlText ( input . Stage ) ) . withName ( "Stage" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/tagging" ; const query = { Operation : "Untag" , ... ( input . Resource !== undefined && { Resource : input . Resource } ) , } ; let body ; if ( input . TagKeys !== undefined ) { body = serializeAws_restXmlTagKeys ( input . TagKeys , context ) ; } let contents ; if ( input . TagKeys !== undefined ) { contents = serializeAws_restXmlTagKeys ( input . TagKeys , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restXmlUpdateCachePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/cache-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . CachePolicyConfig !== undefined ) { body = serializeAws_restXmlCachePolicyConfig ( input . CachePolicyConfig , context ) ; } let contents ; if ( input . CachePolicyConfig !== undefined ) { contents = serializeAws_restXmlCachePolicyConfig ( input . CachePolicyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-access-identity/cloudfront/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . CloudFrontOriginAccessIdentityConfig !== undefined ) { body = serializeAws_restXmlCloudFrontOriginAccessIdentityConfig ( input . CloudFrontOriginAccessIdentityConfig , context ) ; } let contents ; if ( input . CloudFrontOriginAccessIdentityConfig !== undefined ) { contents = serializeAws_restXmlCloudFrontOriginAccessIdentityConfig ( input . CloudFrontOriginAccessIdentityConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/distribution/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . DistributionConfig !== undefined ) { body = serializeAws_restXmlDistributionConfig ( input . DistributionConfig , context ) ; } let contents ; if ( input . DistributionConfig !== undefined ) { contents = serializeAws_restXmlDistributionConfig ( input . DistributionConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateFieldLevelEncryptionConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . FieldLevelEncryptionConfig !== undefined ) { body = serializeAws_restXmlFieldLevelEncryptionConfig ( input . FieldLevelEncryptionConfig , context ) ; } let contents ; if ( input . FieldLevelEncryptionConfig !== undefined ) { contents = serializeAws_restXmlFieldLevelEncryptionConfig ( input . FieldLevelEncryptionConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateFieldLevelEncryptionProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/field-level-encryption-profile/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . FieldLevelEncryptionProfileConfig !== undefined ) { body = serializeAws_restXmlFieldLevelEncryptionProfileConfig ( input . FieldLevelEncryptionProfileConfig , context ) ; } let contents ; if ( input . FieldLevelEncryptionProfileConfig !== undefined ) { contents = serializeAws_restXmlFieldLevelEncryptionProfileConfig ( input . FieldLevelEncryptionProfileConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateFunctionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/function/{Name}" ; if ( input . Name !== undefined ) { const labelValue = input . Name ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Name." ) ; } resolvedPath = resolvedPath . replace ( "{Name}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Name." ) ; } let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "UpdateFunctionRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . FunctionCode !== undefined ) { const node = new __XmlNode ( "FunctionBlob" ) . addChildNode ( new __XmlText ( context . base64Encoder ( input . FunctionCode ) ) ) . withName ( "FunctionCode" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FunctionConfig !== undefined ) { const node = serializeAws_restXmlFunctionConfig ( input . FunctionConfig , context ) . withName ( "FunctionConfig" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateKeyGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/key-group/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . KeyGroupConfig !== undefined ) { body = serializeAws_restXmlKeyGroupConfig ( input . KeyGroupConfig , context ) ; } let contents ; if ( input . KeyGroupConfig !== undefined ) { contents = serializeAws_restXmlKeyGroupConfig ( input . KeyGroupConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateOriginRequestPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/origin-request-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . OriginRequestPolicyConfig !== undefined ) { body = serializeAws_restXmlOriginRequestPolicyConfig ( input . OriginRequestPolicyConfig , context ) ; } let contents ; if ( input . OriginRequestPolicyConfig !== undefined ) { contents = serializeAws_restXmlOriginRequestPolicyConfig ( input . OriginRequestPolicyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdatePublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/public-key/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . PublicKeyConfig !== undefined ) { body = serializeAws_restXmlPublicKeyConfig ( input . PublicKeyConfig , context ) ; } let contents ; if ( input . PublicKeyConfig !== undefined ) { contents = serializeAws_restXmlPublicKeyConfig ( input . PublicKeyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateRealtimeLogConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/realtime-log-config" ; let body ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; const bodyNode = new __XmlNode ( "UpdateRealtimeLogConfigRequest" ) ; bodyNode . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; if ( input . ARN !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ARN ) ) . withName ( "ARN" ) ; bodyNode . addChildNode ( node ) ; } if ( input . EndPoints !== undefined ) { const nodes = serializeAws_restXmlEndPointList ( input . EndPoints , context ) ; const containerNode = new __XmlNode ( "EndPoints" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } if ( input . Fields !== undefined ) { const nodes = serializeAws_restXmlFieldList ( input . Fields , context ) ; const containerNode = new __XmlNode ( "Fields" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } if ( input . Name !== undefined ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . SamplingRate !== undefined ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . SamplingRate ) ) ) . withName ( "SamplingRate" ) ; bodyNode . addChildNode ( node ) ; } body += bodyNode . toString ( ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateResponseHeadersPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/response-headers-policy/{Id}" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . ResponseHeadersPolicyConfig !== undefined ) { body = serializeAws_restXmlResponseHeadersPolicyConfig ( input . ResponseHeadersPolicyConfig , context ) ; } let contents ; if ( input . ResponseHeadersPolicyConfig !== undefined ) { contents = serializeAws_restXmlResponseHeadersPolicyConfig ( input . ResponseHeadersPolicyConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restXmlUpdateStreamingDistributionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/xml" , ... ( isSerializableHeaderValue ( input . IfMatch ) && { "if-match" : input . IfMatch ! } ) , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/2020-05-31/streaming-distribution/{Id}/config" ; if ( input . Id !== undefined ) { const labelValue = input . Id ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Id." ) ; } resolvedPath = resolvedPath . replace ( "{Id}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Id." ) ; } let body ; if ( input . StreamingDistributionConfig !== undefined ) { body = serializeAws_restXmlStreamingDistributionConfig ( input . StreamingDistributionConfig , context ) ; } let contents ; if ( input . StreamingDistributionConfig !== undefined ) { contents = serializeAws_restXmlStreamingDistributionConfig ( input . StreamingDistributionConfig , context ) ; body = '<?xml version="1.0" encoding="UTF-8"?>' ; contents . addAttribute ( "xmlns" , "http://cloudfront.amazonaws.com/doc/2020-05-31/" ) ; body += contents . toString ( ) ; } return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const deserializeAws_restXmlAssociateAliasCommand = async ( output , context ) : Promise < AssociateAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlAssociateAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlAssociateAliasCommandError = async ( output , context ) : Promise < AssociateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyDistributionCNAMEsResponse ( 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_restXmlCreateCachePolicyCommand = async ( output , context ) : Promise < CreateCachePolicyCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateCachePolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CachePolicy : undefined , ETag : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CachePolicy = deserializeAws_restXmlCachePolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateCachePolicyCommandError = async ( output , context ) : Promise < CreateCachePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CachePolicyAlreadyExists" : case "com.amazonaws.cloudfront#CachePolicyAlreadyExists" : response = { ... ( await deserializeAws_restXmlCachePolicyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCachePolicies" : case "com.amazonaws.cloudfront#TooManyCachePolicies" : response = { ... ( await deserializeAws_restXmlTooManyCachePoliciesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookiesInCachePolicy" : case "com.amazonaws.cloudfront#TooManyCookiesInCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyCookiesInCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInCachePolicy" : case "com.amazonaws.cloudfront#TooManyHeadersInCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringsInCachePolicy" : case "com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringsInCachePolicyResponse ( 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_restXmlCreateCloudFrontOriginAccessIdentityCommand = async ( output , context ) : Promise < CreateCloudFrontOriginAccessIdentityCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CloudFrontOriginAccessIdentity : undefined , ETag : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CloudFrontOriginAccessIdentity = deserializeAws_restXmlCloudFrontOriginAccessIdentity ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateCloudFrontOriginAccessIdentityCommandError = async ( output , context ) : Promise < CreateCloudFrontOriginAccessIdentityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CloudFrontOriginAccessIdentityAlreadyExists" : case "com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityAlreadyExists" : response = { ... ( await deserializeAws_restXmlCloudFrontOriginAccessIdentityAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCloudFrontOriginAccessIdentities" : case "com.amazonaws.cloudfront#TooManyCloudFrontOriginAccessIdentities" : response = { ... ( await deserializeAws_restXmlTooManyCloudFrontOriginAccessIdentitiesResponse ( 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_restXmlCreateDistributionCommand = async ( output , context ) : Promise < CreateDistributionCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Distribution : undefined , ETag : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Distribution = deserializeAws_restXmlDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateDistributionCommandError = async ( output , context ) : Promise < CreateDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CNAMEAlreadyExists" : case "com.amazonaws.cloudfront#CNAMEAlreadyExists" : response = { ... ( await deserializeAws_restXmlCNAMEAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DistributionAlreadyExists" : case "com.amazonaws.cloudfront#DistributionAlreadyExists" : response = { ... ( await deserializeAws_restXmlDistributionAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" : case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" : response = { ... ( await deserializeAws_restXmlIllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidDefaultRootObject" : case "com.amazonaws.cloudfront#InvalidDefaultRootObject" : response = { ... ( await deserializeAws_restXmlInvalidDefaultRootObjectResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidErrorCode" : case "com.amazonaws.cloudfront#InvalidErrorCode" : response = { ... ( await deserializeAws_restXmlInvalidErrorCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidForwardCookies" : case "com.amazonaws.cloudfront#InvalidForwardCookies" : response = { ... ( await deserializeAws_restXmlInvalidForwardCookiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFunctionAssociation" : case "com.amazonaws.cloudfront#InvalidFunctionAssociation" : response = { ... ( await deserializeAws_restXmlInvalidFunctionAssociationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidGeoRestrictionParameter" : case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter" : response = { ... ( await deserializeAws_restXmlInvalidGeoRestrictionParameterResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidHeadersForS3Origin" : case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin" : response = { ... ( await deserializeAws_restXmlInvalidHeadersForS3OriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaFunctionAssociation" : case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation" : response = { ... ( await deserializeAws_restXmlInvalidLambdaFunctionAssociationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLocationCode" : case "com.amazonaws.cloudfront#InvalidLocationCode" : response = { ... ( await deserializeAws_restXmlInvalidLocationCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidMinimumProtocolVersion" : case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion" : response = { ... ( await deserializeAws_restXmlInvalidMinimumProtocolVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOrigin" : case "com.amazonaws.cloudfront#InvalidOrigin" : response = { ... ( await deserializeAws_restXmlInvalidOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginAccessIdentity" : case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlInvalidOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginKeepaliveTimeout" : case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout" : response = { ... ( await deserializeAws_restXmlInvalidOriginKeepaliveTimeoutResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginReadTimeout" : case "com.amazonaws.cloudfront#InvalidOriginReadTimeout" : response = { ... ( await deserializeAws_restXmlInvalidOriginReadTimeoutResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidProtocolSettings" : case "com.amazonaws.cloudfront#InvalidProtocolSettings" : response = { ... ( await deserializeAws_restXmlInvalidProtocolSettingsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidQueryStringParameters" : case "com.amazonaws.cloudfront#InvalidQueryStringParameters" : response = { ... ( await deserializeAws_restXmlInvalidQueryStringParametersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRelativePath" : case "com.amazonaws.cloudfront#InvalidRelativePath" : response = { ... ( await deserializeAws_restXmlInvalidRelativePathResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequiredProtocol" : case "com.amazonaws.cloudfront#InvalidRequiredProtocol" : response = { ... ( await deserializeAws_restXmlInvalidRequiredProtocolResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResponseCode" : case "com.amazonaws.cloudfront#InvalidResponseCode" : response = { ... ( await deserializeAws_restXmlInvalidResponseCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTTLOrder" : case "com.amazonaws.cloudfront#InvalidTTLOrder" : response = { ... ( await deserializeAws_restXmlInvalidTTLOrderResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidViewerCertificate" : case "com.amazonaws.cloudfront#InvalidViewerCertificate" : response = { ... ( await deserializeAws_restXmlInvalidViewerCertificateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidWebACLId" : case "com.amazonaws.cloudfront#InvalidWebACLId" : response = { ... ( await deserializeAws_restXmlInvalidWebACLIdResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOrigin" : case "com.amazonaws.cloudfront#NoSuchOrigin" : response = { ... ( await deserializeAws_restXmlNoSuchOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RealtimeLogConfigOwnerMismatch" : case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch" : response = { ... ( await deserializeAws_restXmlRealtimeLogConfigOwnerMismatchResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCacheBehaviors" : case "com.amazonaws.cloudfront#TooManyCacheBehaviors" : response = { ... ( await deserializeAws_restXmlTooManyCacheBehaviorsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCertificates" : case "com.amazonaws.cloudfront#TooManyCertificates" : response = { ... ( await deserializeAws_restXmlTooManyCertificatesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookieNamesInWhiteList" : case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList" : response = { ... ( await deserializeAws_restXmlTooManyCookieNamesInWhiteListResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyDistributionCNAMEsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributions" : case "com.amazonaws.cloudfront#TooManyDistributions" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToCachePolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToKeyGroup" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToKeyGroupResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToResponseHeadersPolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithLambdaAssociations" : case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithLambdaAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithSingleFunctionARN" : case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithSingleFunctionARNResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInForwardedValues" : case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInForwardedValuesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyKeyGroupsAssociatedToDistribution" : case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution" : response = { ... ( await deserializeAws_restXmlTooManyKeyGroupsAssociatedToDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyLambdaFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyLambdaFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginCustomHeaders" : case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders" : response = { ... ( await deserializeAws_restXmlTooManyOriginCustomHeadersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginGroupsPerDistribution" : case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution" : response = { ... ( await deserializeAws_restXmlTooManyOriginGroupsPerDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOrigins" : case "com.amazonaws.cloudfront#TooManyOrigins" : response = { ... ( await deserializeAws_restXmlTooManyOriginsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringParameters" : case "com.amazonaws.cloudfront#TooManyQueryStringParameters" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringParametersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTrustedSigners" : case "com.amazonaws.cloudfront#TooManyTrustedSigners" : response = { ... ( await deserializeAws_restXmlTooManyTrustedSignersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedKeyGroupDoesNotExist" : case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedKeyGroupDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedSignerDoesNotExist" : case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedSignerDoesNotExistResponse ( 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_restXmlCreateDistributionWithTagsCommand = async ( output , context ) : Promise < CreateDistributionWithTagsCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateDistributionWithTagsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Distribution : undefined , ETag : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Distribution = deserializeAws_restXmlDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateDistributionWithTagsCommandError = async ( output , context ) : Promise < CreateDistributionWithTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CNAMEAlreadyExists" : case "com.amazonaws.cloudfront#CNAMEAlreadyExists" : response = { ... ( await deserializeAws_restXmlCNAMEAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DistributionAlreadyExists" : case "com.amazonaws.cloudfront#DistributionAlreadyExists" : response = { ... ( await deserializeAws_restXmlDistributionAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" : case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" : response = { ... ( await deserializeAws_restXmlIllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidDefaultRootObject" : case "com.amazonaws.cloudfront#InvalidDefaultRootObject" : response = { ... ( await deserializeAws_restXmlInvalidDefaultRootObjectResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidErrorCode" : case "com.amazonaws.cloudfront#InvalidErrorCode" : response = { ... ( await deserializeAws_restXmlInvalidErrorCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidForwardCookies" : case "com.amazonaws.cloudfront#InvalidForwardCookies" : response = { ... ( await deserializeAws_restXmlInvalidForwardCookiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFunctionAssociation" : case "com.amazonaws.cloudfront#InvalidFunctionAssociation" : response = { ... ( await deserializeAws_restXmlInvalidFunctionAssociationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidGeoRestrictionParameter" : case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter" : response = { ... ( await deserializeAws_restXmlInvalidGeoRestrictionParameterResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidHeadersForS3Origin" : case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin" : response = { ... ( await deserializeAws_restXmlInvalidHeadersForS3OriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaFunctionAssociation" : case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation" : response = { ... ( await deserializeAws_restXmlInvalidLambdaFunctionAssociationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLocationCode" : case "com.amazonaws.cloudfront#InvalidLocationCode" : response = { ... ( await deserializeAws_restXmlInvalidLocationCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidMinimumProtocolVersion" : case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion" : response = { ... ( await deserializeAws_restXmlInvalidMinimumProtocolVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOrigin" : case "com.amazonaws.cloudfront#InvalidOrigin" : response = { ... ( await deserializeAws_restXmlInvalidOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginAccessIdentity" : case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlInvalidOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginKeepaliveTimeout" : case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout" : response = { ... ( await deserializeAws_restXmlInvalidOriginKeepaliveTimeoutResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginReadTimeout" : case "com.amazonaws.cloudfront#InvalidOriginReadTimeout" : response = { ... ( await deserializeAws_restXmlInvalidOriginReadTimeoutResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidProtocolSettings" : case "com.amazonaws.cloudfront#InvalidProtocolSettings" : response = { ... ( await deserializeAws_restXmlInvalidProtocolSettingsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidQueryStringParameters" : case "com.amazonaws.cloudfront#InvalidQueryStringParameters" : response = { ... ( await deserializeAws_restXmlInvalidQueryStringParametersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRelativePath" : case "com.amazonaws.cloudfront#InvalidRelativePath" : response = { ... ( await deserializeAws_restXmlInvalidRelativePathResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequiredProtocol" : case "com.amazonaws.cloudfront#InvalidRequiredProtocol" : response = { ... ( await deserializeAws_restXmlInvalidRequiredProtocolResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResponseCode" : case "com.amazonaws.cloudfront#InvalidResponseCode" : response = { ... ( await deserializeAws_restXmlInvalidResponseCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagging" : case "com.amazonaws.cloudfront#InvalidTagging" : response = { ... ( await deserializeAws_restXmlInvalidTaggingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTTLOrder" : case "com.amazonaws.cloudfront#InvalidTTLOrder" : response = { ... ( await deserializeAws_restXmlInvalidTTLOrderResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidViewerCertificate" : case "com.amazonaws.cloudfront#InvalidViewerCertificate" : response = { ... ( await deserializeAws_restXmlInvalidViewerCertificateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidWebACLId" : case "com.amazonaws.cloudfront#InvalidWebACLId" : response = { ... ( await deserializeAws_restXmlInvalidWebACLIdResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOrigin" : case "com.amazonaws.cloudfront#NoSuchOrigin" : response = { ... ( await deserializeAws_restXmlNoSuchOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RealtimeLogConfigOwnerMismatch" : case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch" : response = { ... ( await deserializeAws_restXmlRealtimeLogConfigOwnerMismatchResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCacheBehaviors" : case "com.amazonaws.cloudfront#TooManyCacheBehaviors" : response = { ... ( await deserializeAws_restXmlTooManyCacheBehaviorsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCertificates" : case "com.amazonaws.cloudfront#TooManyCertificates" : response = { ... ( await deserializeAws_restXmlTooManyCertificatesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookieNamesInWhiteList" : case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList" : response = { ... ( await deserializeAws_restXmlTooManyCookieNamesInWhiteListResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyDistributionCNAMEsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributions" : case "com.amazonaws.cloudfront#TooManyDistributions" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToCachePolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToKeyGroup" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToKeyGroupResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToResponseHeadersPolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithLambdaAssociations" : case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithLambdaAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithSingleFunctionARN" : case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithSingleFunctionARNResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInForwardedValues" : case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInForwardedValuesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyKeyGroupsAssociatedToDistribution" : case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution" : response = { ... ( await deserializeAws_restXmlTooManyKeyGroupsAssociatedToDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyLambdaFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyLambdaFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginCustomHeaders" : case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders" : response = { ... ( await deserializeAws_restXmlTooManyOriginCustomHeadersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginGroupsPerDistribution" : case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution" : response = { ... ( await deserializeAws_restXmlTooManyOriginGroupsPerDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOrigins" : case "com.amazonaws.cloudfront#TooManyOrigins" : response = { ... ( await deserializeAws_restXmlTooManyOriginsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringParameters" : case "com.amazonaws.cloudfront#TooManyQueryStringParameters" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringParametersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTrustedSigners" : case "com.amazonaws.cloudfront#TooManyTrustedSigners" : response = { ... ( await deserializeAws_restXmlTooManyTrustedSignersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedKeyGroupDoesNotExist" : case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedKeyGroupDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedSignerDoesNotExist" : case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedSignerDoesNotExistResponse ( 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_restXmlCreateFieldLevelEncryptionConfigCommand = async ( output , context ) : Promise < CreateFieldLevelEncryptionConfigCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateFieldLevelEncryptionConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryption : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryption = deserializeAws_restXmlFieldLevelEncryption ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateFieldLevelEncryptionConfigCommandError = async ( output , context ) : Promise < CreateFieldLevelEncryptionConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "FieldLevelEncryptionConfigAlreadyExists" : case "com.amazonaws.cloudfront#FieldLevelEncryptionConfigAlreadyExists" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionConfigAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionProfile" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "QueryArgProfileEmpty" : case "com.amazonaws.cloudfront#QueryArgProfileEmpty" : response = { ... ( await deserializeAws_restXmlQueryArgProfileEmptyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionConfigs" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionConfigs" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionConfigsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionContentTypeProfiles" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionContentTypeProfilesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionQueryArgProfiles" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionQueryArgProfilesResponse ( 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_restXmlCreateFieldLevelEncryptionProfileCommand = async ( output , context ) : Promise < CreateFieldLevelEncryptionProfileCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateFieldLevelEncryptionProfileCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryptionProfile : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionProfile = deserializeAws_restXmlFieldLevelEncryptionProfile ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateFieldLevelEncryptionProfileCommandError = async ( output , context ) : Promise < CreateFieldLevelEncryptionProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "FieldLevelEncryptionProfileAlreadyExists" : case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionProfileAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FieldLevelEncryptionProfileSizeExceeded" : case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionProfileSizeExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchPublicKey" : case "com.amazonaws.cloudfront#NoSuchPublicKey" : response = { ... ( await deserializeAws_restXmlNoSuchPublicKeyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionEncryptionEntities" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionEncryptionEntitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionFieldPatterns" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionFieldPatternsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionProfiles" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionProfiles" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionProfilesResponse ( 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_restXmlCreateFunctionCommand = async ( output , context ) : Promise < CreateFunctionCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FunctionSummary : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FunctionSummary = deserializeAws_restXmlFunctionSummary ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateFunctionCommandError = async ( output , context ) : Promise < CreateFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "FunctionAlreadyExists" : case "com.amazonaws.cloudfront#FunctionAlreadyExists" : response = { ... ( await deserializeAws_restXmlFunctionAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FunctionSizeLimitExceeded" : case "com.amazonaws.cloudfront#FunctionSizeLimitExceeded" : response = { ... ( await deserializeAws_restXmlFunctionSizeLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFunctions" : case "com.amazonaws.cloudfront#TooManyFunctions" : response = { ... ( await deserializeAws_restXmlTooManyFunctionsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlCreateInvalidationCommand = async ( output , context ) : Promise < CreateInvalidationCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateInvalidationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Invalidation : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Invalidation = deserializeAws_restXmlInvalidation ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateInvalidationCommandError = async ( output , context ) : Promise < CreateInvalidationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "BatchTooLarge" : case "com.amazonaws.cloudfront#BatchTooLarge" : response = { ... ( await deserializeAws_restXmlBatchTooLargeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyInvalidationsInProgress" : case "com.amazonaws.cloudfront#TooManyInvalidationsInProgress" : response = { ... ( await deserializeAws_restXmlTooManyInvalidationsInProgressResponse ( 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_restXmlCreateKeyGroupCommand = async ( output , context ) : Promise < CreateKeyGroupCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateKeyGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , KeyGroup : undefined , Location : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . KeyGroup = deserializeAws_restXmlKeyGroup ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateKeyGroupCommandError = async ( output , context ) : Promise < CreateKeyGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KeyGroupAlreadyExists" : case "com.amazonaws.cloudfront#KeyGroupAlreadyExists" : response = { ... ( await deserializeAws_restXmlKeyGroupAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyKeyGroups" : case "com.amazonaws.cloudfront#TooManyKeyGroups" : response = { ... ( await deserializeAws_restXmlTooManyKeyGroupsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyPublicKeysInKeyGroup" : case "com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup" : response = { ... ( await deserializeAws_restXmlTooManyPublicKeysInKeyGroupResponse ( 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_restXmlCreateMonitoringSubscriptionCommand = async ( output , context ) : Promise < CreateMonitoringSubscriptionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateMonitoringSubscriptionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , MonitoringSubscription : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . MonitoringSubscription = deserializeAws_restXmlMonitoringSubscription ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateMonitoringSubscriptionCommandError = async ( output , context ) : Promise < CreateMonitoringSubscriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlCreateOriginRequestPolicyCommand = async ( output , context ) : Promise < CreateOriginRequestPolicyCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateOriginRequestPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , Location : undefined , OriginRequestPolicy : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . OriginRequestPolicy = deserializeAws_restXmlOriginRequestPolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateOriginRequestPolicyCommandError = async ( output , context ) : Promise < CreateOriginRequestPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OriginRequestPolicyAlreadyExists" : case "com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists" : response = { ... ( await deserializeAws_restXmlOriginRequestPolicyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookiesInOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyCookiesInOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginRequestPolicies" : case "com.amazonaws.cloudfront#TooManyOriginRequestPolicies" : response = { ... ( await deserializeAws_restXmlTooManyOriginRequestPoliciesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringsInOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringsInOriginRequestPolicyResponse ( 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_restXmlCreatePublicKeyCommand = async ( output , context ) : Promise < CreatePublicKeyCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreatePublicKeyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , Location : undefined , PublicKey : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . PublicKey = deserializeAws_restXmlPublicKey ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreatePublicKeyCommandError = async ( output , context ) : Promise < CreatePublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PublicKeyAlreadyExists" : case "com.amazonaws.cloudfront#PublicKeyAlreadyExists" : response = { ... ( await deserializeAws_restXmlPublicKeyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyPublicKeys" : case "com.amazonaws.cloudfront#TooManyPublicKeys" : response = { ... ( await deserializeAws_restXmlTooManyPublicKeysResponse ( 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_restXmlCreateRealtimeLogConfigCommand = async ( output , context ) : Promise < CreateRealtimeLogConfigCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateRealtimeLogConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RealtimeLogConfig : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data [ "RealtimeLogConfig" ] !== undefined ) { contents . RealtimeLogConfig = deserializeAws_restXmlRealtimeLogConfig ( data [ "RealtimeLogConfig" ] , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateRealtimeLogConfigCommandError = async ( output , context ) : Promise < CreateRealtimeLogConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RealtimeLogConfigAlreadyExists" : case "com.amazonaws.cloudfront#RealtimeLogConfigAlreadyExists" : response = { ... ( await deserializeAws_restXmlRealtimeLogConfigAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRealtimeLogConfigs" : case "com.amazonaws.cloudfront#TooManyRealtimeLogConfigs" : response = { ... ( await deserializeAws_restXmlTooManyRealtimeLogConfigsResponse ( 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_restXmlCreateResponseHeadersPolicyCommand = async ( output , context ) : Promise < CreateResponseHeadersPolicyCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateResponseHeadersPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , Location : undefined , ResponseHeadersPolicy : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . ResponseHeadersPolicy = deserializeAws_restXmlResponseHeadersPolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateResponseHeadersPolicyCommandError = async ( output , context ) : Promise < CreateResponseHeadersPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResponseHeadersPolicyAlreadyExists" : case "com.amazonaws.cloudfront#ResponseHeadersPolicyAlreadyExists" : response = { ... ( await deserializeAws_restXmlResponseHeadersPolicyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCustomHeadersInResponseHeadersPolicy" : case "com.amazonaws.cloudfront#TooManyCustomHeadersInResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlTooManyCustomHeadersInResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyResponseHeadersPolicies" : case "com.amazonaws.cloudfront#TooManyResponseHeadersPolicies" : response = { ... ( await deserializeAws_restXmlTooManyResponseHeadersPoliciesResponse ( 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_restXmlCreateStreamingDistributionCommand = async ( output , context ) : Promise < CreateStreamingDistributionCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateStreamingDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , Location : undefined , StreamingDistribution : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . StreamingDistribution = deserializeAws_restXmlStreamingDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateStreamingDistributionCommandError = async ( output , context ) : Promise < CreateStreamingDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CNAMEAlreadyExists" : case "com.amazonaws.cloudfront#CNAMEAlreadyExists" : response = { ... ( await deserializeAws_restXmlCNAMEAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOrigin" : case "com.amazonaws.cloudfront#InvalidOrigin" : response = { ... ( await deserializeAws_restXmlInvalidOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginAccessIdentity" : case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlInvalidOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StreamingDistributionAlreadyExists" : case "com.amazonaws.cloudfront#StreamingDistributionAlreadyExists" : response = { ... ( await deserializeAws_restXmlStreamingDistributionAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyStreamingDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyStreamingDistributionCNAMEsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyStreamingDistributions" : case "com.amazonaws.cloudfront#TooManyStreamingDistributions" : response = { ... ( await deserializeAws_restXmlTooManyStreamingDistributionsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTrustedSigners" : case "com.amazonaws.cloudfront#TooManyTrustedSigners" : response = { ... ( await deserializeAws_restXmlTooManyTrustedSignersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedSignerDoesNotExist" : case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedSignerDoesNotExistResponse ( 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_restXmlCreateStreamingDistributionWithTagsCommand = async ( output , context ) : Promise < CreateStreamingDistributionWithTagsCommandOutput > => { if ( output . statusCode !== 201 && output . statusCode >= 300 ) { return deserializeAws_restXmlCreateStreamingDistributionWithTagsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , Location : undefined , StreamingDistribution : undefined , } ; if ( output . headers [ "location" ] !== undefined ) { contents . Location = output . headers [ "location" ] ; } if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . StreamingDistribution = deserializeAws_restXmlStreamingDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlCreateStreamingDistributionWithTagsCommandError = async ( output , context ) : Promise < CreateStreamingDistributionWithTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CNAMEAlreadyExists" : case "com.amazonaws.cloudfront#CNAMEAlreadyExists" : response = { ... ( await deserializeAws_restXmlCNAMEAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOrigin" : case "com.amazonaws.cloudfront#InvalidOrigin" : response = { ... ( await deserializeAws_restXmlInvalidOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginAccessIdentity" : case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlInvalidOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagging" : case "com.amazonaws.cloudfront#InvalidTagging" : response = { ... ( await deserializeAws_restXmlInvalidTaggingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StreamingDistributionAlreadyExists" : case "com.amazonaws.cloudfront#StreamingDistributionAlreadyExists" : response = { ... ( await deserializeAws_restXmlStreamingDistributionAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyStreamingDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyStreamingDistributionCNAMEsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyStreamingDistributions" : case "com.amazonaws.cloudfront#TooManyStreamingDistributions" : response = { ... ( await deserializeAws_restXmlTooManyStreamingDistributionsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTrustedSigners" : case "com.amazonaws.cloudfront#TooManyTrustedSigners" : response = { ... ( await deserializeAws_restXmlTooManyTrustedSignersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedSignerDoesNotExist" : case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedSignerDoesNotExistResponse ( 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_restXmlDeleteCachePolicyCommand = async ( output , context ) : Promise < DeleteCachePolicyCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteCachePolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteCachePolicyCommandError = async ( output , context ) : Promise < DeleteCachePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CachePolicyInUse" : case "com.amazonaws.cloudfront#CachePolicyInUse" : response = { ... ( await deserializeAws_restXmlCachePolicyInUseResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalDelete" : case "com.amazonaws.cloudfront#IllegalDelete" : response = { ... ( await deserializeAws_restXmlIllegalDeleteResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlDeleteCloudFrontOriginAccessIdentityCommand = async ( output , context ) : Promise < DeleteCloudFrontOriginAccessIdentityCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteCloudFrontOriginAccessIdentityCommandError = async ( output , context ) : Promise < DeleteCloudFrontOriginAccessIdentityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CloudFrontOriginAccessIdentityInUse" : case "com.amazonaws.cloudfront#CloudFrontOriginAccessIdentityInUse" : response = { ... ( await deserializeAws_restXmlCloudFrontOriginAccessIdentityInUseResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCloudFrontOriginAccessIdentity" : case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlNoSuchCloudFrontOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlDeleteDistributionCommand = async ( output , context ) : Promise < DeleteDistributionCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteDistributionCommandError = async ( output , context ) : Promise < DeleteDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DistributionNotDisabled" : case "com.amazonaws.cloudfront#DistributionNotDisabled" : response = { ... ( await deserializeAws_restXmlDistributionNotDisabledResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlDeleteFieldLevelEncryptionConfigCommand = async ( output , context ) : Promise < DeleteFieldLevelEncryptionConfigCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteFieldLevelEncryptionConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteFieldLevelEncryptionConfigCommandError = async ( output , context ) : Promise < DeleteFieldLevelEncryptionConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FieldLevelEncryptionConfigInUse" : case "com.amazonaws.cloudfront#FieldLevelEncryptionConfigInUse" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionConfigInUseResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlDeleteFieldLevelEncryptionProfileCommand = async ( output , context ) : Promise < DeleteFieldLevelEncryptionProfileCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteFieldLevelEncryptionProfileCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteFieldLevelEncryptionProfileCommandError = async ( output , context ) : Promise < DeleteFieldLevelEncryptionProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FieldLevelEncryptionProfileInUse" : case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileInUse" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionProfileInUseResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionProfile" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlDeleteFunctionCommand = async ( output , context ) : Promise < DeleteFunctionCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteFunctionCommandError = async ( output , context ) : Promise < DeleteFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "FunctionInUse" : case "com.amazonaws.cloudfront#FunctionInUse" : response = { ... ( await deserializeAws_restXmlFunctionInUseResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFunctionExists" : case "com.amazonaws.cloudfront#NoSuchFunctionExists" : response = { ... ( await deserializeAws_restXmlNoSuchFunctionExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlDeleteKeyGroupCommand = async ( output , context ) : Promise < DeleteKeyGroupCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteKeyGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteKeyGroupCommandError = async ( output , context ) : Promise < DeleteKeyGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceInUse" : case "com.amazonaws.cloudfront#ResourceInUse" : response = { ... ( await deserializeAws_restXmlResourceInUseResponse ( 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_restXmlDeleteMonitoringSubscriptionCommand = async ( output , context ) : Promise < DeleteMonitoringSubscriptionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteMonitoringSubscriptionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteMonitoringSubscriptionCommandError = async ( output , context ) : Promise < DeleteMonitoringSubscriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlDeleteOriginRequestPolicyCommand = async ( output , context ) : Promise < DeleteOriginRequestPolicyCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteOriginRequestPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteOriginRequestPolicyCommandError = async ( output , context ) : Promise < DeleteOriginRequestPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalDelete" : case "com.amazonaws.cloudfront#IllegalDelete" : response = { ... ( await deserializeAws_restXmlIllegalDeleteResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OriginRequestPolicyInUse" : case "com.amazonaws.cloudfront#OriginRequestPolicyInUse" : response = { ... ( await deserializeAws_restXmlOriginRequestPolicyInUseResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlDeletePublicKeyCommand = async ( output , context ) : Promise < DeletePublicKeyCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeletePublicKeyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeletePublicKeyCommandError = async ( output , context ) : Promise < DeletePublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchPublicKey" : case "com.amazonaws.cloudfront#NoSuchPublicKey" : response = { ... ( await deserializeAws_restXmlNoSuchPublicKeyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PublicKeyInUse" : case "com.amazonaws.cloudfront#PublicKeyInUse" : response = { ... ( await deserializeAws_restXmlPublicKeyInUseResponse ( 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_restXmlDeleteRealtimeLogConfigCommand = async ( output , context ) : Promise < DeleteRealtimeLogConfigCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteRealtimeLogConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteRealtimeLogConfigCommandError = async ( output , context ) : Promise < DeleteRealtimeLogConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RealtimeLogConfigInUse" : case "com.amazonaws.cloudfront#RealtimeLogConfigInUse" : response = { ... ( await deserializeAws_restXmlRealtimeLogConfigInUseResponse ( 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_restXmlDeleteResponseHeadersPolicyCommand = async ( output , context ) : Promise < DeleteResponseHeadersPolicyCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteResponseHeadersPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteResponseHeadersPolicyCommandError = async ( output , context ) : Promise < DeleteResponseHeadersPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalDelete" : case "com.amazonaws.cloudfront#IllegalDelete" : response = { ... ( await deserializeAws_restXmlIllegalDeleteResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResponseHeadersPolicyInUse" : case "com.amazonaws.cloudfront#ResponseHeadersPolicyInUse" : response = { ... ( await deserializeAws_restXmlResponseHeadersPolicyInUseResponse ( 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_restXmlDeleteStreamingDistributionCommand = async ( output , context ) : Promise < DeleteStreamingDistributionCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlDeleteStreamingDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDeleteStreamingDistributionCommandError = async ( output , context ) : Promise < DeleteStreamingDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchStreamingDistribution" : case "com.amazonaws.cloudfront#NoSuchStreamingDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchStreamingDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StreamingDistributionNotDisabled" : case "com.amazonaws.cloudfront#StreamingDistributionNotDisabled" : response = { ... ( await deserializeAws_restXmlStreamingDistributionNotDisabledResponse ( 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_restXmlDescribeFunctionCommand = async ( output , context ) : Promise < DescribeFunctionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlDescribeFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FunctionSummary : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FunctionSummary = deserializeAws_restXmlFunctionSummary ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlDescribeFunctionCommandError = async ( output , context ) : Promise < DescribeFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchFunctionExists" : case "com.amazonaws.cloudfront#NoSuchFunctionExists" : response = { ... ( await deserializeAws_restXmlNoSuchFunctionExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlGetCachePolicyCommand = async ( output , context ) : Promise < GetCachePolicyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetCachePolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CachePolicy : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CachePolicy = deserializeAws_restXmlCachePolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetCachePolicyCommandError = async ( output , context ) : Promise < GetCachePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( 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_restXmlGetCachePolicyConfigCommand = async ( output , context ) : Promise < GetCachePolicyConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetCachePolicyConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CachePolicyConfig : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CachePolicyConfig = deserializeAws_restXmlCachePolicyConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetCachePolicyConfigCommandError = async ( output , context ) : Promise < GetCachePolicyConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( 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_restXmlGetCloudFrontOriginAccessIdentityCommand = async ( output , context ) : Promise < GetCloudFrontOriginAccessIdentityCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetCloudFrontOriginAccessIdentityCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CloudFrontOriginAccessIdentity : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CloudFrontOriginAccessIdentity = deserializeAws_restXmlCloudFrontOriginAccessIdentity ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetCloudFrontOriginAccessIdentityCommandError = async ( output , context ) : Promise < GetCloudFrontOriginAccessIdentityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCloudFrontOriginAccessIdentity" : case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlNoSuchCloudFrontOriginAccessIdentityResponse ( 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_restXmlGetCloudFrontOriginAccessIdentityConfigCommand = async ( output , context ) : Promise < GetCloudFrontOriginAccessIdentityConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CloudFrontOriginAccessIdentityConfig : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CloudFrontOriginAccessIdentityConfig = deserializeAws_restXmlCloudFrontOriginAccessIdentityConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetCloudFrontOriginAccessIdentityConfigCommandError = async ( output , context ) : Promise < GetCloudFrontOriginAccessIdentityConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCloudFrontOriginAccessIdentity" : case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlNoSuchCloudFrontOriginAccessIdentityResponse ( 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_restXmlGetDistributionCommand = async ( output , context ) : Promise < GetDistributionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Distribution : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Distribution = deserializeAws_restXmlDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetDistributionCommandError = async ( output , context ) : Promise < GetDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( 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_restXmlGetDistributionConfigCommand = async ( output , context ) : Promise < GetDistributionConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetDistributionConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionConfig : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionConfig = deserializeAws_restXmlDistributionConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetDistributionConfigCommandError = async ( output , context ) : Promise < GetDistributionConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( 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_restXmlGetFieldLevelEncryptionCommand = async ( output , context ) : Promise < GetFieldLevelEncryptionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetFieldLevelEncryptionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryption : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryption = deserializeAws_restXmlFieldLevelEncryption ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetFieldLevelEncryptionCommandError = async ( output , context ) : Promise < GetFieldLevelEncryptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( 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_restXmlGetFieldLevelEncryptionConfigCommand = async ( output , context ) : Promise < GetFieldLevelEncryptionConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetFieldLevelEncryptionConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryptionConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionConfig = deserializeAws_restXmlFieldLevelEncryptionConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetFieldLevelEncryptionConfigCommandError = async ( output , context ) : Promise < GetFieldLevelEncryptionConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( 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_restXmlGetFieldLevelEncryptionProfileCommand = async ( output , context ) : Promise < GetFieldLevelEncryptionProfileCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetFieldLevelEncryptionProfileCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryptionProfile : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionProfile = deserializeAws_restXmlFieldLevelEncryptionProfile ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetFieldLevelEncryptionProfileCommandError = async ( output , context ) : Promise < GetFieldLevelEncryptionProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionProfile" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse ( 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_restXmlGetFieldLevelEncryptionProfileConfigCommand = async ( output , context ) : Promise < GetFieldLevelEncryptionProfileConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryptionProfileConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionProfileConfig = deserializeAws_restXmlFieldLevelEncryptionProfileConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetFieldLevelEncryptionProfileConfigCommandError = async ( output , context ) : Promise < GetFieldLevelEncryptionProfileConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionProfile" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse ( 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_restXmlGetFunctionCommand = async ( output , context ) : Promise < GetFunctionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ContentType : undefined , ETag : undefined , FunctionCode : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } if ( output . headers [ "content-type" ] !== undefined ) { contents . ContentType = output . headers [ "content-type" ] ; } const data = await collectBody ( output . body , context ) ; contents . FunctionCode = data ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetFunctionCommandError = async ( output , context ) : Promise < GetFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchFunctionExists" : case "com.amazonaws.cloudfront#NoSuchFunctionExists" : response = { ... ( await deserializeAws_restXmlNoSuchFunctionExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlGetInvalidationCommand = async ( output , context ) : Promise < GetInvalidationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetInvalidationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Invalidation : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Invalidation = deserializeAws_restXmlInvalidation ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetInvalidationCommandError = async ( output , context ) : Promise < GetInvalidationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchInvalidation" : case "com.amazonaws.cloudfront#NoSuchInvalidation" : response = { ... ( await deserializeAws_restXmlNoSuchInvalidationResponse ( 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_restXmlGetKeyGroupCommand = async ( output , context ) : Promise < GetKeyGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetKeyGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , KeyGroup : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . KeyGroup = deserializeAws_restXmlKeyGroup ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetKeyGroupCommandError = async ( output , context ) : Promise < GetKeyGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( 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_restXmlGetKeyGroupConfigCommand = async ( output , context ) : Promise < GetKeyGroupConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetKeyGroupConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , KeyGroupConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . KeyGroupConfig = deserializeAws_restXmlKeyGroupConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetKeyGroupConfigCommandError = async ( output , context ) : Promise < GetKeyGroupConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( 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_restXmlGetMonitoringSubscriptionCommand = async ( output , context ) : Promise < GetMonitoringSubscriptionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetMonitoringSubscriptionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , MonitoringSubscription : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . MonitoringSubscription = deserializeAws_restXmlMonitoringSubscription ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetMonitoringSubscriptionCommandError = async ( output , context ) : Promise < GetMonitoringSubscriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlGetOriginRequestPolicyCommand = async ( output , context ) : Promise < GetOriginRequestPolicyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetOriginRequestPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , OriginRequestPolicy : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . OriginRequestPolicy = deserializeAws_restXmlOriginRequestPolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetOriginRequestPolicyCommandError = async ( output , context ) : Promise < GetOriginRequestPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( 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_restXmlGetOriginRequestPolicyConfigCommand = async ( output , context ) : Promise < GetOriginRequestPolicyConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetOriginRequestPolicyConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , OriginRequestPolicyConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . OriginRequestPolicyConfig = deserializeAws_restXmlOriginRequestPolicyConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetOriginRequestPolicyConfigCommandError = async ( output , context ) : Promise < GetOriginRequestPolicyConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( 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_restXmlGetPublicKeyCommand = async ( output , context ) : Promise < GetPublicKeyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetPublicKeyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , PublicKey : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . PublicKey = deserializeAws_restXmlPublicKey ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetPublicKeyCommandError = async ( output , context ) : Promise < GetPublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchPublicKey" : case "com.amazonaws.cloudfront#NoSuchPublicKey" : response = { ... ( await deserializeAws_restXmlNoSuchPublicKeyResponse ( 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_restXmlGetPublicKeyConfigCommand = async ( output , context ) : Promise < GetPublicKeyConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetPublicKeyConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , PublicKeyConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . PublicKeyConfig = deserializeAws_restXmlPublicKeyConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetPublicKeyConfigCommandError = async ( output , context ) : Promise < GetPublicKeyConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchPublicKey" : case "com.amazonaws.cloudfront#NoSuchPublicKey" : response = { ... ( await deserializeAws_restXmlNoSuchPublicKeyResponse ( 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_restXmlGetRealtimeLogConfigCommand = async ( output , context ) : Promise < GetRealtimeLogConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetRealtimeLogConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RealtimeLogConfig : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data [ "RealtimeLogConfig" ] !== undefined ) { contents . RealtimeLogConfig = deserializeAws_restXmlRealtimeLogConfig ( data [ "RealtimeLogConfig" ] , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetRealtimeLogConfigCommandError = async ( output , context ) : Promise < GetRealtimeLogConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( 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_restXmlGetResponseHeadersPolicyCommand = async ( output , context ) : Promise < GetResponseHeadersPolicyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetResponseHeadersPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , ResponseHeadersPolicy : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . ResponseHeadersPolicy = deserializeAws_restXmlResponseHeadersPolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetResponseHeadersPolicyCommandError = async ( output , context ) : Promise < GetResponseHeadersPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( 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_restXmlGetResponseHeadersPolicyConfigCommand = async ( output , context ) : Promise < GetResponseHeadersPolicyConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetResponseHeadersPolicyConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , ResponseHeadersPolicyConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . ResponseHeadersPolicyConfig = deserializeAws_restXmlResponseHeadersPolicyConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetResponseHeadersPolicyConfigCommandError = async ( output , context ) : Promise < GetResponseHeadersPolicyConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( 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_restXmlGetStreamingDistributionCommand = async ( output , context ) : Promise < GetStreamingDistributionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetStreamingDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , StreamingDistribution : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . StreamingDistribution = deserializeAws_restXmlStreamingDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetStreamingDistributionCommandError = async ( output , context ) : Promise < GetStreamingDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchStreamingDistribution" : case "com.amazonaws.cloudfront#NoSuchStreamingDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchStreamingDistributionResponse ( 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_restXmlGetStreamingDistributionConfigCommand = async ( output , context ) : Promise < GetStreamingDistributionConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlGetStreamingDistributionConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , StreamingDistributionConfig : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . StreamingDistributionConfig = deserializeAws_restXmlStreamingDistributionConfig ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlGetStreamingDistributionConfigCommandError = async ( output , context ) : Promise < GetStreamingDistributionConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchStreamingDistribution" : case "com.amazonaws.cloudfront#NoSuchStreamingDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchStreamingDistributionResponse ( 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_restXmlListCachePoliciesCommand = async ( output , context ) : Promise < ListCachePoliciesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListCachePoliciesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CachePolicyList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CachePolicyList = deserializeAws_restXmlCachePolicyList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListCachePoliciesCommandError = async ( output , context ) : Promise < ListCachePoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( 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_restXmlListCloudFrontOriginAccessIdentitiesCommand = async ( output , context ) : Promise < ListCloudFrontOriginAccessIdentitiesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CloudFrontOriginAccessIdentityList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CloudFrontOriginAccessIdentityList = deserializeAws_restXmlCloudFrontOriginAccessIdentityList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListCloudFrontOriginAccessIdentitiesCommandError = async ( output , context ) : Promise < ListCloudFrontOriginAccessIdentitiesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListConflictingAliasesCommand = async ( output , context ) : Promise < ListConflictingAliasesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListConflictingAliasesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ConflictingAliasesList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . ConflictingAliasesList = deserializeAws_restXmlConflictingAliasesList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListConflictingAliasesCommandError = async ( output , context ) : Promise < ListConflictingAliasesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( 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_restXmlListDistributionsCommand = async ( output , context ) : Promise < ListDistributionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionList = deserializeAws_restXmlDistributionList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsCommandError = async ( output , context ) : Promise < ListDistributionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListDistributionsByCachePolicyIdCommand = async ( output , context ) : Promise < ListDistributionsByCachePolicyIdCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsByCachePolicyIdCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionIdList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionIdList = deserializeAws_restXmlDistributionIdList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsByCachePolicyIdCommandError = async ( output , context ) : Promise < ListDistributionsByCachePolicyIdCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( 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_restXmlListDistributionsByKeyGroupCommand = async ( output , context ) : Promise < ListDistributionsByKeyGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsByKeyGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionIdList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionIdList = deserializeAws_restXmlDistributionIdList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsByKeyGroupCommandError = async ( output , context ) : Promise < ListDistributionsByKeyGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( 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_restXmlListDistributionsByOriginRequestPolicyIdCommand = async ( output , context ) : Promise < ListDistributionsByOriginRequestPolicyIdCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionIdList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionIdList = deserializeAws_restXmlDistributionIdList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsByOriginRequestPolicyIdCommandError = async ( output , context ) : Promise < ListDistributionsByOriginRequestPolicyIdCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( 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_restXmlListDistributionsByRealtimeLogConfigCommand = async ( output , context ) : Promise < ListDistributionsByRealtimeLogConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsByRealtimeLogConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionList = deserializeAws_restXmlDistributionList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsByRealtimeLogConfigCommandError = async ( output , context ) : Promise < ListDistributionsByRealtimeLogConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListDistributionsByResponseHeadersPolicyIdCommand = async ( output , context ) : Promise < ListDistributionsByResponseHeadersPolicyIdCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionIdList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionIdList = deserializeAws_restXmlDistributionIdList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsByResponseHeadersPolicyIdCommandError = async ( output , context ) : Promise < ListDistributionsByResponseHeadersPolicyIdCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( 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_restXmlListDistributionsByWebACLIdCommand = async ( output , context ) : Promise < ListDistributionsByWebACLIdCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListDistributionsByWebACLIdCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DistributionList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . DistributionList = deserializeAws_restXmlDistributionList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListDistributionsByWebACLIdCommandError = async ( output , context ) : Promise < ListDistributionsByWebACLIdCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidWebACLId" : case "com.amazonaws.cloudfront#InvalidWebACLId" : response = { ... ( await deserializeAws_restXmlInvalidWebACLIdResponse ( 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_restXmlListFieldLevelEncryptionConfigsCommand = async ( output , context ) : Promise < ListFieldLevelEncryptionConfigsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListFieldLevelEncryptionConfigsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FieldLevelEncryptionList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionList = deserializeAws_restXmlFieldLevelEncryptionList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListFieldLevelEncryptionConfigsCommandError = async ( output , context ) : Promise < ListFieldLevelEncryptionConfigsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListFieldLevelEncryptionProfilesCommand = async ( output , context ) : Promise < ListFieldLevelEncryptionProfilesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListFieldLevelEncryptionProfilesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FieldLevelEncryptionProfileList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionProfileList = deserializeAws_restXmlFieldLevelEncryptionProfileList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListFieldLevelEncryptionProfilesCommandError = async ( output , context ) : Promise < ListFieldLevelEncryptionProfilesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListFunctionsCommand = async ( output , context ) : Promise < ListFunctionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListFunctionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FunctionList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FunctionList = deserializeAws_restXmlFunctionList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListFunctionsCommandError = async ( output , context ) : Promise < ListFunctionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlListInvalidationsCommand = async ( output , context ) : Promise < ListInvalidationsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListInvalidationsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , InvalidationList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . InvalidationList = deserializeAws_restXmlInvalidationList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListInvalidationsCommandError = async ( output , context ) : Promise < ListInvalidationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( 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_restXmlListKeyGroupsCommand = async ( output , context ) : Promise < ListKeyGroupsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListKeyGroupsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , KeyGroupList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . KeyGroupList = deserializeAws_restXmlKeyGroupList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListKeyGroupsCommandError = async ( output , context ) : Promise < ListKeyGroupsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListOriginRequestPoliciesCommand = async ( output , context ) : Promise < ListOriginRequestPoliciesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListOriginRequestPoliciesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , OriginRequestPolicyList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . OriginRequestPolicyList = deserializeAws_restXmlOriginRequestPolicyList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListOriginRequestPoliciesCommandError = async ( output , context ) : Promise < ListOriginRequestPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( 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_restXmlListPublicKeysCommand = async ( output , context ) : Promise < ListPublicKeysCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListPublicKeysCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , PublicKeyList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . PublicKeyList = deserializeAws_restXmlPublicKeyList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListPublicKeysCommandError = async ( output , context ) : Promise < ListPublicKeysCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListRealtimeLogConfigsCommand = async ( output , context ) : Promise < ListRealtimeLogConfigsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListRealtimeLogConfigsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RealtimeLogConfigs : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . RealtimeLogConfigs = deserializeAws_restXmlRealtimeLogConfigs ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListRealtimeLogConfigsCommandError = async ( output , context ) : Promise < ListRealtimeLogConfigsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( 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_restXmlListResponseHeadersPoliciesCommand = async ( output , context ) : Promise < ListResponseHeadersPoliciesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListResponseHeadersPoliciesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ResponseHeadersPolicyList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . ResponseHeadersPolicyList = deserializeAws_restXmlResponseHeadersPolicyList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListResponseHeadersPoliciesCommandError = async ( output , context ) : Promise < ListResponseHeadersPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( 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_restXmlListStreamingDistributionsCommand = async ( output , context ) : Promise < ListStreamingDistributionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListStreamingDistributionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , StreamingDistributionList : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . StreamingDistributionList = deserializeAws_restXmlStreamingDistributionList ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListStreamingDistributionsCommandError = async ( output , context ) : Promise < ListStreamingDistributionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( 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_restXmlListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlListTagsForResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Tags : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Tags = deserializeAws_restXmlTags ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagging" : case "com.amazonaws.cloudfront#InvalidTagging" : response = { ... ( await deserializeAws_restXmlInvalidTaggingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( 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_restXmlPublishFunctionCommand = async ( output , context ) : Promise < PublishFunctionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlPublishFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FunctionSummary : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FunctionSummary = deserializeAws_restXmlFunctionSummary ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlPublishFunctionCommandError = async ( output , context ) : Promise < PublishFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFunctionExists" : case "com.amazonaws.cloudfront#NoSuchFunctionExists" : response = { ... ( await deserializeAws_restXmlNoSuchFunctionExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlTagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlTagResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlTagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagging" : case "com.amazonaws.cloudfront#InvalidTagging" : response = { ... ( await deserializeAws_restXmlInvalidTaggingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( 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_restXmlTestFunctionCommand = async ( output , context ) : Promise < TestFunctionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlTestFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , TestResult : undefined , } ; const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . TestResult = deserializeAws_restXmlTestResult ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlTestFunctionCommandError = async ( output , context ) : Promise < TestFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFunctionExists" : case "com.amazonaws.cloudfront#NoSuchFunctionExists" : response = { ... ( await deserializeAws_restXmlNoSuchFunctionExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TestFunctionFailed" : case "com.amazonaws.cloudfront#TestFunctionFailed" : response = { ... ( await deserializeAws_restXmlTestFunctionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlUntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode !== 204 && output . statusCode >= 300 ) { return deserializeAws_restXmlUntagResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagging" : case "com.amazonaws.cloudfront#InvalidTagging" : response = { ... ( await deserializeAws_restXmlInvalidTaggingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( 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_restXmlUpdateCachePolicyCommand = async ( output , context ) : Promise < UpdateCachePolicyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateCachePolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CachePolicy : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CachePolicy = deserializeAws_restXmlCachePolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateCachePolicyCommandError = async ( output , context ) : Promise < UpdateCachePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CachePolicyAlreadyExists" : case "com.amazonaws.cloudfront#CachePolicyAlreadyExists" : response = { ... ( await deserializeAws_restXmlCachePolicyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookiesInCachePolicy" : case "com.amazonaws.cloudfront#TooManyCookiesInCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyCookiesInCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInCachePolicy" : case "com.amazonaws.cloudfront#TooManyHeadersInCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringsInCachePolicy" : case "com.amazonaws.cloudfront#TooManyQueryStringsInCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringsInCachePolicyResponse ( 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_restXmlUpdateCloudFrontOriginAccessIdentityCommand = async ( output , context ) : Promise < UpdateCloudFrontOriginAccessIdentityCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , CloudFrontOriginAccessIdentity : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . CloudFrontOriginAccessIdentity = deserializeAws_restXmlCloudFrontOriginAccessIdentity ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateCloudFrontOriginAccessIdentityCommandError = async ( output , context ) : Promise < UpdateCloudFrontOriginAccessIdentityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCloudFrontOriginAccessIdentity" : case "com.amazonaws.cloudfront#NoSuchCloudFrontOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlNoSuchCloudFrontOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlUpdateDistributionCommand = async ( output , context ) : Promise < UpdateDistributionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Distribution : undefined , ETag : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . Distribution = deserializeAws_restXmlDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateDistributionCommandError = async ( output , context ) : Promise < UpdateDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CNAMEAlreadyExists" : case "com.amazonaws.cloudfront#CNAMEAlreadyExists" : response = { ... ( await deserializeAws_restXmlCNAMEAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" : case "com.amazonaws.cloudfront#IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" : response = { ... ( await deserializeAws_restXmlIllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidDefaultRootObject" : case "com.amazonaws.cloudfront#InvalidDefaultRootObject" : response = { ... ( await deserializeAws_restXmlInvalidDefaultRootObjectResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidErrorCode" : case "com.amazonaws.cloudfront#InvalidErrorCode" : response = { ... ( await deserializeAws_restXmlInvalidErrorCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidForwardCookies" : case "com.amazonaws.cloudfront#InvalidForwardCookies" : response = { ... ( await deserializeAws_restXmlInvalidForwardCookiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFunctionAssociation" : case "com.amazonaws.cloudfront#InvalidFunctionAssociation" : response = { ... ( await deserializeAws_restXmlInvalidFunctionAssociationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidGeoRestrictionParameter" : case "com.amazonaws.cloudfront#InvalidGeoRestrictionParameter" : response = { ... ( await deserializeAws_restXmlInvalidGeoRestrictionParameterResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidHeadersForS3Origin" : case "com.amazonaws.cloudfront#InvalidHeadersForS3Origin" : response = { ... ( await deserializeAws_restXmlInvalidHeadersForS3OriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaFunctionAssociation" : case "com.amazonaws.cloudfront#InvalidLambdaFunctionAssociation" : response = { ... ( await deserializeAws_restXmlInvalidLambdaFunctionAssociationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLocationCode" : case "com.amazonaws.cloudfront#InvalidLocationCode" : response = { ... ( await deserializeAws_restXmlInvalidLocationCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidMinimumProtocolVersion" : case "com.amazonaws.cloudfront#InvalidMinimumProtocolVersion" : response = { ... ( await deserializeAws_restXmlInvalidMinimumProtocolVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginAccessIdentity" : case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlInvalidOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginKeepaliveTimeout" : case "com.amazonaws.cloudfront#InvalidOriginKeepaliveTimeout" : response = { ... ( await deserializeAws_restXmlInvalidOriginKeepaliveTimeoutResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginReadTimeout" : case "com.amazonaws.cloudfront#InvalidOriginReadTimeout" : response = { ... ( await deserializeAws_restXmlInvalidOriginReadTimeoutResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidQueryStringParameters" : case "com.amazonaws.cloudfront#InvalidQueryStringParameters" : response = { ... ( await deserializeAws_restXmlInvalidQueryStringParametersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRelativePath" : case "com.amazonaws.cloudfront#InvalidRelativePath" : response = { ... ( await deserializeAws_restXmlInvalidRelativePathResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequiredProtocol" : case "com.amazonaws.cloudfront#InvalidRequiredProtocol" : response = { ... ( await deserializeAws_restXmlInvalidRequiredProtocolResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResponseCode" : case "com.amazonaws.cloudfront#InvalidResponseCode" : response = { ... ( await deserializeAws_restXmlInvalidResponseCodeResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTTLOrder" : case "com.amazonaws.cloudfront#InvalidTTLOrder" : response = { ... ( await deserializeAws_restXmlInvalidTTLOrderResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidViewerCertificate" : case "com.amazonaws.cloudfront#InvalidViewerCertificate" : response = { ... ( await deserializeAws_restXmlInvalidViewerCertificateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidWebACLId" : case "com.amazonaws.cloudfront#InvalidWebACLId" : response = { ... ( await deserializeAws_restXmlInvalidWebACLIdResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchCachePolicy" : case "com.amazonaws.cloudfront#NoSuchCachePolicy" : response = { ... ( await deserializeAws_restXmlNoSuchCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchDistribution" : case "com.amazonaws.cloudfront#NoSuchDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOrigin" : case "com.amazonaws.cloudfront#NoSuchOrigin" : response = { ... ( await deserializeAws_restXmlNoSuchOriginResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RealtimeLogConfigOwnerMismatch" : case "com.amazonaws.cloudfront#RealtimeLogConfigOwnerMismatch" : response = { ... ( await deserializeAws_restXmlRealtimeLogConfigOwnerMismatchResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCacheBehaviors" : case "com.amazonaws.cloudfront#TooManyCacheBehaviors" : response = { ... ( await deserializeAws_restXmlTooManyCacheBehaviorsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCertificates" : case "com.amazonaws.cloudfront#TooManyCertificates" : response = { ... ( await deserializeAws_restXmlTooManyCertificatesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookieNamesInWhiteList" : case "com.amazonaws.cloudfront#TooManyCookieNamesInWhiteList" : response = { ... ( await deserializeAws_restXmlTooManyCookieNamesInWhiteListResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyDistributionCNAMEsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToCachePolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToCachePolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToCachePolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToKeyGroup" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToKeyGroup" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToKeyGroupResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsAssociatedToResponseHeadersPolicy" : case "com.amazonaws.cloudfront#TooManyDistributionsAssociatedToResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsAssociatedToResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyDistributionsWithFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithLambdaAssociations" : case "com.amazonaws.cloudfront#TooManyDistributionsWithLambdaAssociations" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithLambdaAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyDistributionsWithSingleFunctionARN" : case "com.amazonaws.cloudfront#TooManyDistributionsWithSingleFunctionARN" : response = { ... ( await deserializeAws_restXmlTooManyDistributionsWithSingleFunctionARNResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInForwardedValues" : case "com.amazonaws.cloudfront#TooManyHeadersInForwardedValues" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInForwardedValuesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyKeyGroupsAssociatedToDistribution" : case "com.amazonaws.cloudfront#TooManyKeyGroupsAssociatedToDistribution" : response = { ... ( await deserializeAws_restXmlTooManyKeyGroupsAssociatedToDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyLambdaFunctionAssociations" : case "com.amazonaws.cloudfront#TooManyLambdaFunctionAssociations" : response = { ... ( await deserializeAws_restXmlTooManyLambdaFunctionAssociationsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginCustomHeaders" : case "com.amazonaws.cloudfront#TooManyOriginCustomHeaders" : response = { ... ( await deserializeAws_restXmlTooManyOriginCustomHeadersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOriginGroupsPerDistribution" : case "com.amazonaws.cloudfront#TooManyOriginGroupsPerDistribution" : response = { ... ( await deserializeAws_restXmlTooManyOriginGroupsPerDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyOrigins" : case "com.amazonaws.cloudfront#TooManyOrigins" : response = { ... ( await deserializeAws_restXmlTooManyOriginsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringParameters" : case "com.amazonaws.cloudfront#TooManyQueryStringParameters" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringParametersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTrustedSigners" : case "com.amazonaws.cloudfront#TooManyTrustedSigners" : response = { ... ( await deserializeAws_restXmlTooManyTrustedSignersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedKeyGroupDoesNotExist" : case "com.amazonaws.cloudfront#TrustedKeyGroupDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedKeyGroupDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedSignerDoesNotExist" : case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedSignerDoesNotExistResponse ( 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_restXmlUpdateFieldLevelEncryptionConfigCommand = async ( output , context ) : Promise < UpdateFieldLevelEncryptionConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateFieldLevelEncryptionConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryption : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryption = deserializeAws_restXmlFieldLevelEncryption ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateFieldLevelEncryptionConfigCommandError = async ( output , context ) : Promise < UpdateFieldLevelEncryptionConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionConfig" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionConfig" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionProfile" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "QueryArgProfileEmpty" : case "com.amazonaws.cloudfront#QueryArgProfileEmpty" : response = { ... ( await deserializeAws_restXmlQueryArgProfileEmptyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionContentTypeProfiles" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionContentTypeProfiles" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionContentTypeProfilesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionQueryArgProfiles" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionQueryArgProfiles" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionQueryArgProfilesResponse ( 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_restXmlUpdateFieldLevelEncryptionProfileCommand = async ( output , context ) : Promise < UpdateFieldLevelEncryptionProfileCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateFieldLevelEncryptionProfileCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FieldLevelEncryptionProfile : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FieldLevelEncryptionProfile = deserializeAws_restXmlFieldLevelEncryptionProfile ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateFieldLevelEncryptionProfileCommandError = async ( output , context ) : Promise < UpdateFieldLevelEncryptionProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FieldLevelEncryptionProfileAlreadyExists" : case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileAlreadyExists" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionProfileAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FieldLevelEncryptionProfileSizeExceeded" : case "com.amazonaws.cloudfront#FieldLevelEncryptionProfileSizeExceeded" : response = { ... ( await deserializeAws_restXmlFieldLevelEncryptionProfileSizeExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFieldLevelEncryptionProfile" : case "com.amazonaws.cloudfront#NoSuchFieldLevelEncryptionProfile" : response = { ... ( await deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchPublicKey" : case "com.amazonaws.cloudfront#NoSuchPublicKey" : response = { ... ( await deserializeAws_restXmlNoSuchPublicKeyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionEncryptionEntities" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionEncryptionEntities" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionEncryptionEntitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFieldLevelEncryptionFieldPatterns" : case "com.amazonaws.cloudfront#TooManyFieldLevelEncryptionFieldPatterns" : response = { ... ( await deserializeAws_restXmlTooManyFieldLevelEncryptionFieldPatternsResponse ( 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_restXmlUpdateFunctionCommand = async ( output , context ) : Promise < UpdateFunctionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateFunctionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , FunctionSummary : undefined , } ; if ( output . headers [ "ettag" ] !== undefined ) { contents . ETag = output . headers [ "ettag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . FunctionSummary = deserializeAws_restXmlFunctionSummary ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateFunctionCommandError = async ( output , context ) : Promise < UpdateFunctionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "FunctionSizeLimitExceeded" : case "com.amazonaws.cloudfront#FunctionSizeLimitExceeded" : response = { ... ( await deserializeAws_restXmlFunctionSizeLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchFunctionExists" : case "com.amazonaws.cloudfront#NoSuchFunctionExists" : response = { ... ( await deserializeAws_restXmlNoSuchFunctionExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperation" : case "com.amazonaws.cloudfront#UnsupportedOperation" : response = { ... ( await deserializeAws_restXmlUnsupportedOperationResponse ( 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_restXmlUpdateKeyGroupCommand = async ( output , context ) : Promise < UpdateKeyGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateKeyGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , KeyGroup : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . KeyGroup = deserializeAws_restXmlKeyGroup ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateKeyGroupCommandError = async ( output , context ) : Promise < UpdateKeyGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KeyGroupAlreadyExists" : case "com.amazonaws.cloudfront#KeyGroupAlreadyExists" : response = { ... ( await deserializeAws_restXmlKeyGroupAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResource" : case "com.amazonaws.cloudfront#NoSuchResource" : response = { ... ( await deserializeAws_restXmlNoSuchResourceResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyPublicKeysInKeyGroup" : case "com.amazonaws.cloudfront#TooManyPublicKeysInKeyGroup" : response = { ... ( await deserializeAws_restXmlTooManyPublicKeysInKeyGroupResponse ( 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_restXmlUpdateOriginRequestPolicyCommand = async ( output , context ) : Promise < UpdateOriginRequestPolicyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateOriginRequestPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , OriginRequestPolicy : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . OriginRequestPolicy = deserializeAws_restXmlOriginRequestPolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateOriginRequestPolicyCommandError = async ( output , context ) : Promise < UpdateOriginRequestPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchOriginRequestPolicy" : case "com.amazonaws.cloudfront#NoSuchOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OriginRequestPolicyAlreadyExists" : case "com.amazonaws.cloudfront#OriginRequestPolicyAlreadyExists" : response = { ... ( await deserializeAws_restXmlOriginRequestPolicyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCookiesInOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyCookiesInOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyCookiesInOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyHeadersInOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyHeadersInOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyHeadersInOriginRequestPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyQueryStringsInOriginRequestPolicy" : case "com.amazonaws.cloudfront#TooManyQueryStringsInOriginRequestPolicy" : response = { ... ( await deserializeAws_restXmlTooManyQueryStringsInOriginRequestPolicyResponse ( 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_restXmlUpdatePublicKeyCommand = async ( output , context ) : Promise < UpdatePublicKeyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdatePublicKeyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , PublicKey : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . PublicKey = deserializeAws_restXmlPublicKey ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdatePublicKeyCommandError = async ( output , context ) : Promise < UpdatePublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CannotChangeImmutablePublicKeyFields" : case "com.amazonaws.cloudfront#CannotChangeImmutablePublicKeyFields" : response = { ... ( await deserializeAws_restXmlCannotChangeImmutablePublicKeyFieldsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchPublicKey" : case "com.amazonaws.cloudfront#NoSuchPublicKey" : response = { ... ( await deserializeAws_restXmlNoSuchPublicKeyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( 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_restXmlUpdateRealtimeLogConfigCommand = async ( output , context ) : Promise < UpdateRealtimeLogConfigCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateRealtimeLogConfigCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RealtimeLogConfig : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data [ "RealtimeLogConfig" ] !== undefined ) { contents . RealtimeLogConfig = deserializeAws_restXmlRealtimeLogConfig ( data [ "RealtimeLogConfig" ] , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateRealtimeLogConfigCommandError = async ( output , context ) : Promise < UpdateRealtimeLogConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchRealtimeLogConfig" : case "com.amazonaws.cloudfront#NoSuchRealtimeLogConfig" : response = { ... ( await deserializeAws_restXmlNoSuchRealtimeLogConfigResponse ( 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_restXmlUpdateResponseHeadersPolicyCommand = async ( output , context ) : Promise < UpdateResponseHeadersPolicyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateResponseHeadersPolicyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , ResponseHeadersPolicy : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . ResponseHeadersPolicy = deserializeAws_restXmlResponseHeadersPolicy ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateResponseHeadersPolicyCommandError = async ( output , context ) : Promise < UpdateResponseHeadersPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchResponseHeadersPolicy" : case "com.amazonaws.cloudfront#NoSuchResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResponseHeadersPolicyAlreadyExists" : case "com.amazonaws.cloudfront#ResponseHeadersPolicyAlreadyExists" : response = { ... ( await deserializeAws_restXmlResponseHeadersPolicyAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyCustomHeadersInResponseHeadersPolicy" : case "com.amazonaws.cloudfront#TooManyCustomHeadersInResponseHeadersPolicy" : response = { ... ( await deserializeAws_restXmlTooManyCustomHeadersInResponseHeadersPolicyResponse ( 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_restXmlUpdateStreamingDistributionCommand = async ( output , context ) : Promise < UpdateStreamingDistributionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restXmlUpdateStreamingDistributionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ETag : undefined , StreamingDistribution : undefined , } ; if ( output . headers [ "etag" ] !== undefined ) { contents . ETag = output . headers [ "etag" ] ; } const data = __expectObject ( await parseBody ( output . body , context ) ) ; contents . StreamingDistribution = deserializeAws_restXmlStreamingDistribution ( data , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restXmlUpdateStreamingDistributionCommandError = async ( output , context ) : Promise < UpdateStreamingDistributionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestXmlErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDenied" : case "com.amazonaws.cloudfront#AccessDenied" : response = { ... ( await deserializeAws_restXmlAccessDeniedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CNAMEAlreadyExists" : case "com.amazonaws.cloudfront#CNAMEAlreadyExists" : response = { ... ( await deserializeAws_restXmlCNAMEAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IllegalUpdate" : case "com.amazonaws.cloudfront#IllegalUpdate" : response = { ... ( await deserializeAws_restXmlIllegalUpdateResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InconsistentQuantities" : case "com.amazonaws.cloudfront#InconsistentQuantities" : response = { ... ( await deserializeAws_restXmlInconsistentQuantitiesResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArgument" : case "com.amazonaws.cloudfront#InvalidArgument" : response = { ... ( await deserializeAws_restXmlInvalidArgumentResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidIfMatchVersion" : case "com.amazonaws.cloudfront#InvalidIfMatchVersion" : response = { ... ( await deserializeAws_restXmlInvalidIfMatchVersionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOriginAccessIdentity" : case "com.amazonaws.cloudfront#InvalidOriginAccessIdentity" : response = { ... ( await deserializeAws_restXmlInvalidOriginAccessIdentityResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingBody" : case "com.amazonaws.cloudfront#MissingBody" : response = { ... ( await deserializeAws_restXmlMissingBodyResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchStreamingDistribution" : case "com.amazonaws.cloudfront#NoSuchStreamingDistribution" : response = { ... ( await deserializeAws_restXmlNoSuchStreamingDistributionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionFailed" : case "com.amazonaws.cloudfront#PreconditionFailed" : response = { ... ( await deserializeAws_restXmlPreconditionFailedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyStreamingDistributionCNAMEs" : case "com.amazonaws.cloudfront#TooManyStreamingDistributionCNAMEs" : response = { ... ( await deserializeAws_restXmlTooManyStreamingDistributionCNAMEsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTrustedSigners" : case "com.amazonaws.cloudfront#TooManyTrustedSigners" : response = { ... ( await deserializeAws_restXmlTooManyTrustedSignersResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TrustedSignerDoesNotExist" : case "com.amazonaws.cloudfront#TrustedSignerDoesNotExist" : response = { ... ( await deserializeAws_restXmlTrustedSignerDoesNotExistResponse ( 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_restXmlAccessDeniedResponse = async ( parsedOutput , context ) : Promise < AccessDenied > => { const contents = { name : "AccessDenied" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlBatchTooLargeResponse = async ( parsedOutput , context ) : Promise < BatchTooLarge > => { const contents = { name : "BatchTooLarge" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < CachePolicyAlreadyExists > => { const contents = { name : "CachePolicyAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyInUseResponse = async ( parsedOutput , context ) : Promise < CachePolicyInUse > => { const contents = { name : "CachePolicyInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlCannotChangeImmutablePublicKeyFieldsResponse = async ( parsedOutput , context ) : Promise < CannotChangeImmutablePublicKeyFields > => { const contents = { name : "CannotChangeImmutablePublicKeyFields" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentityAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < CloudFrontOriginAccessIdentityAlreadyExists > => { const contents = { name : "CloudFrontOriginAccessIdentityAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentityInUseResponse = async ( parsedOutput , context ) : Promise < CloudFrontOriginAccessIdentityInUse > => { const contents = { name : "CloudFrontOriginAccessIdentityInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlCNAMEAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < CNAMEAlreadyExists > => { const contents = { name : "CNAMEAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlDistributionAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < DistributionAlreadyExists > => { const contents = { name : "DistributionAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlDistributionNotDisabledResponse = async ( parsedOutput , context ) : Promise < DistributionNotDisabled > => { const contents = { name : "DistributionNotDisabled" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionConfigAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < FieldLevelEncryptionConfigAlreadyExists > => { const contents = { name : "FieldLevelEncryptionConfigAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionConfigInUseResponse = async ( parsedOutput , context ) : Promise < FieldLevelEncryptionConfigInUse > => { const contents = { name : "FieldLevelEncryptionConfigInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < FieldLevelEncryptionProfileAlreadyExists > => { const contents = { name : "FieldLevelEncryptionProfileAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileInUseResponse = async ( parsedOutput , context ) : Promise < FieldLevelEncryptionProfileInUse > => { const contents = { name : "FieldLevelEncryptionProfileInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileSizeExceededResponse = async ( parsedOutput , context ) : Promise < FieldLevelEncryptionProfileSizeExceeded > => { const contents = { name : "FieldLevelEncryptionProfileSizeExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFunctionAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < FunctionAlreadyExists > => { const contents = { name : "FunctionAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFunctionInUseResponse = async ( parsedOutput , context ) : Promise < FunctionInUse > => { const contents = { name : "FunctionInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlFunctionSizeLimitExceededResponse = async ( parsedOutput , context ) : Promise < FunctionSizeLimitExceeded > => { const contents = { name : "FunctionSizeLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlIllegalDeleteResponse = async ( parsedOutput , context ) : Promise < IllegalDelete > => { const contents = { name : "IllegalDelete" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlIllegalFieldLevelEncryptionConfigAssociationWithCacheBehaviorResponse = async ( parsedOutput , context ) : Promise < IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior > => { const contents = { name : "IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlIllegalUpdateResponse = async ( parsedOutput , context ) : Promise < IllegalUpdate > => { const contents = { name : "IllegalUpdate" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInconsistentQuantitiesResponse = async ( parsedOutput , context ) : Promise < InconsistentQuantities > => { const contents = { name : "InconsistentQuantities" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidArgumentResponse = async ( parsedOutput , context ) : Promise < InvalidArgument > => { const contents = { name : "InvalidArgument" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidDefaultRootObjectResponse = async ( parsedOutput , context ) : Promise < InvalidDefaultRootObject > => { const contents = { name : "InvalidDefaultRootObject" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidErrorCodeResponse = async ( parsedOutput , context ) : Promise < InvalidErrorCode > => { const contents = { name : "InvalidErrorCode" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidForwardCookiesResponse = async ( parsedOutput , context ) : Promise < InvalidForwardCookies > => { const contents = { name : "InvalidForwardCookies" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidFunctionAssociationResponse = async ( parsedOutput , context ) : Promise < InvalidFunctionAssociation > => { const contents = { name : "InvalidFunctionAssociation" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidGeoRestrictionParameterResponse = async ( parsedOutput , context ) : Promise < InvalidGeoRestrictionParameter > => { const contents = { name : "InvalidGeoRestrictionParameter" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidHeadersForS3OriginResponse = async ( parsedOutput , context ) : Promise < InvalidHeadersForS3Origin > => { const contents = { name : "InvalidHeadersForS3Origin" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidIfMatchVersionResponse = async ( parsedOutput , context ) : Promise < InvalidIfMatchVersion > => { const contents = { name : "InvalidIfMatchVersion" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidLambdaFunctionAssociationResponse = async ( parsedOutput , context ) : Promise < InvalidLambdaFunctionAssociation > => { const contents = { name : "InvalidLambdaFunctionAssociation" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidLocationCodeResponse = async ( parsedOutput , context ) : Promise < InvalidLocationCode > => { const contents = { name : "InvalidLocationCode" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidMinimumProtocolVersionResponse = async ( parsedOutput , context ) : Promise < InvalidMinimumProtocolVersion > => { const contents = { name : "InvalidMinimumProtocolVersion" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidOriginResponse = async ( parsedOutput , context ) : Promise < InvalidOrigin > => { const contents = { name : "InvalidOrigin" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidOriginAccessIdentityResponse = async ( parsedOutput , context ) : Promise < InvalidOriginAccessIdentity > => { const contents = { name : "InvalidOriginAccessIdentity" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidOriginKeepaliveTimeoutResponse = async ( parsedOutput , context ) : Promise < InvalidOriginKeepaliveTimeout > => { const contents = { name : "InvalidOriginKeepaliveTimeout" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidOriginReadTimeoutResponse = async ( parsedOutput , context ) : Promise < InvalidOriginReadTimeout > => { const contents = { name : "InvalidOriginReadTimeout" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidProtocolSettingsResponse = async ( parsedOutput , context ) : Promise < InvalidProtocolSettings > => { const contents = { name : "InvalidProtocolSettings" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidQueryStringParametersResponse = async ( parsedOutput , context ) : Promise < InvalidQueryStringParameters > => { const contents = { name : "InvalidQueryStringParameters" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidRelativePathResponse = async ( parsedOutput , context ) : Promise < InvalidRelativePath > => { const contents = { name : "InvalidRelativePath" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidRequiredProtocolResponse = async ( parsedOutput , context ) : Promise < InvalidRequiredProtocol > => { const contents = { name : "InvalidRequiredProtocol" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidResponseCodeResponse = async ( parsedOutput , context ) : Promise < InvalidResponseCode > => { const contents = { name : "InvalidResponseCode" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidTaggingResponse = async ( parsedOutput , context ) : Promise < InvalidTagging > => { const contents = { name : "InvalidTagging" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidTTLOrderResponse = async ( parsedOutput , context ) : Promise < InvalidTTLOrder > => { const contents = { name : "InvalidTTLOrder" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidViewerCertificateResponse = async ( parsedOutput , context ) : Promise < InvalidViewerCertificate > => { const contents = { name : "InvalidViewerCertificate" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidWebACLIdResponse = async ( parsedOutput , context ) : Promise < InvalidWebACLId > => { const contents = { name : "InvalidWebACLId" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlKeyGroupAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < KeyGroupAlreadyExists > => { const contents = { name : "KeyGroupAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlMissingBodyResponse = async ( parsedOutput , context ) : Promise < MissingBody > => { const contents = { name : "MissingBody" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchCachePolicyResponse = async ( parsedOutput , context ) : Promise < NoSuchCachePolicy > => { const contents = { name : "NoSuchCachePolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchCloudFrontOriginAccessIdentityResponse = async ( parsedOutput , context ) : Promise < NoSuchCloudFrontOriginAccessIdentity > => { const contents = { name : "NoSuchCloudFrontOriginAccessIdentity" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchDistributionResponse = async ( parsedOutput , context ) : Promise < NoSuchDistribution > => { const contents = { name : "NoSuchDistribution" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchFieldLevelEncryptionConfigResponse = async ( parsedOutput , context ) : Promise < NoSuchFieldLevelEncryptionConfig > => { const contents = { name : "NoSuchFieldLevelEncryptionConfig" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchFieldLevelEncryptionProfileResponse = async ( parsedOutput , context ) : Promise < NoSuchFieldLevelEncryptionProfile > => { const contents = { name : "NoSuchFieldLevelEncryptionProfile" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchFunctionExistsResponse = async ( parsedOutput , context ) : Promise < NoSuchFunctionExists > => { const contents = { name : "NoSuchFunctionExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchInvalidationResponse = async ( parsedOutput , context ) : Promise < NoSuchInvalidation > => { const contents = { name : "NoSuchInvalidation" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchOriginResponse = async ( parsedOutput , context ) : Promise < NoSuchOrigin > => { const contents = { name : "NoSuchOrigin" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchOriginRequestPolicyResponse = async ( parsedOutput , context ) : Promise < NoSuchOriginRequestPolicy > => { const contents = { name : "NoSuchOriginRequestPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchPublicKeyResponse = async ( parsedOutput , context ) : Promise < NoSuchPublicKey > => { const contents = { name : "NoSuchPublicKey" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchRealtimeLogConfigResponse = async ( parsedOutput , context ) : Promise < NoSuchRealtimeLogConfig > => { const contents = { name : "NoSuchRealtimeLogConfig" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchResourceResponse = async ( parsedOutput , context ) : Promise < NoSuchResource > => { const contents = { name : "NoSuchResource" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchResponseHeadersPolicyResponse = async ( parsedOutput , context ) : Promise < NoSuchResponseHeadersPolicy > => { const contents = { name : "NoSuchResponseHeadersPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlNoSuchStreamingDistributionResponse = async ( parsedOutput , context ) : Promise < NoSuchStreamingDistribution > => { const contents = { name : "NoSuchStreamingDistribution" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < OriginRequestPolicyAlreadyExists > => { const contents = { name : "OriginRequestPolicyAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyInUseResponse = async ( parsedOutput , context ) : Promise < OriginRequestPolicyInUse > => { const contents = { name : "OriginRequestPolicyInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlPreconditionFailedResponse = async ( parsedOutput , context ) : Promise < PreconditionFailed > => { const contents = { name : "PreconditionFailed" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlPublicKeyAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < PublicKeyAlreadyExists > => { const contents = { name : "PublicKeyAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlPublicKeyInUseResponse = async ( parsedOutput , context ) : Promise < PublicKeyInUse > => { const contents = { name : "PublicKeyInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlQueryArgProfileEmptyResponse = async ( parsedOutput , context ) : Promise < QueryArgProfileEmpty > => { const contents = { name : "QueryArgProfileEmpty" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlRealtimeLogConfigAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < RealtimeLogConfigAlreadyExists > => { const contents = { name : "RealtimeLogConfigAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlRealtimeLogConfigInUseResponse = async ( parsedOutput , context ) : Promise < RealtimeLogConfigInUse > => { const contents = { name : "RealtimeLogConfigInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlRealtimeLogConfigOwnerMismatchResponse = async ( parsedOutput , context ) : Promise < RealtimeLogConfigOwnerMismatch > => { const contents = { name : "RealtimeLogConfigOwnerMismatch" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlResourceInUseResponse = async ( parsedOutput , context ) : Promise < ResourceInUse > => { const contents = { name : "ResourceInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < ResponseHeadersPolicyAlreadyExists > => { const contents = { name : "ResponseHeadersPolicyAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyInUseResponse = async ( parsedOutput , context ) : Promise < ResponseHeadersPolicyInUse > => { const contents = { name : "ResponseHeadersPolicyInUse" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistributionAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < StreamingDistributionAlreadyExists > => { const contents = { name : "StreamingDistributionAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistributionNotDisabledResponse = async ( parsedOutput , context ) : Promise < StreamingDistributionNotDisabled > => { const contents = { name : "StreamingDistributionNotDisabled" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTestFunctionFailedResponse = async ( parsedOutput , context ) : Promise < TestFunctionFailed > => { const contents = { name : "TestFunctionFailed" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCacheBehaviorsResponse = async ( parsedOutput , context ) : Promise < TooManyCacheBehaviors > => { const contents = { name : "TooManyCacheBehaviors" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCachePoliciesResponse = async ( parsedOutput , context ) : Promise < TooManyCachePolicies > => { const contents = { name : "TooManyCachePolicies" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCertificatesResponse = async ( parsedOutput , context ) : Promise < TooManyCertificates > => { const contents = { name : "TooManyCertificates" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCloudFrontOriginAccessIdentitiesResponse = async ( parsedOutput , context ) : Promise < TooManyCloudFrontOriginAccessIdentities > => { const contents = { name : "TooManyCloudFrontOriginAccessIdentities" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCookieNamesInWhiteListResponse = async ( parsedOutput , context ) : Promise < TooManyCookieNamesInWhiteList > => { const contents = { name : "TooManyCookieNamesInWhiteList" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCookiesInCachePolicyResponse = async ( parsedOutput , context ) : Promise < TooManyCookiesInCachePolicy > => { const contents = { name : "TooManyCookiesInCachePolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCookiesInOriginRequestPolicyResponse = async ( parsedOutput , context ) : Promise < TooManyCookiesInOriginRequestPolicy > => { const contents = { name : "TooManyCookiesInOriginRequestPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyCustomHeadersInResponseHeadersPolicyResponse = async ( parsedOutput , context ) : Promise < TooManyCustomHeadersInResponseHeadersPolicy > => { const contents = { name : "TooManyCustomHeadersInResponseHeadersPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionCNAMEsResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionCNAMEs > => { const contents = { name : "TooManyDistributionCNAMEs" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsResponse = async ( parsedOutput , context ) : Promise < TooManyDistributions > => { const contents = { name : "TooManyDistributions" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsAssociatedToCachePolicyResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsAssociatedToCachePolicy > => { const contents = { name : "TooManyDistributionsAssociatedToCachePolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsAssociatedToFieldLevelEncryptionConfigResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsAssociatedToFieldLevelEncryptionConfig > => { const contents = { name : "TooManyDistributionsAssociatedToFieldLevelEncryptionConfig" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsAssociatedToKeyGroupResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsAssociatedToKeyGroup > => { const contents = { name : "TooManyDistributionsAssociatedToKeyGroup" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsAssociatedToOriginRequestPolicyResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsAssociatedToOriginRequestPolicy > => { const contents = { name : "TooManyDistributionsAssociatedToOriginRequestPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsAssociatedToResponseHeadersPolicyResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsAssociatedToResponseHeadersPolicy > => { const contents = { name : "TooManyDistributionsAssociatedToResponseHeadersPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsWithFunctionAssociationsResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsWithFunctionAssociations > => { const contents = { name : "TooManyDistributionsWithFunctionAssociations" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsWithLambdaAssociationsResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsWithLambdaAssociations > => { const contents = { name : "TooManyDistributionsWithLambdaAssociations" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyDistributionsWithSingleFunctionARNResponse = async ( parsedOutput , context ) : Promise < TooManyDistributionsWithSingleFunctionARN > => { const contents = { name : "TooManyDistributionsWithSingleFunctionARN" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFieldLevelEncryptionConfigsResponse = async ( parsedOutput , context ) : Promise < TooManyFieldLevelEncryptionConfigs > => { const contents = { name : "TooManyFieldLevelEncryptionConfigs" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFieldLevelEncryptionContentTypeProfilesResponse = async ( parsedOutput , context ) : Promise < TooManyFieldLevelEncryptionContentTypeProfiles > => { const contents = { name : "TooManyFieldLevelEncryptionContentTypeProfiles" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFieldLevelEncryptionEncryptionEntitiesResponse = async ( parsedOutput , context ) : Promise < TooManyFieldLevelEncryptionEncryptionEntities > => { const contents = { name : "TooManyFieldLevelEncryptionEncryptionEntities" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFieldLevelEncryptionFieldPatternsResponse = async ( parsedOutput , context ) : Promise < TooManyFieldLevelEncryptionFieldPatterns > => { const contents = { name : "TooManyFieldLevelEncryptionFieldPatterns" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFieldLevelEncryptionProfilesResponse = async ( parsedOutput , context ) : Promise < TooManyFieldLevelEncryptionProfiles > => { const contents = { name : "TooManyFieldLevelEncryptionProfiles" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFieldLevelEncryptionQueryArgProfilesResponse = async ( parsedOutput , context ) : Promise < TooManyFieldLevelEncryptionQueryArgProfiles > => { const contents = { name : "TooManyFieldLevelEncryptionQueryArgProfiles" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFunctionAssociationsResponse = async ( parsedOutput , context ) : Promise < TooManyFunctionAssociations > => { const contents = { name : "TooManyFunctionAssociations" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyFunctionsResponse = async ( parsedOutput , context ) : Promise < TooManyFunctions > => { const contents = { name : "TooManyFunctions" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyHeadersInCachePolicyResponse = async ( parsedOutput , context ) : Promise < TooManyHeadersInCachePolicy > => { const contents = { name : "TooManyHeadersInCachePolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyHeadersInForwardedValuesResponse = async ( parsedOutput , context ) : Promise < TooManyHeadersInForwardedValues > => { const contents = { name : "TooManyHeadersInForwardedValues" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyHeadersInOriginRequestPolicyResponse = async ( parsedOutput , context ) : Promise < TooManyHeadersInOriginRequestPolicy > => { const contents = { name : "TooManyHeadersInOriginRequestPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyInvalidationsInProgressResponse = async ( parsedOutput , context ) : Promise < TooManyInvalidationsInProgress > => { const contents = { name : "TooManyInvalidationsInProgress" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyKeyGroupsResponse = async ( parsedOutput , context ) : Promise < TooManyKeyGroups > => { const contents = { name : "TooManyKeyGroups" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyKeyGroupsAssociatedToDistributionResponse = async ( parsedOutput , context ) : Promise < TooManyKeyGroupsAssociatedToDistribution > => { const contents = { name : "TooManyKeyGroupsAssociatedToDistribution" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyLambdaFunctionAssociationsResponse = async ( parsedOutput , context ) : Promise < TooManyLambdaFunctionAssociations > => { const contents = { name : "TooManyLambdaFunctionAssociations" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyOriginCustomHeadersResponse = async ( parsedOutput , context ) : Promise < TooManyOriginCustomHeaders > => { const contents = { name : "TooManyOriginCustomHeaders" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyOriginGroupsPerDistributionResponse = async ( parsedOutput , context ) : Promise < TooManyOriginGroupsPerDistribution > => { const contents = { name : "TooManyOriginGroupsPerDistribution" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyOriginRequestPoliciesResponse = async ( parsedOutput , context ) : Promise < TooManyOriginRequestPolicies > => { const contents = { name : "TooManyOriginRequestPolicies" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyOriginsResponse = async ( parsedOutput , context ) : Promise < TooManyOrigins > => { const contents = { name : "TooManyOrigins" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyPublicKeysResponse = async ( parsedOutput , context ) : Promise < TooManyPublicKeys > => { const contents = { name : "TooManyPublicKeys" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyPublicKeysInKeyGroupResponse = async ( parsedOutput , context ) : Promise < TooManyPublicKeysInKeyGroup > => { const contents = { name : "TooManyPublicKeysInKeyGroup" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyQueryStringParametersResponse = async ( parsedOutput , context ) : Promise < TooManyQueryStringParameters > => { const contents = { name : "TooManyQueryStringParameters" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyQueryStringsInCachePolicyResponse = async ( parsedOutput , context ) : Promise < TooManyQueryStringsInCachePolicy > => { const contents = { name : "TooManyQueryStringsInCachePolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyQueryStringsInOriginRequestPolicyResponse = async ( parsedOutput , context ) : Promise < TooManyQueryStringsInOriginRequestPolicy > => { const contents = { name : "TooManyQueryStringsInOriginRequestPolicy" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyRealtimeLogConfigsResponse = async ( parsedOutput , context ) : Promise < TooManyRealtimeLogConfigs > => { const contents = { name : "TooManyRealtimeLogConfigs" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyResponseHeadersPoliciesResponse = async ( parsedOutput , context ) : Promise < TooManyResponseHeadersPolicies > => { const contents = { name : "TooManyResponseHeadersPolicies" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyStreamingDistributionCNAMEsResponse = async ( parsedOutput , context ) : Promise < TooManyStreamingDistributionCNAMEs > => { const contents = { name : "TooManyStreamingDistributionCNAMEs" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyStreamingDistributionsResponse = async ( parsedOutput , context ) : Promise < TooManyStreamingDistributions > => { const contents = { name : "TooManyStreamingDistributions" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTooManyTrustedSignersResponse = async ( parsedOutput , context ) : Promise < TooManyTrustedSigners > => { const contents = { name : "TooManyTrustedSigners" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTrustedKeyGroupDoesNotExistResponse = async ( parsedOutput , context ) : Promise < TrustedKeyGroupDoesNotExist > => { const contents = { name : "TrustedKeyGroupDoesNotExist" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlTrustedSignerDoesNotExistResponse = async ( parsedOutput , context ) : Promise < TrustedSignerDoesNotExist > => { const contents = { name : "TrustedSignerDoesNotExist" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const deserializeAws_restXmlUnsupportedOperationResponse = async ( parsedOutput , context ) : Promise < UnsupportedOperation > => { const contents = { name : "UnsupportedOperation" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , } ; const data = parsedOutput . body . Error ; if ( data [ "Message" ] !== undefined ) { contents . Message = __expectString ( data [ "Message" ] ) ; } return contents ; } ; const serializeAws_restXmlAccessControlAllowHeadersList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Header" ) ; } ) ; } ; const serializeAws_restXmlAccessControlAllowMethodsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "ResponseHeadersPolicyAccessControlAllowMethodsValues" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Method" ) ; } ) ; } ; const serializeAws_restXmlAccessControlAllowOriginsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Origin" ) ; } ) ; } ; const serializeAws_restXmlAccessControlExposeHeadersList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Header" ) ; } ) ; } ; const serializeAws_restXmlAliases = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Aliases" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlAliasList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlAliasList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "CNAME" ) ; } ) ; } ; const serializeAws_restXmlAllowedMethods = ( input , context ) : any => { const bodyNode = new __XmlNode ( "AllowedMethods" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlMethodsList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } if ( input . CachedMethods !== undefined && input . CachedMethods !== null ) { const node = serializeAws_restXmlCachedMethods ( input . CachedMethods , context ) . withName ( "CachedMethods" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlAwsAccountNumberList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "AwsAccountNumber" ) ; } ) ; } ; const serializeAws_restXmlCacheBehavior = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CacheBehavior" ) ; if ( input . PathPattern !== undefined && input . PathPattern !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . PathPattern ) ) . withName ( "PathPattern" ) ; bodyNode . addChildNode ( node ) ; } if ( input . TargetOriginId !== undefined && input . TargetOriginId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . TargetOriginId ) ) . withName ( "TargetOriginId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . TrustedSigners !== undefined && input . TrustedSigners !== null ) { const node = serializeAws_restXmlTrustedSigners ( input . TrustedSigners , context ) . withName ( "TrustedSigners" ) ; bodyNode . addChildNode ( node ) ; } if ( input . TrustedKeyGroups !== undefined && input . TrustedKeyGroups !== null ) { const node = serializeAws_restXmlTrustedKeyGroups ( input . TrustedKeyGroups , context ) . withName ( "TrustedKeyGroups" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ViewerProtocolPolicy !== undefined && input . ViewerProtocolPolicy !== null ) { const node = new __XmlNode ( "ViewerProtocolPolicy" ) . addChildNode ( new __XmlText ( input . ViewerProtocolPolicy ) ) . withName ( "ViewerProtocolPolicy" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AllowedMethods !== undefined && input . AllowedMethods !== null ) { const node = serializeAws_restXmlAllowedMethods ( input . AllowedMethods , context ) . withName ( "AllowedMethods" ) ; bodyNode . addChildNode ( node ) ; } if ( input . SmoothStreaming !== undefined && input . SmoothStreaming !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . SmoothStreaming ) ) ) . withName ( "SmoothStreaming" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Compress !== undefined && input . Compress !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Compress ) ) ) . withName ( "Compress" ) ; bodyNode . addChildNode ( node ) ; } if ( input . LambdaFunctionAssociations !== undefined && input . LambdaFunctionAssociations !== null ) { const node = serializeAws_restXmlLambdaFunctionAssociations ( input . LambdaFunctionAssociations , context ) . withName ( "LambdaFunctionAssociations" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FunctionAssociations !== undefined && input . FunctionAssociations !== null ) { const node = serializeAws_restXmlFunctionAssociations ( input . FunctionAssociations , context ) . withName ( "FunctionAssociations" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FieldLevelEncryptionId !== undefined && input . FieldLevelEncryptionId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . FieldLevelEncryptionId ) ) . withName ( "FieldLevelEncryptionId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . RealtimeLogConfigArn !== undefined && input . RealtimeLogConfigArn !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . RealtimeLogConfigArn ) ) . withName ( "RealtimeLogConfigArn" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CachePolicyId !== undefined && input . CachePolicyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CachePolicyId ) ) . withName ( "CachePolicyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginRequestPolicyId !== undefined && input . OriginRequestPolicyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . OriginRequestPolicyId ) ) . withName ( "OriginRequestPolicyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ResponseHeadersPolicyId !== undefined && input . ResponseHeadersPolicyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ResponseHeadersPolicyId ) ) . withName ( "ResponseHeadersPolicyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ForwardedValues !== undefined && input . ForwardedValues !== null ) { const node = serializeAws_restXmlForwardedValues ( input . ForwardedValues , context ) . withName ( "ForwardedValues" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MinTTL !== undefined && input . MinTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . MinTTL ) ) ) . withName ( "MinTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . DefaultTTL !== undefined && input . DefaultTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . DefaultTTL ) ) ) . withName ( "DefaultTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MaxTTL !== undefined && input . MaxTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . MaxTTL ) ) ) . withName ( "MaxTTL" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCacheBehaviorList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlCacheBehavior ( entry , context ) ; return node . withName ( "CacheBehavior" ) ; } ) ; } ; const serializeAws_restXmlCacheBehaviors = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CacheBehaviors" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlCacheBehaviorList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlCachedMethods = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CachedMethods" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlMethodsList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlCachePolicyConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CachePolicyConfig" ) ; if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined && input . Name !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . DefaultTTL !== undefined && input . DefaultTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . DefaultTTL ) ) ) . withName ( "DefaultTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MaxTTL !== undefined && input . MaxTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . MaxTTL ) ) ) . withName ( "MaxTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MinTTL !== undefined && input . MinTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . MinTTL ) ) ) . withName ( "MinTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ParametersInCacheKeyAndForwardedToOrigin !== undefined && input . ParametersInCacheKeyAndForwardedToOrigin !== null ) { const node = serializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin ( input . ParametersInCacheKeyAndForwardedToOrigin , context ) . withName ( "ParametersInCacheKeyAndForwardedToOrigin" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCachePolicyCookiesConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CachePolicyCookiesConfig" ) ; if ( input . CookieBehavior !== undefined && input . CookieBehavior !== null ) { const node = new __XmlNode ( "CachePolicyCookieBehavior" ) . addChildNode ( new __XmlText ( input . CookieBehavior ) ) . withName ( "CookieBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Cookies !== undefined && input . Cookies !== null ) { const node = serializeAws_restXmlCookieNames ( input . Cookies , context ) . withName ( "Cookies" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCachePolicyHeadersConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CachePolicyHeadersConfig" ) ; if ( input . HeaderBehavior !== undefined && input . HeaderBehavior !== null ) { const node = new __XmlNode ( "CachePolicyHeaderBehavior" ) . addChildNode ( new __XmlText ( input . HeaderBehavior ) ) . withName ( "HeaderBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Headers !== undefined && input . Headers !== null ) { const node = serializeAws_restXmlHeaders ( input . Headers , context ) . withName ( "Headers" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCachePolicyQueryStringsConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CachePolicyQueryStringsConfig" ) ; if ( input . QueryStringBehavior !== undefined && input . QueryStringBehavior !== null ) { const node = new __XmlNode ( "CachePolicyQueryStringBehavior" ) . addChildNode ( new __XmlText ( input . QueryStringBehavior ) ) . withName ( "QueryStringBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryStrings !== undefined && input . QueryStrings !== null ) { const node = serializeAws_restXmlQueryStringNames ( input . QueryStrings , context ) . withName ( "QueryStrings" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCloudFrontOriginAccessIdentityConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CloudFrontOriginAccessIdentityConfig" ) ; if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlContentTypeProfile = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ContentTypeProfile" ) ; if ( input . Format !== undefined && input . Format !== null ) { const node = new __XmlNode ( "Format" ) . addChildNode ( new __XmlText ( input . Format ) ) . withName ( "Format" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ProfileId !== undefined && input . ProfileId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ProfileId ) ) . withName ( "ProfileId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ContentType !== undefined && input . ContentType !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ContentType ) ) . withName ( "ContentType" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlContentTypeProfileConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ContentTypeProfileConfig" ) ; if ( input . ForwardWhenContentTypeIsUnknown !== undefined && input . ForwardWhenContentTypeIsUnknown !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . ForwardWhenContentTypeIsUnknown ) ) ) . withName ( "ForwardWhenContentTypeIsUnknown" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ContentTypeProfiles !== undefined && input . ContentTypeProfiles !== null ) { const node = serializeAws_restXmlContentTypeProfiles ( input . ContentTypeProfiles , context ) . withName ( "ContentTypeProfiles" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlContentTypeProfileList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlContentTypeProfile ( entry , context ) ; return node . withName ( "ContentTypeProfile" ) ; } ) ; } ; const serializeAws_restXmlContentTypeProfiles = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ContentTypeProfiles" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlContentTypeProfileList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlCookieNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Name" ) ; } ) ; } ; const serializeAws_restXmlCookieNames = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CookieNames" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlCookieNameList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlCookiePreference = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CookiePreference" ) ; if ( input . Forward !== undefined && input . Forward !== null ) { const node = new __XmlNode ( "ItemSelection" ) . addChildNode ( new __XmlText ( input . Forward ) ) . withName ( "Forward" ) ; bodyNode . addChildNode ( node ) ; } if ( input . WhitelistedNames !== undefined && input . WhitelistedNames !== null ) { const node = serializeAws_restXmlCookieNames ( input . WhitelistedNames , context ) . withName ( "WhitelistedNames" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCustomErrorResponse = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CustomErrorResponse" ) ; if ( input . ErrorCode !== undefined && input . ErrorCode !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . ErrorCode ) ) ) . withName ( "ErrorCode" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ResponsePagePath !== undefined && input . ResponsePagePath !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ResponsePagePath ) ) . withName ( "ResponsePagePath" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ResponseCode !== undefined && input . ResponseCode !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ResponseCode ) ) . withName ( "ResponseCode" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ErrorCachingMinTTL !== undefined && input . ErrorCachingMinTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . ErrorCachingMinTTL ) ) ) . withName ( "ErrorCachingMinTTL" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlCustomErrorResponseList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlCustomErrorResponse ( entry , context ) ; return node . withName ( "CustomErrorResponse" ) ; } ) ; } ; const serializeAws_restXmlCustomErrorResponses = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CustomErrorResponses" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlCustomErrorResponseList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlCustomHeaders = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CustomHeaders" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlOriginCustomHeadersList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlCustomOriginConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "CustomOriginConfig" ) ; if ( input . HTTPPort !== undefined && input . HTTPPort !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . HTTPPort ) ) ) . withName ( "HTTPPort" ) ; bodyNode . addChildNode ( node ) ; } if ( input . HTTPSPort !== undefined && input . HTTPSPort !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . HTTPSPort ) ) ) . withName ( "HTTPSPort" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginProtocolPolicy !== undefined && input . OriginProtocolPolicy !== null ) { const node = new __XmlNode ( "OriginProtocolPolicy" ) . addChildNode ( new __XmlText ( input . OriginProtocolPolicy ) ) . withName ( "OriginProtocolPolicy" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginSslProtocols !== undefined && input . OriginSslProtocols !== null ) { const node = serializeAws_restXmlOriginSslProtocols ( input . OriginSslProtocols , context ) . withName ( "OriginSslProtocols" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginReadTimeout !== undefined && input . OriginReadTimeout !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . OriginReadTimeout ) ) ) . withName ( "OriginReadTimeout" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginKeepaliveTimeout !== undefined && input . OriginKeepaliveTimeout !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . OriginKeepaliveTimeout ) ) ) . withName ( "OriginKeepaliveTimeout" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlDefaultCacheBehavior = ( input , context ) : any => { const bodyNode = new __XmlNode ( "DefaultCacheBehavior" ) ; if ( input . TargetOriginId !== undefined && input . TargetOriginId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . TargetOriginId ) ) . withName ( "TargetOriginId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . TrustedSigners !== undefined && input . TrustedSigners !== null ) { const node = serializeAws_restXmlTrustedSigners ( input . TrustedSigners , context ) . withName ( "TrustedSigners" ) ; bodyNode . addChildNode ( node ) ; } if ( input . TrustedKeyGroups !== undefined && input . TrustedKeyGroups !== null ) { const node = serializeAws_restXmlTrustedKeyGroups ( input . TrustedKeyGroups , context ) . withName ( "TrustedKeyGroups" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ViewerProtocolPolicy !== undefined && input . ViewerProtocolPolicy !== null ) { const node = new __XmlNode ( "ViewerProtocolPolicy" ) . addChildNode ( new __XmlText ( input . ViewerProtocolPolicy ) ) . withName ( "ViewerProtocolPolicy" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AllowedMethods !== undefined && input . AllowedMethods !== null ) { const node = serializeAws_restXmlAllowedMethods ( input . AllowedMethods , context ) . withName ( "AllowedMethods" ) ; bodyNode . addChildNode ( node ) ; } if ( input . SmoothStreaming !== undefined && input . SmoothStreaming !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . SmoothStreaming ) ) ) . withName ( "SmoothStreaming" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Compress !== undefined && input . Compress !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Compress ) ) ) . withName ( "Compress" ) ; bodyNode . addChildNode ( node ) ; } if ( input . LambdaFunctionAssociations !== undefined && input . LambdaFunctionAssociations !== null ) { const node = serializeAws_restXmlLambdaFunctionAssociations ( input . LambdaFunctionAssociations , context ) . withName ( "LambdaFunctionAssociations" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FunctionAssociations !== undefined && input . FunctionAssociations !== null ) { const node = serializeAws_restXmlFunctionAssociations ( input . FunctionAssociations , context ) . withName ( "FunctionAssociations" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FieldLevelEncryptionId !== undefined && input . FieldLevelEncryptionId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . FieldLevelEncryptionId ) ) . withName ( "FieldLevelEncryptionId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . RealtimeLogConfigArn !== undefined && input . RealtimeLogConfigArn !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . RealtimeLogConfigArn ) ) . withName ( "RealtimeLogConfigArn" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CachePolicyId !== undefined && input . CachePolicyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CachePolicyId ) ) . withName ( "CachePolicyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginRequestPolicyId !== undefined && input . OriginRequestPolicyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . OriginRequestPolicyId ) ) . withName ( "OriginRequestPolicyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ResponseHeadersPolicyId !== undefined && input . ResponseHeadersPolicyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ResponseHeadersPolicyId ) ) . withName ( "ResponseHeadersPolicyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ForwardedValues !== undefined && input . ForwardedValues !== null ) { const node = serializeAws_restXmlForwardedValues ( input . ForwardedValues , context ) . withName ( "ForwardedValues" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MinTTL !== undefined && input . MinTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . MinTTL ) ) ) . withName ( "MinTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . DefaultTTL !== undefined && input . DefaultTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . DefaultTTL ) ) ) . withName ( "DefaultTTL" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MaxTTL !== undefined && input . MaxTTL !== null ) { const node = new __XmlNode ( "long" ) . addChildNode ( new __XmlText ( String ( input . MaxTTL ) ) ) . withName ( "MaxTTL" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlDistributionConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "DistributionConfig" ) ; if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Aliases !== undefined && input . Aliases !== null ) { const node = serializeAws_restXmlAliases ( input . Aliases , context ) . withName ( "Aliases" ) ; bodyNode . addChildNode ( node ) ; } if ( input . DefaultRootObject !== undefined && input . DefaultRootObject !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . DefaultRootObject ) ) . withName ( "DefaultRootObject" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Origins !== undefined && input . Origins !== null ) { const node = serializeAws_restXmlOrigins ( input . Origins , context ) . withName ( "Origins" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginGroups !== undefined && input . OriginGroups !== null ) { const node = serializeAws_restXmlOriginGroups ( input . OriginGroups , context ) . withName ( "OriginGroups" ) ; bodyNode . addChildNode ( node ) ; } if ( input . DefaultCacheBehavior !== undefined && input . DefaultCacheBehavior !== null ) { const node = serializeAws_restXmlDefaultCacheBehavior ( input . DefaultCacheBehavior , context ) . withName ( "DefaultCacheBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CacheBehaviors !== undefined && input . CacheBehaviors !== null ) { const node = serializeAws_restXmlCacheBehaviors ( input . CacheBehaviors , context ) . withName ( "CacheBehaviors" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CustomErrorResponses !== undefined && input . CustomErrorResponses !== null ) { const node = serializeAws_restXmlCustomErrorResponses ( input . CustomErrorResponses , context ) . withName ( "CustomErrorResponses" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "CommentType" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Logging !== undefined && input . Logging !== null ) { const node = serializeAws_restXmlLoggingConfig ( input . Logging , context ) . withName ( "Logging" ) ; bodyNode . addChildNode ( node ) ; } if ( input . PriceClass !== undefined && input . PriceClass !== null ) { const node = new __XmlNode ( "PriceClass" ) . addChildNode ( new __XmlText ( input . PriceClass ) ) . withName ( "PriceClass" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ViewerCertificate !== undefined && input . ViewerCertificate !== null ) { const node = serializeAws_restXmlViewerCertificate ( input . ViewerCertificate , context ) . withName ( "ViewerCertificate" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Restrictions !== undefined && input . Restrictions !== null ) { const node = serializeAws_restXmlRestrictions ( input . Restrictions , context ) . withName ( "Restrictions" ) ; bodyNode . addChildNode ( node ) ; } if ( input . WebACLId !== undefined && input . WebACLId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . WebACLId ) ) . withName ( "WebACLId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . HttpVersion !== undefined && input . HttpVersion !== null ) { const node = new __XmlNode ( "HttpVersion" ) . addChildNode ( new __XmlText ( input . HttpVersion ) ) . withName ( "HttpVersion" ) ; bodyNode . addChildNode ( node ) ; } if ( input . IsIPV6Enabled !== undefined && input . IsIPV6Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . IsIPV6Enabled ) ) ) . withName ( "IsIPV6Enabled" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlDistributionConfigWithTags = ( input , context ) : any => { const bodyNode = new __XmlNode ( "DistributionConfigWithTags" ) ; if ( input . DistributionConfig !== undefined && input . DistributionConfig !== null ) { const node = serializeAws_restXmlDistributionConfig ( input . DistributionConfig , context ) . withName ( "DistributionConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const node = serializeAws_restXmlTags ( input . Tags , context ) . withName ( "Tags" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlEncryptionEntities = ( input , context ) : any => { const bodyNode = new __XmlNode ( "EncryptionEntities" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlEncryptionEntityList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlEncryptionEntity = ( input , context ) : any => { const bodyNode = new __XmlNode ( "EncryptionEntity" ) ; if ( input . PublicKeyId !== undefined && input . PublicKeyId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . PublicKeyId ) ) . withName ( "PublicKeyId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ProviderId !== undefined && input . ProviderId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ProviderId ) ) . withName ( "ProviderId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FieldPatterns !== undefined && input . FieldPatterns !== null ) { const node = serializeAws_restXmlFieldPatterns ( input . FieldPatterns , context ) . withName ( "FieldPatterns" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlEncryptionEntityList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlEncryptionEntity ( entry , context ) ; return node . withName ( "EncryptionEntity" ) ; } ) ; } ; const serializeAws_restXmlEndPoint = ( input , context ) : any => { const bodyNode = new __XmlNode ( "EndPoint" ) ; if ( input . StreamType !== undefined && input . StreamType !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . StreamType ) ) . withName ( "StreamType" ) ; bodyNode . addChildNode ( node ) ; } if ( input . KinesisStreamConfig !== undefined && input . KinesisStreamConfig !== null ) { const node = serializeAws_restXmlKinesisStreamConfig ( input . KinesisStreamConfig , context ) . withName ( "KinesisStreamConfig" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlEndPointList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlEndPoint ( entry , context ) ; return node . withName ( "member" ) ; } ) ; } ; const serializeAws_restXmlFieldLevelEncryptionConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "FieldLevelEncryptionConfig" ) ; if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryArgProfileConfig !== undefined && input . QueryArgProfileConfig !== null ) { const node = serializeAws_restXmlQueryArgProfileConfig ( input . QueryArgProfileConfig , context ) . withName ( "QueryArgProfileConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ContentTypeProfileConfig !== undefined && input . ContentTypeProfileConfig !== null ) { const node = serializeAws_restXmlContentTypeProfileConfig ( input . ContentTypeProfileConfig , context ) . withName ( "ContentTypeProfileConfig" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlFieldLevelEncryptionProfileConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "FieldLevelEncryptionProfileConfig" ) ; if ( input . Name !== undefined && input . Name !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . EncryptionEntities !== undefined && input . EncryptionEntities !== null ) { const node = serializeAws_restXmlEncryptionEntities ( input . EncryptionEntities , context ) . withName ( "EncryptionEntities" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlFieldList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Field" ) ; } ) ; } ; const serializeAws_restXmlFieldPatternList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "FieldPattern" ) ; } ) ; } ; const serializeAws_restXmlFieldPatterns = ( input , context ) : any => { const bodyNode = new __XmlNode ( "FieldPatterns" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlFieldPatternList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlForwardedValues = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ForwardedValues" ) ; if ( input . QueryString !== undefined && input . QueryString !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . QueryString ) ) ) . withName ( "QueryString" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Cookies !== undefined && input . Cookies !== null ) { const node = serializeAws_restXmlCookiePreference ( input . Cookies , context ) . withName ( "Cookies" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Headers !== undefined && input . Headers !== null ) { const node = serializeAws_restXmlHeaders ( input . Headers , context ) . withName ( "Headers" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryStringCacheKeys !== undefined && input . QueryStringCacheKeys !== null ) { const node = serializeAws_restXmlQueryStringCacheKeys ( input . QueryStringCacheKeys , context ) . withName ( "QueryStringCacheKeys" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlFunctionAssociation = ( input , context ) : any => { const bodyNode = new __XmlNode ( "FunctionAssociation" ) ; if ( input . FunctionARN !== undefined && input . FunctionARN !== null ) { const node = new __XmlNode ( "FunctionARN" ) . addChildNode ( new __XmlText ( input . FunctionARN ) ) . withName ( "FunctionARN" ) ; bodyNode . addChildNode ( node ) ; } if ( input . EventType !== undefined && input . EventType !== null ) { const node = new __XmlNode ( "EventType" ) . addChildNode ( new __XmlText ( input . EventType ) ) . withName ( "EventType" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlFunctionAssociationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlFunctionAssociation ( entry , context ) ; return node . withName ( "FunctionAssociation" ) ; } ) ; } ; const serializeAws_restXmlFunctionAssociations = ( input , context ) : any => { const bodyNode = new __XmlNode ( "FunctionAssociations" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlFunctionAssociationList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlFunctionConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "FunctionConfig" ) ; if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Runtime !== undefined && input . Runtime !== null ) { const node = new __XmlNode ( "FunctionRuntime" ) . addChildNode ( new __XmlText ( input . Runtime ) ) . withName ( "Runtime" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlGeoRestriction = ( input , context ) : any => { const bodyNode = new __XmlNode ( "GeoRestriction" ) ; if ( input . RestrictionType !== undefined && input . RestrictionType !== null ) { const node = new __XmlNode ( "GeoRestrictionType" ) . addChildNode ( new __XmlText ( input . RestrictionType ) ) . withName ( "RestrictionType" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlLocationList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlHeaderList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Name" ) ; } ) ; } ; const serializeAws_restXmlHeaders = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Headers" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlHeaderList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlInvalidationBatch = ( input , context ) : any => { const bodyNode = new __XmlNode ( "InvalidationBatch" ) ; if ( input . Paths !== undefined && input . Paths !== null ) { const node = serializeAws_restXmlPaths ( input . Paths , context ) . withName ( "Paths" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlKeyGroupConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "KeyGroupConfig" ) ; if ( input . Name !== undefined && input . Name !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlPublicKeyIdList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlKinesisStreamConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "KinesisStreamConfig" ) ; if ( input . RoleARN !== undefined && input . RoleARN !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . RoleARN ) ) . withName ( "RoleARN" ) ; bodyNode . addChildNode ( node ) ; } if ( input . StreamARN !== undefined && input . StreamARN !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . StreamARN ) ) . withName ( "StreamARN" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlLambdaFunctionAssociation = ( input , context ) : any => { const bodyNode = new __XmlNode ( "LambdaFunctionAssociation" ) ; if ( input . LambdaFunctionARN !== undefined && input . LambdaFunctionARN !== null ) { const node = new __XmlNode ( "LambdaFunctionARN" ) . addChildNode ( new __XmlText ( input . LambdaFunctionARN ) ) . withName ( "LambdaFunctionARN" ) ; bodyNode . addChildNode ( node ) ; } if ( input . EventType !== undefined && input . EventType !== null ) { const node = new __XmlNode ( "EventType" ) . addChildNode ( new __XmlText ( input . EventType ) ) . withName ( "EventType" ) ; bodyNode . addChildNode ( node ) ; } if ( input . IncludeBody !== undefined && input . IncludeBody !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . IncludeBody ) ) ) . withName ( "IncludeBody" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlLambdaFunctionAssociationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlLambdaFunctionAssociation ( entry , context ) ; return node . withName ( "LambdaFunctionAssociation" ) ; } ) ; } ; const serializeAws_restXmlLambdaFunctionAssociations = ( input , context ) : any => { const bodyNode = new __XmlNode ( "LambdaFunctionAssociations" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlLambdaFunctionAssociationList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlLocationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Location" ) ; } ) ; } ; const serializeAws_restXmlLoggingConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "LoggingConfig" ) ; if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } if ( input . IncludeCookies !== undefined && input . IncludeCookies !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . IncludeCookies ) ) ) . withName ( "IncludeCookies" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Bucket !== undefined && input . Bucket !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Bucket ) ) . withName ( "Bucket" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Prefix !== undefined && input . Prefix !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Prefix ) ) . withName ( "Prefix" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlMethodsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "Method" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Method" ) ; } ) ; } ; const serializeAws_restXmlMonitoringSubscription = ( input , context ) : any => { const bodyNode = new __XmlNode ( "MonitoringSubscription" ) ; if ( input . RealtimeMetricsSubscriptionConfig !== undefined && input . RealtimeMetricsSubscriptionConfig !== null ) { const node = serializeAws_restXmlRealtimeMetricsSubscriptionConfig ( input . RealtimeMetricsSubscriptionConfig , context ) . withName ( "RealtimeMetricsSubscriptionConfig" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOrigin = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Origin" ) ; if ( input . Id !== undefined && input . Id !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Id ) ) . withName ( "Id" ) ; bodyNode . addChildNode ( node ) ; } if ( input . DomainName !== undefined && input . DomainName !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . DomainName ) ) . withName ( "DomainName" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginPath !== undefined && input . OriginPath !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . OriginPath ) ) . withName ( "OriginPath" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CustomHeaders !== undefined && input . CustomHeaders !== null ) { const node = serializeAws_restXmlCustomHeaders ( input . CustomHeaders , context ) . withName ( "CustomHeaders" ) ; bodyNode . addChildNode ( node ) ; } if ( input . S3OriginConfig !== undefined && input . S3OriginConfig !== null ) { const node = serializeAws_restXmlS3OriginConfig ( input . S3OriginConfig , context ) . withName ( "S3OriginConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CustomOriginConfig !== undefined && input . CustomOriginConfig !== null ) { const node = serializeAws_restXmlCustomOriginConfig ( input . CustomOriginConfig , context ) . withName ( "CustomOriginConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ConnectionAttempts !== undefined && input . ConnectionAttempts !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . ConnectionAttempts ) ) ) . withName ( "ConnectionAttempts" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ConnectionTimeout !== undefined && input . ConnectionTimeout !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . ConnectionTimeout ) ) ) . withName ( "ConnectionTimeout" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginShield !== undefined && input . OriginShield !== null ) { const node = serializeAws_restXmlOriginShield ( input . OriginShield , context ) . withName ( "OriginShield" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginCustomHeader = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginCustomHeader" ) ; if ( input . HeaderName !== undefined && input . HeaderName !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . HeaderName ) ) . withName ( "HeaderName" ) ; bodyNode . addChildNode ( node ) ; } if ( input . HeaderValue !== undefined && input . HeaderValue !== null ) { const node = new __XmlNode ( "sensitiveStringType" ) . addChildNode ( new __XmlText ( input . HeaderValue ) ) . withName ( "HeaderValue" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginCustomHeadersList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlOriginCustomHeader ( entry , context ) ; return node . withName ( "OriginCustomHeader" ) ; } ) ; } ; const serializeAws_restXmlOriginGroup = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginGroup" ) ; if ( input . Id !== undefined && input . Id !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Id ) ) . withName ( "Id" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FailoverCriteria !== undefined && input . FailoverCriteria !== null ) { const node = serializeAws_restXmlOriginGroupFailoverCriteria ( input . FailoverCriteria , context ) . withName ( "FailoverCriteria" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Members !== undefined && input . Members !== null ) { const node = serializeAws_restXmlOriginGroupMembers ( input . Members , context ) . withName ( "Members" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginGroupFailoverCriteria = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginGroupFailoverCriteria" ) ; if ( input . StatusCodes !== undefined && input . StatusCodes !== null ) { const node = serializeAws_restXmlStatusCodes ( input . StatusCodes , context ) . withName ( "StatusCodes" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginGroupList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlOriginGroup ( entry , context ) ; return node . withName ( "OriginGroup" ) ; } ) ; } ; const serializeAws_restXmlOriginGroupMember = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginGroupMember" ) ; if ( input . OriginId !== undefined && input . OriginId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . OriginId ) ) . withName ( "OriginId" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginGroupMemberList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlOriginGroupMember ( entry , context ) ; return node . withName ( "OriginGroupMember" ) ; } ) ; } ; const serializeAws_restXmlOriginGroupMembers = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginGroupMembers" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlOriginGroupMemberList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginGroups = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginGroups" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlOriginGroupList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlOrigin ( entry , context ) ; return node . withName ( "Origin" ) ; } ) ; } ; const serializeAws_restXmlOriginRequestPolicyConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginRequestPolicyConfig" ) ; if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined && input . Name !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . HeadersConfig !== undefined && input . HeadersConfig !== null ) { const node = serializeAws_restXmlOriginRequestPolicyHeadersConfig ( input . HeadersConfig , context ) . withName ( "HeadersConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CookiesConfig !== undefined && input . CookiesConfig !== null ) { const node = serializeAws_restXmlOriginRequestPolicyCookiesConfig ( input . CookiesConfig , context ) . withName ( "CookiesConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryStringsConfig !== undefined && input . QueryStringsConfig !== null ) { const node = serializeAws_restXmlOriginRequestPolicyQueryStringsConfig ( input . QueryStringsConfig , context ) . withName ( "QueryStringsConfig" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginRequestPolicyCookiesConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginRequestPolicyCookiesConfig" ) ; if ( input . CookieBehavior !== undefined && input . CookieBehavior !== null ) { const node = new __XmlNode ( "OriginRequestPolicyCookieBehavior" ) . addChildNode ( new __XmlText ( input . CookieBehavior ) ) . withName ( "CookieBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Cookies !== undefined && input . Cookies !== null ) { const node = serializeAws_restXmlCookieNames ( input . Cookies , context ) . withName ( "Cookies" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginRequestPolicyHeadersConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginRequestPolicyHeadersConfig" ) ; if ( input . HeaderBehavior !== undefined && input . HeaderBehavior !== null ) { const node = new __XmlNode ( "OriginRequestPolicyHeaderBehavior" ) . addChildNode ( new __XmlText ( input . HeaderBehavior ) ) . withName ( "HeaderBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Headers !== undefined && input . Headers !== null ) { const node = serializeAws_restXmlHeaders ( input . Headers , context ) . withName ( "Headers" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginRequestPolicyQueryStringsConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginRequestPolicyQueryStringsConfig" ) ; if ( input . QueryStringBehavior !== undefined && input . QueryStringBehavior !== null ) { const node = new __XmlNode ( "OriginRequestPolicyQueryStringBehavior" ) . addChildNode ( new __XmlText ( input . QueryStringBehavior ) ) . withName ( "QueryStringBehavior" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryStrings !== undefined && input . QueryStrings !== null ) { const node = serializeAws_restXmlQueryStringNames ( input . QueryStrings , context ) . withName ( "QueryStrings" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOrigins = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Origins" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlOriginList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginShield = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginShield" ) ; if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginShieldRegion !== undefined && input . OriginShieldRegion !== null ) { const node = new __XmlNode ( "OriginShieldRegion" ) . addChildNode ( new __XmlText ( input . OriginShieldRegion ) ) . withName ( "OriginShieldRegion" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlOriginSslProtocols = ( input , context ) : any => { const bodyNode = new __XmlNode ( "OriginSslProtocols" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlSslProtocolsList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ParametersInCacheKeyAndForwardedToOrigin" ) ; if ( input . EnableAcceptEncodingGzip !== undefined && input . EnableAcceptEncodingGzip !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . EnableAcceptEncodingGzip ) ) ) . withName ( "EnableAcceptEncodingGzip" ) ; bodyNode . addChildNode ( node ) ; } if ( input . EnableAcceptEncodingBrotli !== undefined && input . EnableAcceptEncodingBrotli !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . EnableAcceptEncodingBrotli ) ) ) . withName ( "EnableAcceptEncodingBrotli" ) ; bodyNode . addChildNode ( node ) ; } if ( input . HeadersConfig !== undefined && input . HeadersConfig !== null ) { const node = serializeAws_restXmlCachePolicyHeadersConfig ( input . HeadersConfig , context ) . withName ( "HeadersConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CookiesConfig !== undefined && input . CookiesConfig !== null ) { const node = serializeAws_restXmlCachePolicyCookiesConfig ( input . CookiesConfig , context ) . withName ( "CookiesConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryStringsConfig !== undefined && input . QueryStringsConfig !== null ) { const node = serializeAws_restXmlCachePolicyQueryStringsConfig ( input . QueryStringsConfig , context ) . withName ( "QueryStringsConfig" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlPathList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Path" ) ; } ) ; } ; const serializeAws_restXmlPaths = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Paths" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlPathList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlPublicKeyConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "PublicKeyConfig" ) ; if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined && input . Name !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . EncodedKey !== undefined && input . EncodedKey !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . EncodedKey ) ) . withName ( "EncodedKey" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlPublicKeyIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "PublicKey" ) ; } ) ; } ; const serializeAws_restXmlQueryArgProfile = ( input , context ) : any => { const bodyNode = new __XmlNode ( "QueryArgProfile" ) ; if ( input . QueryArg !== undefined && input . QueryArg !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . QueryArg ) ) . withName ( "QueryArg" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ProfileId !== undefined && input . ProfileId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ProfileId ) ) . withName ( "ProfileId" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlQueryArgProfileConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "QueryArgProfileConfig" ) ; if ( input . ForwardWhenQueryArgProfileIsUnknown !== undefined && input . ForwardWhenQueryArgProfileIsUnknown !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . ForwardWhenQueryArgProfileIsUnknown ) ) ) . withName ( "ForwardWhenQueryArgProfileIsUnknown" ) ; bodyNode . addChildNode ( node ) ; } if ( input . QueryArgProfiles !== undefined && input . QueryArgProfiles !== null ) { const node = serializeAws_restXmlQueryArgProfiles ( input . QueryArgProfiles , context ) . withName ( "QueryArgProfiles" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlQueryArgProfileList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlQueryArgProfile ( entry , context ) ; return node . withName ( "QueryArgProfile" ) ; } ) ; } ; const serializeAws_restXmlQueryArgProfiles = ( input , context ) : any => { const bodyNode = new __XmlNode ( "QueryArgProfiles" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlQueryArgProfileList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlQueryStringCacheKeys = ( input , context ) : any => { const bodyNode = new __XmlNode ( "QueryStringCacheKeys" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlQueryStringCacheKeysList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlQueryStringCacheKeysList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Name" ) ; } ) ; } ; const serializeAws_restXmlQueryStringNames = ( input , context ) : any => { const bodyNode = new __XmlNode ( "QueryStringNames" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlQueryStringNamesList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlQueryStringNamesList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Name" ) ; } ) ; } ; const serializeAws_restXmlRealtimeMetricsSubscriptionConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "RealtimeMetricsSubscriptionConfig" ) ; if ( input . RealtimeMetricsSubscriptionStatus !== undefined && input . RealtimeMetricsSubscriptionStatus !== null ) { const node = new __XmlNode ( "RealtimeMetricsSubscriptionStatus" ) . addChildNode ( new __XmlText ( input . RealtimeMetricsSubscriptionStatus ) ) . withName ( "RealtimeMetricsSubscriptionStatus" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyAccessControlAllowHeaders = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyAccessControlAllowHeaders" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlAccessControlAllowHeadersList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyAccessControlAllowMethods = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyAccessControlAllowMethods" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlAccessControlAllowMethodsList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyAccessControlAllowOrigins = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyAccessControlAllowOrigins" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlAccessControlAllowOriginsList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyAccessControlExposeHeaders = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyAccessControlExposeHeaders" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlAccessControlExposeHeadersList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyConfig" ) ; if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Name !== undefined && input . Name !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Name ) ) . withName ( "Name" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CorsConfig !== undefined && input . CorsConfig !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyCorsConfig ( input . CorsConfig , context ) . withName ( "CorsConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . SecurityHeadersConfig !== undefined && input . SecurityHeadersConfig !== null ) { const node = serializeAws_restXmlResponseHeadersPolicySecurityHeadersConfig ( input . SecurityHeadersConfig , context ) . withName ( "SecurityHeadersConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CustomHeadersConfig !== undefined && input . CustomHeadersConfig !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyCustomHeadersConfig ( input . CustomHeadersConfig , context ) . withName ( "CustomHeadersConfig" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyContentSecurityPolicy = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyContentSecurityPolicy" ) ; if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ContentSecurityPolicy !== undefined && input . ContentSecurityPolicy !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ContentSecurityPolicy ) ) . withName ( "ContentSecurityPolicy" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyContentTypeOptions = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyContentTypeOptions" ) ; if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyCorsConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyCorsConfig" ) ; if ( input . AccessControlAllowOrigins !== undefined && input . AccessControlAllowOrigins !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyAccessControlAllowOrigins ( input . AccessControlAllowOrigins , context ) . withName ( "AccessControlAllowOrigins" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AccessControlAllowHeaders !== undefined && input . AccessControlAllowHeaders !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyAccessControlAllowHeaders ( input . AccessControlAllowHeaders , context ) . withName ( "AccessControlAllowHeaders" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AccessControlAllowMethods !== undefined && input . AccessControlAllowMethods !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyAccessControlAllowMethods ( input . AccessControlAllowMethods , context ) . withName ( "AccessControlAllowMethods" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AccessControlAllowCredentials !== undefined && input . AccessControlAllowCredentials !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . AccessControlAllowCredentials ) ) ) . withName ( "AccessControlAllowCredentials" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AccessControlExposeHeaders !== undefined && input . AccessControlExposeHeaders !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyAccessControlExposeHeaders ( input . AccessControlExposeHeaders , context ) . withName ( "AccessControlExposeHeaders" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AccessControlMaxAgeSec !== undefined && input . AccessControlMaxAgeSec !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . AccessControlMaxAgeSec ) ) ) . withName ( "AccessControlMaxAgeSec" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginOverride !== undefined && input . OriginOverride !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . OriginOverride ) ) ) . withName ( "OriginOverride" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyCustomHeader = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyCustomHeader" ) ; if ( input . Header !== undefined && input . Header !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Header ) ) . withName ( "Header" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Value !== undefined && input . Value !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Value ) ) . withName ( "Value" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyCustomHeaderList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlResponseHeadersPolicyCustomHeader ( entry , context ) ; return node . withName ( "ResponseHeadersPolicyCustomHeader" ) ; } ) ; } ; const serializeAws_restXmlResponseHeadersPolicyCustomHeadersConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyCustomHeadersConfig" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlResponseHeadersPolicyCustomHeaderList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyFrameOptions = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyFrameOptions" ) ; if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FrameOption !== undefined && input . FrameOption !== null ) { const node = new __XmlNode ( "FrameOptionsList" ) . addChildNode ( new __XmlText ( input . FrameOption ) ) . withName ( "FrameOption" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyReferrerPolicy = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyReferrerPolicy" ) ; if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ReferrerPolicy !== undefined && input . ReferrerPolicy !== null ) { const node = new __XmlNode ( "ReferrerPolicyList" ) . addChildNode ( new __XmlText ( input . ReferrerPolicy ) ) . withName ( "ReferrerPolicy" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicySecurityHeadersConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicySecurityHeadersConfig" ) ; if ( input . XSSProtection !== undefined && input . XSSProtection !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyXSSProtection ( input . XSSProtection , context ) . withName ( "XSSProtection" ) ; bodyNode . addChildNode ( node ) ; } if ( input . FrameOptions !== undefined && input . FrameOptions !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyFrameOptions ( input . FrameOptions , context ) . withName ( "FrameOptions" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ReferrerPolicy !== undefined && input . ReferrerPolicy !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyReferrerPolicy ( input . ReferrerPolicy , context ) . withName ( "ReferrerPolicy" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ContentSecurityPolicy !== undefined && input . ContentSecurityPolicy !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyContentSecurityPolicy ( input . ContentSecurityPolicy , context ) . withName ( "ContentSecurityPolicy" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ContentTypeOptions !== undefined && input . ContentTypeOptions !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyContentTypeOptions ( input . ContentTypeOptions , context ) . withName ( "ContentTypeOptions" ) ; bodyNode . addChildNode ( node ) ; } if ( input . StrictTransportSecurity !== undefined && input . StrictTransportSecurity !== null ) { const node = serializeAws_restXmlResponseHeadersPolicyStrictTransportSecurity ( input . StrictTransportSecurity , context ) . withName ( "StrictTransportSecurity" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyStrictTransportSecurity = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyStrictTransportSecurity" ) ; if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } if ( input . IncludeSubdomains !== undefined && input . IncludeSubdomains !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . IncludeSubdomains ) ) ) . withName ( "IncludeSubdomains" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Preload !== undefined && input . Preload !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Preload ) ) ) . withName ( "Preload" ) ; bodyNode . addChildNode ( node ) ; } if ( input . AccessControlMaxAgeSec !== undefined && input . AccessControlMaxAgeSec !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . AccessControlMaxAgeSec ) ) ) . withName ( "AccessControlMaxAgeSec" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlResponseHeadersPolicyXSSProtection = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ResponseHeadersPolicyXSSProtection" ) ; if ( input . Override !== undefined && input . Override !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Override ) ) ) . withName ( "Override" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Protection !== undefined && input . Protection !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Protection ) ) ) . withName ( "Protection" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ModeBlock !== undefined && input . ModeBlock !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . ModeBlock ) ) ) . withName ( "ModeBlock" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ReportUri !== undefined && input . ReportUri !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ReportUri ) ) . withName ( "ReportUri" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlRestrictions = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Restrictions" ) ; if ( input . GeoRestriction !== undefined && input . GeoRestriction !== null ) { const node = serializeAws_restXmlGeoRestriction ( input . GeoRestriction , context ) . withName ( "GeoRestriction" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlS3Origin = ( input , context ) : any => { const bodyNode = new __XmlNode ( "S3Origin" ) ; if ( input . DomainName !== undefined && input . DomainName !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . DomainName ) ) . withName ( "DomainName" ) ; bodyNode . addChildNode ( node ) ; } if ( input . OriginAccessIdentity !== undefined && input . OriginAccessIdentity !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . OriginAccessIdentity ) ) . withName ( "OriginAccessIdentity" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlS3OriginConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "S3OriginConfig" ) ; if ( input . OriginAccessIdentity !== undefined && input . OriginAccessIdentity !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . OriginAccessIdentity ) ) . withName ( "OriginAccessIdentity" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlSslProtocolsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "SslProtocol" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "SslProtocol" ) ; } ) ; } ; const serializeAws_restXmlStatusCodeList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( entry ) ) ) ; return node . withName ( "StatusCode" ) ; } ) ; } ; const serializeAws_restXmlStatusCodes = ( input , context ) : any => { const bodyNode = new __XmlNode ( "StatusCodes" ) ; if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlStatusCodeList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlStreamingDistributionConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "StreamingDistributionConfig" ) ; if ( input . CallerReference !== undefined && input . CallerReference !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . CallerReference ) ) . withName ( "CallerReference" ) ; bodyNode . addChildNode ( node ) ; } if ( input . S3Origin !== undefined && input . S3Origin !== null ) { const node = serializeAws_restXmlS3Origin ( input . S3Origin , context ) . withName ( "S3Origin" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Aliases !== undefined && input . Aliases !== null ) { const node = serializeAws_restXmlAliases ( input . Aliases , context ) . withName ( "Aliases" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Comment !== undefined && input . Comment !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Comment ) ) . withName ( "Comment" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Logging !== undefined && input . Logging !== null ) { const node = serializeAws_restXmlStreamingLoggingConfig ( input . Logging , context ) . withName ( "Logging" ) ; bodyNode . addChildNode ( node ) ; } if ( input . TrustedSigners !== undefined && input . TrustedSigners !== null ) { const node = serializeAws_restXmlTrustedSigners ( input . TrustedSigners , context ) . withName ( "TrustedSigners" ) ; bodyNode . addChildNode ( node ) ; } if ( input . PriceClass !== undefined && input . PriceClass !== null ) { const node = new __XmlNode ( "PriceClass" ) . addChildNode ( new __XmlText ( input . PriceClass ) ) . withName ( "PriceClass" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlStreamingDistributionConfigWithTags = ( input , context ) : any => { const bodyNode = new __XmlNode ( "StreamingDistributionConfigWithTags" ) ; if ( input . StreamingDistributionConfig !== undefined && input . StreamingDistributionConfig !== null ) { const node = serializeAws_restXmlStreamingDistributionConfig ( input . StreamingDistributionConfig , context ) . withName ( "StreamingDistributionConfig" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const node = serializeAws_restXmlTags ( input . Tags , context ) . withName ( "Tags" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlStreamingLoggingConfig = ( input , context ) : any => { const bodyNode = new __XmlNode ( "StreamingLoggingConfig" ) ; if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Bucket !== undefined && input . Bucket !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Bucket ) ) . withName ( "Bucket" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Prefix !== undefined && input . Prefix !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Prefix ) ) . withName ( "Prefix" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlTag = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Tag" ) ; if ( input . Key !== undefined && input . Key !== null ) { const node = new __XmlNode ( "TagKey" ) . addChildNode ( new __XmlText ( input . Key ) ) . withName ( "Key" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Value !== undefined && input . Value !== null ) { const node = new __XmlNode ( "TagValue" ) . addChildNode ( new __XmlText ( input . Value ) ) . withName ( "Value" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const serializeAws_restXmlTagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "TagKey" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "Key" ) ; } ) ; } ; const serializeAws_restXmlTagKeys = ( input , context ) : any => { const bodyNode = new __XmlNode ( "TagKeys" ) ; if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlTagKeyList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlTagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = serializeAws_restXmlTag ( entry , context ) ; return node . withName ( "Tag" ) ; } ) ; } ; const serializeAws_restXmlTags = ( input , context ) : any => { const bodyNode = new __XmlNode ( "Tags" ) ; if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlTagList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlTrustedKeyGroupIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( entry ) ) ; return node . withName ( "KeyGroup" ) ; } ) ; } ; const serializeAws_restXmlTrustedKeyGroups = ( input , context ) : any => { const bodyNode = new __XmlNode ( "TrustedKeyGroups" ) ; if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlTrustedKeyGroupIdList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlTrustedSigners = ( input , context ) : any => { const bodyNode = new __XmlNode ( "TrustedSigners" ) ; if ( input . Enabled !== undefined && input . Enabled !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . Enabled ) ) ) . withName ( "Enabled" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Quantity !== undefined && input . Quantity !== null ) { const node = new __XmlNode ( "integer" ) . addChildNode ( new __XmlText ( String ( input . Quantity ) ) ) . withName ( "Quantity" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Items !== undefined && input . Items !== null ) { const nodes = serializeAws_restXmlAwsAccountNumberList ( input . Items , context ) ; const containerNode = new __XmlNode ( "Items" ) ; nodes . map ( ( node ) => { containerNode . addChildNode ( node ) ; } ) ; bodyNode . addChildNode ( containerNode ) ; } return bodyNode ; } ; const serializeAws_restXmlViewerCertificate = ( input , context ) : any => { const bodyNode = new __XmlNode ( "ViewerCertificate" ) ; if ( input . CloudFrontDefaultCertificate !== undefined && input . CloudFrontDefaultCertificate !== null ) { const node = new __XmlNode ( "boolean" ) . addChildNode ( new __XmlText ( String ( input . CloudFrontDefaultCertificate ) ) ) . withName ( "CloudFrontDefaultCertificate" ) ; bodyNode . addChildNode ( node ) ; } if ( input . IAMCertificateId !== undefined && input . IAMCertificateId !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . IAMCertificateId ) ) . withName ( "IAMCertificateId" ) ; bodyNode . addChildNode ( node ) ; } if ( input . ACMCertificateArn !== undefined && input . ACMCertificateArn !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . ACMCertificateArn ) ) . withName ( "ACMCertificateArn" ) ; bodyNode . addChildNode ( node ) ; } if ( input . SSLSupportMethod !== undefined && input . SSLSupportMethod !== null ) { const node = new __XmlNode ( "SSLSupportMethod" ) . addChildNode ( new __XmlText ( input . SSLSupportMethod ) ) . withName ( "SSLSupportMethod" ) ; bodyNode . addChildNode ( node ) ; } if ( input . MinimumProtocolVersion !== undefined && input . MinimumProtocolVersion !== null ) { const node = new __XmlNode ( "MinimumProtocolVersion" ) . addChildNode ( new __XmlText ( input . MinimumProtocolVersion ) ) . withName ( "MinimumProtocolVersion" ) ; bodyNode . addChildNode ( node ) ; } if ( input . Certificate !== undefined && input . Certificate !== null ) { const node = new __XmlNode ( "string" ) . addChildNode ( new __XmlText ( input . Certificate ) ) . withName ( "Certificate" ) ; bodyNode . addChildNode ( node ) ; } if ( input . CertificateSource !== undefined && input . CertificateSource !== null ) { const node = new __XmlNode ( "CertificateSource" ) . addChildNode ( new __XmlText ( input . CertificateSource ) ) . withName ( "CertificateSource" ) ; bodyNode . addChildNode ( node ) ; } return bodyNode ; } ; const deserializeAws_restXmlAccessControlAllowHeadersList = ( 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_restXmlAccessControlAllowMethodsList = ( output , context ) : ( ResponseHeadersPolicyAccessControlAllowMethodsValues | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restXmlAccessControlAllowOriginsList = ( 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_restXmlAccessControlExposeHeadersList = ( 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_restXmlActiveTrustedKeyGroups = ( output , context ) : ActiveTrustedKeyGroups => { const contents = { Enabled : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "KeyGroup" ] !== undefined ) { contents . Items = deserializeAws_restXmlKGKeyPairIdsList ( __getArrayIfSingleItem ( output [ "Items" ] [ "KeyGroup" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlActiveTrustedSigners = ( output , context ) : ActiveTrustedSigners => { const contents = { Enabled : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Signer" ] !== undefined ) { contents . Items = deserializeAws_restXmlSignerList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Signer" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlAliases = ( output , context ) : Aliases => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "CNAME" ] !== undefined ) { contents . Items = deserializeAws_restXmlAliasList ( __getArrayIfSingleItem ( output [ "Items" ] [ "CNAME" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlAliasICPRecordal = ( output , context ) : AliasICPRecordal => { const contents = { CNAME : undefined , ICPRecordalStatus : undefined , } ; if ( output [ "CNAME" ] !== undefined ) { contents . CNAME = __expectString ( output [ "CNAME" ] ) ; } if ( output [ "ICPRecordalStatus" ] !== undefined ) { contents . ICPRecordalStatus = __expectString ( output [ "ICPRecordalStatus" ] ) ; } return contents ; } ; const deserializeAws_restXmlAliasICPRecordals = ( output , context ) : AliasICPRecordal [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlAliasICPRecordal ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlAliasList = ( 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_restXmlAllowedMethods = ( output , context ) : AllowedMethods => { const contents = { Quantity : undefined , Items : undefined , CachedMethods : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Method" ] !== undefined ) { contents . Items = deserializeAws_restXmlMethodsList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Method" ] ) , context ) ; } if ( output [ "CachedMethods" ] !== undefined ) { contents . CachedMethods = deserializeAws_restXmlCachedMethods ( output [ "CachedMethods" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlAwsAccountNumberList = ( 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_restXmlCacheBehavior = ( output , context ) : CacheBehavior => { const contents = { PathPattern : undefined , TargetOriginId : undefined , TrustedSigners : undefined , TrustedKeyGroups : undefined , ViewerProtocolPolicy : undefined , AllowedMethods : undefined , SmoothStreaming : undefined , Compress : undefined , LambdaFunctionAssociations : undefined , FunctionAssociations : undefined , FieldLevelEncryptionId : undefined , RealtimeLogConfigArn : undefined , CachePolicyId : undefined , OriginRequestPolicyId : undefined , ResponseHeadersPolicyId : undefined , ForwardedValues : undefined , MinTTL : undefined , DefaultTTL : undefined , MaxTTL : undefined , } ; if ( output [ "PathPattern" ] !== undefined ) { contents . PathPattern = __expectString ( output [ "PathPattern" ] ) ; } if ( output [ "TargetOriginId" ] !== undefined ) { contents . TargetOriginId = __expectString ( output [ "TargetOriginId" ] ) ; } if ( output [ "TrustedSigners" ] !== undefined ) { contents . TrustedSigners = deserializeAws_restXmlTrustedSigners ( output [ "TrustedSigners" ] , context ) ; } if ( output [ "TrustedKeyGroups" ] !== undefined ) { contents . TrustedKeyGroups = deserializeAws_restXmlTrustedKeyGroups ( output [ "TrustedKeyGroups" ] , context ) ; } if ( output [ "ViewerProtocolPolicy" ] !== undefined ) { contents . ViewerProtocolPolicy = __expectString ( output [ "ViewerProtocolPolicy" ] ) ; } if ( output [ "AllowedMethods" ] !== undefined ) { contents . AllowedMethods = deserializeAws_restXmlAllowedMethods ( output [ "AllowedMethods" ] , context ) ; } if ( output [ "SmoothStreaming" ] !== undefined ) { contents . SmoothStreaming = __parseBoolean ( output [ "SmoothStreaming" ] ) ; } if ( output [ "Compress" ] !== undefined ) { contents . Compress = __parseBoolean ( output [ "Compress" ] ) ; } if ( output [ "LambdaFunctionAssociations" ] !== undefined ) { contents . LambdaFunctionAssociations = deserializeAws_restXmlLambdaFunctionAssociations ( output [ "LambdaFunctionAssociations" ] , context ) ; } if ( output [ "FunctionAssociations" ] !== undefined ) { contents . FunctionAssociations = deserializeAws_restXmlFunctionAssociations ( output [ "FunctionAssociations" ] , context ) ; } if ( output [ "FieldLevelEncryptionId" ] !== undefined ) { contents . FieldLevelEncryptionId = __expectString ( output [ "FieldLevelEncryptionId" ] ) ; } if ( output [ "RealtimeLogConfigArn" ] !== undefined ) { contents . RealtimeLogConfigArn = __expectString ( output [ "RealtimeLogConfigArn" ] ) ; } if ( output [ "CachePolicyId" ] !== undefined ) { contents . CachePolicyId = __expectString ( output [ "CachePolicyId" ] ) ; } if ( output [ "OriginRequestPolicyId" ] !== undefined ) { contents . OriginRequestPolicyId = __expectString ( output [ "OriginRequestPolicyId" ] ) ; } if ( output [ "ResponseHeadersPolicyId" ] !== undefined ) { contents . ResponseHeadersPolicyId = __expectString ( output [ "ResponseHeadersPolicyId" ] ) ; } if ( output [ "ForwardedValues" ] !== undefined ) { contents . ForwardedValues = deserializeAws_restXmlForwardedValues ( output [ "ForwardedValues" ] , context ) ; } if ( output [ "MinTTL" ] !== undefined ) { contents . MinTTL = __strictParseLong ( output [ "MinTTL" ] ) as number ; } if ( output [ "DefaultTTL" ] !== undefined ) { contents . DefaultTTL = __strictParseLong ( output [ "DefaultTTL" ] ) as number ; } if ( output [ "MaxTTL" ] !== undefined ) { contents . MaxTTL = __strictParseLong ( output [ "MaxTTL" ] ) as number ; } return contents ; } ; const deserializeAws_restXmlCacheBehaviorList = ( output , context ) : CacheBehavior [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlCacheBehavior ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlCacheBehaviors = ( output , context ) : CacheBehaviors => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "CacheBehavior" ] !== undefined ) { contents . Items = deserializeAws_restXmlCacheBehaviorList ( __getArrayIfSingleItem ( output [ "Items" ] [ "CacheBehavior" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCachedMethods = ( output , context ) : CachedMethods => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Method" ] !== undefined ) { contents . Items = deserializeAws_restXmlMethodsList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Method" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicy = ( output , context ) : CachePolicy => { const contents = { Id : undefined , LastModifiedTime : undefined , CachePolicyConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "CachePolicyConfig" ] !== undefined ) { contents . CachePolicyConfig = deserializeAws_restXmlCachePolicyConfig ( output [ "CachePolicyConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyConfig = ( output , context ) : CachePolicyConfig => { const contents = { Comment : undefined , Name : undefined , DefaultTTL : undefined , MaxTTL : undefined , MinTTL : undefined , ParametersInCacheKeyAndForwardedToOrigin : undefined , } ; if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "DefaultTTL" ] !== undefined ) { contents . DefaultTTL = __strictParseLong ( output [ "DefaultTTL" ] ) as number ; } if ( output [ "MaxTTL" ] !== undefined ) { contents . MaxTTL = __strictParseLong ( output [ "MaxTTL" ] ) as number ; } if ( output [ "MinTTL" ] !== undefined ) { contents . MinTTL = __strictParseLong ( output [ "MinTTL" ] ) as number ; } if ( output [ "ParametersInCacheKeyAndForwardedToOrigin" ] !== undefined ) { contents . ParametersInCacheKeyAndForwardedToOrigin = deserializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin ( output [ "ParametersInCacheKeyAndForwardedToOrigin" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyCookiesConfig = ( output , context ) : CachePolicyCookiesConfig => { const contents = { CookieBehavior : undefined , Cookies : undefined , } ; if ( output [ "CookieBehavior" ] !== undefined ) { contents . CookieBehavior = __expectString ( output [ "CookieBehavior" ] ) ; } if ( output [ "Cookies" ] !== undefined ) { contents . Cookies = deserializeAws_restXmlCookieNames ( output [ "Cookies" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyHeadersConfig = ( output , context ) : CachePolicyHeadersConfig => { const contents = { HeaderBehavior : undefined , Headers : undefined , } ; if ( output [ "HeaderBehavior" ] !== undefined ) { contents . HeaderBehavior = __expectString ( output [ "HeaderBehavior" ] ) ; } if ( output [ "Headers" ] !== undefined ) { contents . Headers = deserializeAws_restXmlHeaders ( output [ "Headers" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyList = ( output , context ) : CachePolicyList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "CachePolicySummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlCachePolicySummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "CachePolicySummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicyQueryStringsConfig = ( output , context ) : CachePolicyQueryStringsConfig => { const contents = { QueryStringBehavior : undefined , QueryStrings : undefined , } ; if ( output [ "QueryStringBehavior" ] !== undefined ) { contents . QueryStringBehavior = __expectString ( output [ "QueryStringBehavior" ] ) ; } if ( output [ "QueryStrings" ] !== undefined ) { contents . QueryStrings = deserializeAws_restXmlQueryStringNames ( output [ "QueryStrings" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicySummary = ( output , context ) : CachePolicySummary => { const contents = { Type : undefined , CachePolicy : undefined , } ; if ( output [ "Type" ] !== undefined ) { contents . Type = __expectString ( output [ "Type" ] ) ; } if ( output [ "CachePolicy" ] !== undefined ) { contents . CachePolicy = deserializeAws_restXmlCachePolicy ( output [ "CachePolicy" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCachePolicySummaryList = ( output , context ) : CachePolicySummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlCachePolicySummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentity = ( output , context ) : CloudFrontOriginAccessIdentity => { const contents = { Id : undefined , S3CanonicalUserId : undefined , CloudFrontOriginAccessIdentityConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "S3CanonicalUserId" ] !== undefined ) { contents . S3CanonicalUserId = __expectString ( output [ "S3CanonicalUserId" ] ) ; } if ( output [ "CloudFrontOriginAccessIdentityConfig" ] !== undefined ) { contents . CloudFrontOriginAccessIdentityConfig = deserializeAws_restXmlCloudFrontOriginAccessIdentityConfig ( output [ "CloudFrontOriginAccessIdentityConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentityConfig = ( output , context ) : CloudFrontOriginAccessIdentityConfig => { const contents = { CallerReference : undefined , Comment : undefined , } ; if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } return contents ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentityList = ( output , context ) : CloudFrontOriginAccessIdentityList => { const contents = { Marker : undefined , NextMarker : undefined , MaxItems : undefined , IsTruncated : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "CloudFrontOriginAccessIdentitySummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlCloudFrontOriginAccessIdentitySummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "CloudFrontOriginAccessIdentitySummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentitySummary = ( output , context ) : CloudFrontOriginAccessIdentitySummary => { const contents = { Id : undefined , S3CanonicalUserId : undefined , Comment : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "S3CanonicalUserId" ] !== undefined ) { contents . S3CanonicalUserId = __expectString ( output [ "S3CanonicalUserId" ] ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } return contents ; } ; const deserializeAws_restXmlCloudFrontOriginAccessIdentitySummaryList = ( output , context ) : CloudFrontOriginAccessIdentitySummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlCloudFrontOriginAccessIdentitySummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlConflictingAlias = ( output , context ) : ConflictingAlias => { const contents = { Alias : undefined , DistributionId : undefined , AccountId : undefined , } ; if ( output [ "Alias" ] !== undefined ) { contents . Alias = __expectString ( output [ "Alias" ] ) ; } if ( output [ "DistributionId" ] !== undefined ) { contents . DistributionId = __expectString ( output [ "DistributionId" ] ) ; } if ( output [ "AccountId" ] !== undefined ) { contents . AccountId = __expectString ( output [ "AccountId" ] ) ; } return contents ; } ; const deserializeAws_restXmlConflictingAliases = ( output , context ) : ConflictingAlias [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlConflictingAlias ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlConflictingAliasesList = ( output , context ) : ConflictingAliasesList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "ConflictingAlias" ] !== undefined ) { contents . Items = deserializeAws_restXmlConflictingAliases ( __getArrayIfSingleItem ( output [ "Items" ] [ "ConflictingAlias" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlContentTypeProfile = ( output , context ) : ContentTypeProfile => { const contents = { Format : undefined , ProfileId : undefined , ContentType : undefined , } ; if ( output [ "Format" ] !== undefined ) { contents . Format = __expectString ( output [ "Format" ] ) ; } if ( output [ "ProfileId" ] !== undefined ) { contents . ProfileId = __expectString ( output [ "ProfileId" ] ) ; } if ( output [ "ContentType" ] !== undefined ) { contents . ContentType = __expectString ( output [ "ContentType" ] ) ; } return contents ; } ; const deserializeAws_restXmlContentTypeProfileConfig = ( output , context ) : ContentTypeProfileConfig => { const contents = { ForwardWhenContentTypeIsUnknown : undefined , ContentTypeProfiles : undefined , } ; if ( output [ "ForwardWhenContentTypeIsUnknown" ] !== undefined ) { contents . ForwardWhenContentTypeIsUnknown = __parseBoolean ( output [ "ForwardWhenContentTypeIsUnknown" ] ) ; } if ( output [ "ContentTypeProfiles" ] !== undefined ) { contents . ContentTypeProfiles = deserializeAws_restXmlContentTypeProfiles ( output [ "ContentTypeProfiles" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlContentTypeProfileList = ( output , context ) : ContentTypeProfile [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlContentTypeProfile ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlContentTypeProfiles = ( output , context ) : ContentTypeProfiles => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "ContentTypeProfile" ] !== undefined ) { contents . Items = deserializeAws_restXmlContentTypeProfileList ( __getArrayIfSingleItem ( output [ "Items" ] [ "ContentTypeProfile" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCookieNameList = ( 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_restXmlCookieNames = ( output , context ) : CookieNames => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Name" ] !== undefined ) { contents . Items = deserializeAws_restXmlCookieNameList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Name" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCookiePreference = ( output , context ) : CookiePreference => { const contents = { Forward : undefined , WhitelistedNames : undefined , } ; if ( output [ "Forward" ] !== undefined ) { contents . Forward = __expectString ( output [ "Forward" ] ) ; } if ( output [ "WhitelistedNames" ] !== undefined ) { contents . WhitelistedNames = deserializeAws_restXmlCookieNames ( output [ "WhitelistedNames" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlCustomErrorResponse = ( output , context ) : CustomErrorResponse => { const contents = { ErrorCode : undefined , ResponsePagePath : undefined , ResponseCode : undefined , ErrorCachingMinTTL : undefined , } ; if ( output [ "ErrorCode" ] !== undefined ) { contents . ErrorCode = __strictParseInt32 ( output [ "ErrorCode" ] ) as number ; } if ( output [ "ResponsePagePath" ] !== undefined ) { contents . ResponsePagePath = __expectString ( output [ "ResponsePagePath" ] ) ; } if ( output [ "ResponseCode" ] !== undefined ) { contents . ResponseCode = __expectString ( output [ "ResponseCode" ] ) ; } if ( output [ "ErrorCachingMinTTL" ] !== undefined ) { contents . ErrorCachingMinTTL = __strictParseLong ( output [ "ErrorCachingMinTTL" ] ) as number ; } return contents ; } ; const deserializeAws_restXmlCustomErrorResponseList = ( output , context ) : CustomErrorResponse [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlCustomErrorResponse ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlCustomErrorResponses = ( output , context ) : CustomErrorResponses => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "CustomErrorResponse" ] !== undefined ) { contents . Items = deserializeAws_restXmlCustomErrorResponseList ( __getArrayIfSingleItem ( output [ "Items" ] [ "CustomErrorResponse" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCustomHeaders = ( output , context ) : CustomHeaders => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "OriginCustomHeader" ] !== undefined ) { contents . Items = deserializeAws_restXmlOriginCustomHeadersList ( __getArrayIfSingleItem ( output [ "Items" ] [ "OriginCustomHeader" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlCustomOriginConfig = ( output , context ) : CustomOriginConfig => { const contents = { HTTPPort : undefined , HTTPSPort : undefined , OriginProtocolPolicy : undefined , OriginSslProtocols : undefined , OriginReadTimeout : undefined , OriginKeepaliveTimeout : undefined , } ; if ( output [ "HTTPPort" ] !== undefined ) { contents . HTTPPort = __strictParseInt32 ( output [ "HTTPPort" ] ) as number ; } if ( output [ "HTTPSPort" ] !== undefined ) { contents . HTTPSPort = __strictParseInt32 ( output [ "HTTPSPort" ] ) as number ; } if ( output [ "OriginProtocolPolicy" ] !== undefined ) { contents . OriginProtocolPolicy = __expectString ( output [ "OriginProtocolPolicy" ] ) ; } if ( output [ "OriginSslProtocols" ] !== undefined ) { contents . OriginSslProtocols = deserializeAws_restXmlOriginSslProtocols ( output [ "OriginSslProtocols" ] , context ) ; } if ( output [ "OriginReadTimeout" ] !== undefined ) { contents . OriginReadTimeout = __strictParseInt32 ( output [ "OriginReadTimeout" ] ) as number ; } if ( output [ "OriginKeepaliveTimeout" ] !== undefined ) { contents . OriginKeepaliveTimeout = __strictParseInt32 ( output [ "OriginKeepaliveTimeout" ] ) as number ; } return contents ; } ; const deserializeAws_restXmlDefaultCacheBehavior = ( output , context ) : DefaultCacheBehavior => { const contents = { TargetOriginId : undefined , TrustedSigners : undefined , TrustedKeyGroups : undefined , ViewerProtocolPolicy : undefined , AllowedMethods : undefined , SmoothStreaming : undefined , Compress : undefined , LambdaFunctionAssociations : undefined , FunctionAssociations : undefined , FieldLevelEncryptionId : undefined , RealtimeLogConfigArn : undefined , CachePolicyId : undefined , OriginRequestPolicyId : undefined , ResponseHeadersPolicyId : undefined , ForwardedValues : undefined , MinTTL : undefined , DefaultTTL : undefined , MaxTTL : undefined , } ; if ( output [ "TargetOriginId" ] !== undefined ) { contents . TargetOriginId = __expectString ( output [ "TargetOriginId" ] ) ; } if ( output [ "TrustedSigners" ] !== undefined ) { contents . TrustedSigners = deserializeAws_restXmlTrustedSigners ( output [ "TrustedSigners" ] , context ) ; } if ( output [ "TrustedKeyGroups" ] !== undefined ) { contents . TrustedKeyGroups = deserializeAws_restXmlTrustedKeyGroups ( output [ "TrustedKeyGroups" ] , context ) ; } if ( output [ "ViewerProtocolPolicy" ] !== undefined ) { contents . ViewerProtocolPolicy = __expectString ( output [ "ViewerProtocolPolicy" ] ) ; } if ( output [ "AllowedMethods" ] !== undefined ) { contents . AllowedMethods = deserializeAws_restXmlAllowedMethods ( output [ "AllowedMethods" ] , context ) ; } if ( output [ "SmoothStreaming" ] !== undefined ) { contents . SmoothStreaming = __parseBoolean ( output [ "SmoothStreaming" ] ) ; } if ( output [ "Compress" ] !== undefined ) { contents . Compress = __parseBoolean ( output [ "Compress" ] ) ; } if ( output [ "LambdaFunctionAssociations" ] !== undefined ) { contents . LambdaFunctionAssociations = deserializeAws_restXmlLambdaFunctionAssociations ( output [ "LambdaFunctionAssociations" ] , context ) ; } if ( output [ "FunctionAssociations" ] !== undefined ) { contents . FunctionAssociations = deserializeAws_restXmlFunctionAssociations ( output [ "FunctionAssociations" ] , context ) ; } if ( output [ "FieldLevelEncryptionId" ] !== undefined ) { contents . FieldLevelEncryptionId = __expectString ( output [ "FieldLevelEncryptionId" ] ) ; } if ( output [ "RealtimeLogConfigArn" ] !== undefined ) { contents . RealtimeLogConfigArn = __expectString ( output [ "RealtimeLogConfigArn" ] ) ; } if ( output [ "CachePolicyId" ] !== undefined ) { contents . CachePolicyId = __expectString ( output [ "CachePolicyId" ] ) ; } if ( output [ "OriginRequestPolicyId" ] !== undefined ) { contents . OriginRequestPolicyId = __expectString ( output [ "OriginRequestPolicyId" ] ) ; } if ( output [ "ResponseHeadersPolicyId" ] !== undefined ) { contents . ResponseHeadersPolicyId = __expectString ( output [ "ResponseHeadersPolicyId" ] ) ; } if ( output [ "ForwardedValues" ] !== undefined ) { contents . ForwardedValues = deserializeAws_restXmlForwardedValues ( output [ "ForwardedValues" ] , context ) ; } if ( output [ "MinTTL" ] !== undefined ) { contents . MinTTL = __strictParseLong ( output [ "MinTTL" ] ) as number ; } if ( output [ "DefaultTTL" ] !== undefined ) { contents . DefaultTTL = __strictParseLong ( output [ "DefaultTTL" ] ) as number ; } if ( output [ "MaxTTL" ] !== undefined ) { contents . MaxTTL = __strictParseLong ( output [ "MaxTTL" ] ) as number ; } return contents ; } ; const deserializeAws_restXmlDistribution = ( output , context ) : Distribution => { const contents = { Id : undefined , ARN : undefined , Status : undefined , LastModifiedTime : undefined , InProgressInvalidationBatches : undefined , DomainName : undefined , ActiveTrustedSigners : undefined , ActiveTrustedKeyGroups : undefined , DistributionConfig : undefined , AliasICPRecordals : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "ARN" ] !== undefined ) { contents . ARN = __expectString ( output [ "ARN" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "InProgressInvalidationBatches" ] !== undefined ) { contents . InProgressInvalidationBatches = __strictParseInt32 ( output [ "InProgressInvalidationBatches" ] ) as number ; } if ( output [ "DomainName" ] !== undefined ) { contents . DomainName = __expectString ( output [ "DomainName" ] ) ; } if ( output [ "ActiveTrustedSigners" ] !== undefined ) { contents . ActiveTrustedSigners = deserializeAws_restXmlActiveTrustedSigners ( output [ "ActiveTrustedSigners" ] , context ) ; } if ( output [ "ActiveTrustedKeyGroups" ] !== undefined ) { contents . ActiveTrustedKeyGroups = deserializeAws_restXmlActiveTrustedKeyGroups ( output [ "ActiveTrustedKeyGroups" ] , context ) ; } if ( output [ "DistributionConfig" ] !== undefined ) { contents . DistributionConfig = deserializeAws_restXmlDistributionConfig ( output [ "DistributionConfig" ] , context ) ; } if ( output . AliasICPRecordals === "" ) { contents . AliasICPRecordals = [ ] ; } if ( output [ "AliasICPRecordals" ] !== undefined && output [ "AliasICPRecordals" ] [ "AliasICPRecordal" ] !== undefined ) { contents . AliasICPRecordals = deserializeAws_restXmlAliasICPRecordals ( __getArrayIfSingleItem ( output [ "AliasICPRecordals" ] [ "AliasICPRecordal" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlDistributionConfig = ( output , context ) : DistributionConfig => { const contents = { CallerReference : undefined , Aliases : undefined , DefaultRootObject : undefined , Origins : undefined , OriginGroups : undefined , DefaultCacheBehavior : undefined , CacheBehaviors : undefined , CustomErrorResponses : undefined , Comment : undefined , Logging : undefined , PriceClass : undefined , Enabled : undefined , ViewerCertificate : undefined , Restrictions : undefined , WebACLId : undefined , HttpVersion : undefined , IsIPV6Enabled : undefined , } ; if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } if ( output [ "Aliases" ] !== undefined ) { contents . Aliases = deserializeAws_restXmlAliases ( output [ "Aliases" ] , context ) ; } if ( output [ "DefaultRootObject" ] !== undefined ) { contents . DefaultRootObject = __expectString ( output [ "DefaultRootObject" ] ) ; } if ( output [ "Origins" ] !== undefined ) { contents . Origins = deserializeAws_restXmlOrigins ( output [ "Origins" ] , context ) ; } if ( output [ "OriginGroups" ] !== undefined ) { contents . OriginGroups = deserializeAws_restXmlOriginGroups ( output [ "OriginGroups" ] , context ) ; } if ( output [ "DefaultCacheBehavior" ] !== undefined ) { contents . DefaultCacheBehavior = deserializeAws_restXmlDefaultCacheBehavior ( output [ "DefaultCacheBehavior" ] , context ) ; } if ( output [ "CacheBehaviors" ] !== undefined ) { contents . CacheBehaviors = deserializeAws_restXmlCacheBehaviors ( output [ "CacheBehaviors" ] , context ) ; } if ( output [ "CustomErrorResponses" ] !== undefined ) { contents . CustomErrorResponses = deserializeAws_restXmlCustomErrorResponses ( output [ "CustomErrorResponses" ] , context ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "Logging" ] !== undefined ) { contents . Logging = deserializeAws_restXmlLoggingConfig ( output [ "Logging" ] , context ) ; } if ( output [ "PriceClass" ] !== undefined ) { contents . PriceClass = __expectString ( output [ "PriceClass" ] ) ; } if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "ViewerCertificate" ] !== undefined ) { contents . ViewerCertificate = deserializeAws_restXmlViewerCertificate ( output [ "ViewerCertificate" ] , context ) ; } if ( output [ "Restrictions" ] !== undefined ) { contents . Restrictions = deserializeAws_restXmlRestrictions ( output [ "Restrictions" ] , context ) ; } if ( output [ "WebACLId" ] !== undefined ) { contents . WebACLId = __expectString ( output [ "WebACLId" ] ) ; } if ( output [ "HttpVersion" ] !== undefined ) { contents . HttpVersion = __expectString ( output [ "HttpVersion" ] ) ; } if ( output [ "IsIPV6Enabled" ] !== undefined ) { contents . IsIPV6Enabled = __parseBoolean ( output [ "IsIPV6Enabled" ] ) ; } return contents ; } ; const deserializeAws_restXmlDistributionIdList = ( output , context ) : DistributionIdList => { const contents = { Marker : undefined , NextMarker : undefined , MaxItems : undefined , IsTruncated : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "DistributionId" ] !== undefined ) { contents . Items = deserializeAws_restXmlDistributionIdListSummary ( __getArrayIfSingleItem ( output [ "Items" ] [ "DistributionId" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlDistributionIdListSummary = ( 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_restXmlDistributionList = ( output , context ) : DistributionList => { const contents = { Marker : undefined , NextMarker : undefined , MaxItems : undefined , IsTruncated : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "DistributionSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlDistributionSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "DistributionSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlDistributionSummary = ( output , context ) : DistributionSummary => { const contents = { Id : undefined , ARN : undefined , Status : undefined , LastModifiedTime : undefined , DomainName : undefined , Aliases : undefined , Origins : undefined , OriginGroups : undefined , DefaultCacheBehavior : undefined , CacheBehaviors : undefined , CustomErrorResponses : undefined , Comment : undefined , PriceClass : undefined , Enabled : undefined , ViewerCertificate : undefined , Restrictions : undefined , WebACLId : undefined , HttpVersion : undefined , IsIPV6Enabled : undefined , AliasICPRecordals : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "ARN" ] !== undefined ) { contents . ARN = __expectString ( output [ "ARN" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "DomainName" ] !== undefined ) { contents . DomainName = __expectString ( output [ "DomainName" ] ) ; } if ( output [ "Aliases" ] !== undefined ) { contents . Aliases = deserializeAws_restXmlAliases ( output [ "Aliases" ] , context ) ; } if ( output [ "Origins" ] !== undefined ) { contents . Origins = deserializeAws_restXmlOrigins ( output [ "Origins" ] , context ) ; } if ( output [ "OriginGroups" ] !== undefined ) { contents . OriginGroups = deserializeAws_restXmlOriginGroups ( output [ "OriginGroups" ] , context ) ; } if ( output [ "DefaultCacheBehavior" ] !== undefined ) { contents . DefaultCacheBehavior = deserializeAws_restXmlDefaultCacheBehavior ( output [ "DefaultCacheBehavior" ] , context ) ; } if ( output [ "CacheBehaviors" ] !== undefined ) { contents . CacheBehaviors = deserializeAws_restXmlCacheBehaviors ( output [ "CacheBehaviors" ] , context ) ; } if ( output [ "CustomErrorResponses" ] !== undefined ) { contents . CustomErrorResponses = deserializeAws_restXmlCustomErrorResponses ( output [ "CustomErrorResponses" ] , context ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "PriceClass" ] !== undefined ) { contents . PriceClass = __expectString ( output [ "PriceClass" ] ) ; } if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "ViewerCertificate" ] !== undefined ) { contents . ViewerCertificate = deserializeAws_restXmlViewerCertificate ( output [ "ViewerCertificate" ] , context ) ; } if ( output [ "Restrictions" ] !== undefined ) { contents . Restrictions = deserializeAws_restXmlRestrictions ( output [ "Restrictions" ] , context ) ; } if ( output [ "WebACLId" ] !== undefined ) { contents . WebACLId = __expectString ( output [ "WebACLId" ] ) ; } if ( output [ "HttpVersion" ] !== undefined ) { contents . HttpVersion = __expectString ( output [ "HttpVersion" ] ) ; } if ( output [ "IsIPV6Enabled" ] !== undefined ) { contents . IsIPV6Enabled = __parseBoolean ( output [ "IsIPV6Enabled" ] ) ; } if ( output . AliasICPRecordals === "" ) { contents . AliasICPRecordals = [ ] ; } if ( output [ "AliasICPRecordals" ] !== undefined && output [ "AliasICPRecordals" ] [ "AliasICPRecordal" ] !== undefined ) { contents . AliasICPRecordals = deserializeAws_restXmlAliasICPRecordals ( __getArrayIfSingleItem ( output [ "AliasICPRecordals" ] [ "AliasICPRecordal" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlDistributionSummaryList = ( output , context ) : DistributionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlDistributionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlEncryptionEntities = ( output , context ) : EncryptionEntities => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "EncryptionEntity" ] !== undefined ) { contents . Items = deserializeAws_restXmlEncryptionEntityList ( __getArrayIfSingleItem ( output [ "Items" ] [ "EncryptionEntity" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlEncryptionEntity = ( output , context ) : EncryptionEntity => { const contents = { PublicKeyId : undefined , ProviderId : undefined , FieldPatterns : undefined , } ; if ( output [ "PublicKeyId" ] !== undefined ) { contents . PublicKeyId = __expectString ( output [ "PublicKeyId" ] ) ; } if ( output [ "ProviderId" ] !== undefined ) { contents . ProviderId = __expectString ( output [ "ProviderId" ] ) ; } if ( output [ "FieldPatterns" ] !== undefined ) { contents . FieldPatterns = deserializeAws_restXmlFieldPatterns ( output [ "FieldPatterns" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlEncryptionEntityList = ( output , context ) : EncryptionEntity [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlEncryptionEntity ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlEndPoint = ( output , context ) : EndPoint => { const contents = { StreamType : undefined , KinesisStreamConfig : undefined , } ; if ( output [ "StreamType" ] !== undefined ) { contents . StreamType = __expectString ( output [ "StreamType" ] ) ; } if ( output [ "KinesisStreamConfig" ] !== undefined ) { contents . KinesisStreamConfig = deserializeAws_restXmlKinesisStreamConfig ( output [ "KinesisStreamConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlEndPointList = ( output , context ) : EndPoint [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlEndPoint ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlFieldLevelEncryption = ( output , context ) : FieldLevelEncryption => { const contents = { Id : undefined , LastModifiedTime : undefined , FieldLevelEncryptionConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "FieldLevelEncryptionConfig" ] !== undefined ) { contents . FieldLevelEncryptionConfig = deserializeAws_restXmlFieldLevelEncryptionConfig ( output [ "FieldLevelEncryptionConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionConfig = ( output , context ) : FieldLevelEncryptionConfig => { const contents = { CallerReference : undefined , Comment : undefined , QueryArgProfileConfig : undefined , ContentTypeProfileConfig : undefined , } ; if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "QueryArgProfileConfig" ] !== undefined ) { contents . QueryArgProfileConfig = deserializeAws_restXmlQueryArgProfileConfig ( output [ "QueryArgProfileConfig" ] , context ) ; } if ( output [ "ContentTypeProfileConfig" ] !== undefined ) { contents . ContentTypeProfileConfig = deserializeAws_restXmlContentTypeProfileConfig ( output [ "ContentTypeProfileConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionList = ( output , context ) : FieldLevelEncryptionList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "FieldLevelEncryptionSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlFieldLevelEncryptionSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "FieldLevelEncryptionSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfile = ( output , context ) : FieldLevelEncryptionProfile => { const contents = { Id : undefined , LastModifiedTime : undefined , FieldLevelEncryptionProfileConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "FieldLevelEncryptionProfileConfig" ] !== undefined ) { contents . FieldLevelEncryptionProfileConfig = deserializeAws_restXmlFieldLevelEncryptionProfileConfig ( output [ "FieldLevelEncryptionProfileConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileConfig = ( output , context ) : FieldLevelEncryptionProfileConfig => { const contents = { Name : undefined , CallerReference : undefined , Comment : undefined , EncryptionEntities : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "EncryptionEntities" ] !== undefined ) { contents . EncryptionEntities = deserializeAws_restXmlEncryptionEntities ( output [ "EncryptionEntities" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileList = ( output , context ) : FieldLevelEncryptionProfileList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "FieldLevelEncryptionProfileSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlFieldLevelEncryptionProfileSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "FieldLevelEncryptionProfileSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileSummary = ( output , context ) : FieldLevelEncryptionProfileSummary => { const contents = { Id : undefined , LastModifiedTime : undefined , Name : undefined , EncryptionEntities : undefined , Comment : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "EncryptionEntities" ] !== undefined ) { contents . EncryptionEntities = deserializeAws_restXmlEncryptionEntities ( output [ "EncryptionEntities" ] , context ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionProfileSummaryList = ( output , context ) : FieldLevelEncryptionProfileSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlFieldLevelEncryptionProfileSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlFieldLevelEncryptionSummary = ( output , context ) : FieldLevelEncryptionSummary => { const contents = { Id : undefined , LastModifiedTime : undefined , Comment : undefined , QueryArgProfileConfig : undefined , ContentTypeProfileConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "QueryArgProfileConfig" ] !== undefined ) { contents . QueryArgProfileConfig = deserializeAws_restXmlQueryArgProfileConfig ( output [ "QueryArgProfileConfig" ] , context ) ; } if ( output [ "ContentTypeProfileConfig" ] !== undefined ) { contents . ContentTypeProfileConfig = deserializeAws_restXmlContentTypeProfileConfig ( output [ "ContentTypeProfileConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFieldLevelEncryptionSummaryList = ( output , context ) : FieldLevelEncryptionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlFieldLevelEncryptionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlFieldList = ( 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_restXmlFieldPatternList = ( 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_restXmlFieldPatterns = ( output , context ) : FieldPatterns => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "FieldPattern" ] !== undefined ) { contents . Items = deserializeAws_restXmlFieldPatternList ( __getArrayIfSingleItem ( output [ "Items" ] [ "FieldPattern" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlForwardedValues = ( output , context ) : ForwardedValues => { const contents = { QueryString : undefined , Cookies : undefined , Headers : undefined , QueryStringCacheKeys : undefined , } ; if ( output [ "QueryString" ] !== undefined ) { contents . QueryString = __parseBoolean ( output [ "QueryString" ] ) ; } if ( output [ "Cookies" ] !== undefined ) { contents . Cookies = deserializeAws_restXmlCookiePreference ( output [ "Cookies" ] , context ) ; } if ( output [ "Headers" ] !== undefined ) { contents . Headers = deserializeAws_restXmlHeaders ( output [ "Headers" ] , context ) ; } if ( output [ "QueryStringCacheKeys" ] !== undefined ) { contents . QueryStringCacheKeys = deserializeAws_restXmlQueryStringCacheKeys ( output [ "QueryStringCacheKeys" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFunctionAssociation = ( output , context ) : FunctionAssociation => { const contents = { FunctionARN : undefined , EventType : undefined , } ; if ( output [ "FunctionARN" ] !== undefined ) { contents . FunctionARN = __expectString ( output [ "FunctionARN" ] ) ; } if ( output [ "EventType" ] !== undefined ) { contents . EventType = __expectString ( output [ "EventType" ] ) ; } return contents ; } ; const deserializeAws_restXmlFunctionAssociationList = ( output , context ) : FunctionAssociation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlFunctionAssociation ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlFunctionAssociations = ( output , context ) : FunctionAssociations => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "FunctionAssociation" ] !== undefined ) { contents . Items = deserializeAws_restXmlFunctionAssociationList ( __getArrayIfSingleItem ( output [ "Items" ] [ "FunctionAssociation" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlFunctionConfig = ( output , context ) : FunctionConfig => { const contents = { Comment : undefined , Runtime : undefined , } ; if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "Runtime" ] !== undefined ) { contents . Runtime = __expectString ( output [ "Runtime" ] ) ; } return contents ; } ; const deserializeAws_restXmlFunctionExecutionLogList = ( 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_restXmlFunctionList = ( output , context ) : FunctionList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "FunctionSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlFunctionSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "FunctionSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlFunctionMetadata = ( output , context ) : FunctionMetadata => { const contents = { FunctionARN : undefined , Stage : undefined , CreatedTime : undefined , LastModifiedTime : undefined , } ; if ( output [ "FunctionARN" ] !== undefined ) { contents . FunctionARN = __expectString ( output [ "FunctionARN" ] ) ; } if ( output [ "Stage" ] !== undefined ) { contents . Stage = __expectString ( output [ "Stage" ] ) ; } if ( output [ "CreatedTime" ] !== undefined ) { contents . CreatedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreatedTime" ] ) ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } return contents ; } ; const deserializeAws_restXmlFunctionSummary = ( output , context ) : FunctionSummary => { const contents = { Name : undefined , Status : undefined , FunctionConfig : undefined , FunctionMetadata : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "FunctionConfig" ] !== undefined ) { contents . FunctionConfig = deserializeAws_restXmlFunctionConfig ( output [ "FunctionConfig" ] , context ) ; } if ( output [ "FunctionMetadata" ] !== undefined ) { contents . FunctionMetadata = deserializeAws_restXmlFunctionMetadata ( output [ "FunctionMetadata" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlFunctionSummaryList = ( output , context ) : FunctionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlFunctionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlGeoRestriction = ( output , context ) : GeoRestriction => { const contents = { RestrictionType : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "RestrictionType" ] !== undefined ) { contents . RestrictionType = __expectString ( output [ "RestrictionType" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Location" ] !== undefined ) { contents . Items = deserializeAws_restXmlLocationList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Location" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlHeaderList = ( 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_restXmlHeaders = ( output , context ) : Headers => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Name" ] !== undefined ) { contents . Items = deserializeAws_restXmlHeaderList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Name" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlInvalidation = ( output , context ) : Invalidation => { const contents = { Id : undefined , Status : undefined , CreateTime : undefined , InvalidationBatch : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "CreateTime" ] !== undefined ) { contents . CreateTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateTime" ] ) ) ; } if ( output [ "InvalidationBatch" ] !== undefined ) { contents . InvalidationBatch = deserializeAws_restXmlInvalidationBatch ( output [ "InvalidationBatch" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlInvalidationBatch = ( output , context ) : InvalidationBatch => { const contents = { Paths : undefined , CallerReference : undefined , } ; if ( output [ "Paths" ] !== undefined ) { contents . Paths = deserializeAws_restXmlPaths ( output [ "Paths" ] , context ) ; } if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidationList = ( output , context ) : InvalidationList => { const contents = { Marker : undefined , NextMarker : undefined , MaxItems : undefined , IsTruncated : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "InvalidationSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlInvalidationSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "InvalidationSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlInvalidationSummary = ( output , context ) : InvalidationSummary => { const contents = { Id : undefined , CreateTime : undefined , Status : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "CreateTime" ] !== undefined ) { contents . CreateTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateTime" ] ) ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } return contents ; } ; const deserializeAws_restXmlInvalidationSummaryList = ( output , context ) : InvalidationSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlInvalidationSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlKeyGroup = ( output , context ) : KeyGroup => { const contents = { Id : undefined , LastModifiedTime : undefined , KeyGroupConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "KeyGroupConfig" ] !== undefined ) { contents . KeyGroupConfig = deserializeAws_restXmlKeyGroupConfig ( output [ "KeyGroupConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlKeyGroupConfig = ( output , context ) : KeyGroupConfig => { const contents = { Name : undefined , Items : undefined , Comment : undefined , } ; if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "PublicKey" ] !== undefined ) { contents . Items = deserializeAws_restXmlPublicKeyIdList ( __getArrayIfSingleItem ( output [ "Items" ] [ "PublicKey" ] ) , context ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } return contents ; } ; const deserializeAws_restXmlKeyGroupList = ( output , context ) : KeyGroupList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "KeyGroupSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlKeyGroupSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "KeyGroupSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlKeyGroupSummary = ( output , context ) : KeyGroupSummary => { const contents = { KeyGroup : undefined , } ; if ( output [ "KeyGroup" ] !== undefined ) { contents . KeyGroup = deserializeAws_restXmlKeyGroup ( output [ "KeyGroup" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlKeyGroupSummaryList = ( output , context ) : KeyGroupSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlKeyGroupSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlKeyPairIdList = ( 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_restXmlKeyPairIds = ( output , context ) : KeyPairIds => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "KeyPairId" ] !== undefined ) { contents . Items = deserializeAws_restXmlKeyPairIdList ( __getArrayIfSingleItem ( output [ "Items" ] [ "KeyPairId" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlKGKeyPairIds = ( output , context ) : KGKeyPairIds => { const contents = { KeyGroupId : undefined , KeyPairIds : undefined , } ; if ( output [ "KeyGroupId" ] !== undefined ) { contents . KeyGroupId = __expectString ( output [ "KeyGroupId" ] ) ; } if ( output [ "KeyPairIds" ] !== undefined ) { contents . KeyPairIds = deserializeAws_restXmlKeyPairIds ( output [ "KeyPairIds" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlKGKeyPairIdsList = ( output , context ) : KGKeyPairIds [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlKGKeyPairIds ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlKinesisStreamConfig = ( output , context ) : KinesisStreamConfig => { const contents = { RoleARN : undefined , StreamARN : undefined , } ; if ( output [ "RoleARN" ] !== undefined ) { contents . RoleARN = __expectString ( output [ "RoleARN" ] ) ; } if ( output [ "StreamARN" ] !== undefined ) { contents . StreamARN = __expectString ( output [ "StreamARN" ] ) ; } return contents ; } ; const deserializeAws_restXmlLambdaFunctionAssociation = ( output , context ) : LambdaFunctionAssociation => { const contents = { LambdaFunctionARN : undefined , EventType : undefined , IncludeBody : undefined , } ; if ( output [ "LambdaFunctionARN" ] !== undefined ) { contents . LambdaFunctionARN = __expectString ( output [ "LambdaFunctionARN" ] ) ; } if ( output [ "EventType" ] !== undefined ) { contents . EventType = __expectString ( output [ "EventType" ] ) ; } if ( output [ "IncludeBody" ] !== undefined ) { contents . IncludeBody = __parseBoolean ( output [ "IncludeBody" ] ) ; } return contents ; } ; const deserializeAws_restXmlLambdaFunctionAssociationList = ( output , context ) : LambdaFunctionAssociation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlLambdaFunctionAssociation ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlLambdaFunctionAssociations = ( output , context ) : LambdaFunctionAssociations => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "LambdaFunctionAssociation" ] !== undefined ) { contents . Items = deserializeAws_restXmlLambdaFunctionAssociationList ( __getArrayIfSingleItem ( output [ "Items" ] [ "LambdaFunctionAssociation" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlLocationList = ( 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_restXmlLoggingConfig = ( output , context ) : LoggingConfig => { const contents = { Enabled : undefined , IncludeCookies : undefined , Bucket : undefined , Prefix : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "IncludeCookies" ] !== undefined ) { contents . IncludeCookies = __parseBoolean ( output [ "IncludeCookies" ] ) ; } if ( output [ "Bucket" ] !== undefined ) { contents . Bucket = __expectString ( output [ "Bucket" ] ) ; } if ( output [ "Prefix" ] !== undefined ) { contents . Prefix = __expectString ( output [ "Prefix" ] ) ; } return contents ; } ; const deserializeAws_restXmlMethodsList = ( output , context ) : ( Method | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restXmlMonitoringSubscription = ( output , context ) : MonitoringSubscription => { const contents = { RealtimeMetricsSubscriptionConfig : undefined , } ; if ( output [ "RealtimeMetricsSubscriptionConfig" ] !== undefined ) { contents . RealtimeMetricsSubscriptionConfig = deserializeAws_restXmlRealtimeMetricsSubscriptionConfig ( output [ "RealtimeMetricsSubscriptionConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOrigin = ( output , context ) : Origin => { const contents = { Id : undefined , DomainName : undefined , OriginPath : undefined , CustomHeaders : undefined , S3OriginConfig : undefined , CustomOriginConfig : undefined , ConnectionAttempts : undefined , ConnectionTimeout : undefined , OriginShield : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "DomainName" ] !== undefined ) { contents . DomainName = __expectString ( output [ "DomainName" ] ) ; } if ( output [ "OriginPath" ] !== undefined ) { contents . OriginPath = __expectString ( output [ "OriginPath" ] ) ; } if ( output [ "CustomHeaders" ] !== undefined ) { contents . CustomHeaders = deserializeAws_restXmlCustomHeaders ( output [ "CustomHeaders" ] , context ) ; } if ( output [ "S3OriginConfig" ] !== undefined ) { contents . S3OriginConfig = deserializeAws_restXmlS3OriginConfig ( output [ "S3OriginConfig" ] , context ) ; } if ( output [ "CustomOriginConfig" ] !== undefined ) { contents . CustomOriginConfig = deserializeAws_restXmlCustomOriginConfig ( output [ "CustomOriginConfig" ] , context ) ; } if ( output [ "ConnectionAttempts" ] !== undefined ) { contents . ConnectionAttempts = __strictParseInt32 ( output [ "ConnectionAttempts" ] ) as number ; } if ( output [ "ConnectionTimeout" ] !== undefined ) { contents . ConnectionTimeout = __strictParseInt32 ( output [ "ConnectionTimeout" ] ) as number ; } if ( output [ "OriginShield" ] !== undefined ) { contents . OriginShield = deserializeAws_restXmlOriginShield ( output [ "OriginShield" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginCustomHeader = ( output , context ) : OriginCustomHeader => { const contents = { HeaderName : undefined , HeaderValue : undefined , } ; if ( output [ "HeaderName" ] !== undefined ) { contents . HeaderName = __expectString ( output [ "HeaderName" ] ) ; } if ( output [ "HeaderValue" ] !== undefined ) { contents . HeaderValue = __expectString ( output [ "HeaderValue" ] ) ; } return contents ; } ; const deserializeAws_restXmlOriginCustomHeadersList = ( output , context ) : OriginCustomHeader [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlOriginCustomHeader ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlOriginGroup = ( output , context ) : OriginGroup => { const contents = { Id : undefined , FailoverCriteria : undefined , Members : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "FailoverCriteria" ] !== undefined ) { contents . FailoverCriteria = deserializeAws_restXmlOriginGroupFailoverCriteria ( output [ "FailoverCriteria" ] , context ) ; } if ( output [ "Members" ] !== undefined ) { contents . Members = deserializeAws_restXmlOriginGroupMembers ( output [ "Members" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginGroupFailoverCriteria = ( output , context ) : OriginGroupFailoverCriteria => { const contents = { StatusCodes : undefined , } ; if ( output [ "StatusCodes" ] !== undefined ) { contents . StatusCodes = deserializeAws_restXmlStatusCodes ( output [ "StatusCodes" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginGroupList = ( output , context ) : OriginGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlOriginGroup ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlOriginGroupMember = ( output , context ) : OriginGroupMember => { const contents = { OriginId : undefined , } ; if ( output [ "OriginId" ] !== undefined ) { contents . OriginId = __expectString ( output [ "OriginId" ] ) ; } return contents ; } ; const deserializeAws_restXmlOriginGroupMemberList = ( output , context ) : OriginGroupMember [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlOriginGroupMember ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlOriginGroupMembers = ( output , context ) : OriginGroupMembers => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "OriginGroupMember" ] !== undefined ) { contents . Items = deserializeAws_restXmlOriginGroupMemberList ( __getArrayIfSingleItem ( output [ "Items" ] [ "OriginGroupMember" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginGroups = ( output , context ) : OriginGroups => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "OriginGroup" ] !== undefined ) { contents . Items = deserializeAws_restXmlOriginGroupList ( __getArrayIfSingleItem ( output [ "Items" ] [ "OriginGroup" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginList = ( output , context ) : Origin [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlOrigin ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlOriginRequestPolicy = ( output , context ) : OriginRequestPolicy => { const contents = { Id : undefined , LastModifiedTime : undefined , OriginRequestPolicyConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "OriginRequestPolicyConfig" ] !== undefined ) { contents . OriginRequestPolicyConfig = deserializeAws_restXmlOriginRequestPolicyConfig ( output [ "OriginRequestPolicyConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyConfig = ( output , context ) : OriginRequestPolicyConfig => { const contents = { Comment : undefined , Name : undefined , HeadersConfig : undefined , CookiesConfig : undefined , QueryStringsConfig : undefined , } ; if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "HeadersConfig" ] !== undefined ) { contents . HeadersConfig = deserializeAws_restXmlOriginRequestPolicyHeadersConfig ( output [ "HeadersConfig" ] , context ) ; } if ( output [ "CookiesConfig" ] !== undefined ) { contents . CookiesConfig = deserializeAws_restXmlOriginRequestPolicyCookiesConfig ( output [ "CookiesConfig" ] , context ) ; } if ( output [ "QueryStringsConfig" ] !== undefined ) { contents . QueryStringsConfig = deserializeAws_restXmlOriginRequestPolicyQueryStringsConfig ( output [ "QueryStringsConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyCookiesConfig = ( output , context ) : OriginRequestPolicyCookiesConfig => { const contents = { CookieBehavior : undefined , Cookies : undefined , } ; if ( output [ "CookieBehavior" ] !== undefined ) { contents . CookieBehavior = __expectString ( output [ "CookieBehavior" ] ) ; } if ( output [ "Cookies" ] !== undefined ) { contents . Cookies = deserializeAws_restXmlCookieNames ( output [ "Cookies" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyHeadersConfig = ( output , context ) : OriginRequestPolicyHeadersConfig => { const contents = { HeaderBehavior : undefined , Headers : undefined , } ; if ( output [ "HeaderBehavior" ] !== undefined ) { contents . HeaderBehavior = __expectString ( output [ "HeaderBehavior" ] ) ; } if ( output [ "Headers" ] !== undefined ) { contents . Headers = deserializeAws_restXmlHeaders ( output [ "Headers" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyList = ( output , context ) : OriginRequestPolicyList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "OriginRequestPolicySummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlOriginRequestPolicySummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "OriginRequestPolicySummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicyQueryStringsConfig = ( output , context ) : OriginRequestPolicyQueryStringsConfig => { const contents = { QueryStringBehavior : undefined , QueryStrings : undefined , } ; if ( output [ "QueryStringBehavior" ] !== undefined ) { contents . QueryStringBehavior = __expectString ( output [ "QueryStringBehavior" ] ) ; } if ( output [ "QueryStrings" ] !== undefined ) { contents . QueryStrings = deserializeAws_restXmlQueryStringNames ( output [ "QueryStrings" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicySummary = ( output , context ) : OriginRequestPolicySummary => { const contents = { Type : undefined , OriginRequestPolicy : undefined , } ; if ( output [ "Type" ] !== undefined ) { contents . Type = __expectString ( output [ "Type" ] ) ; } if ( output [ "OriginRequestPolicy" ] !== undefined ) { contents . OriginRequestPolicy = deserializeAws_restXmlOriginRequestPolicy ( output [ "OriginRequestPolicy" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginRequestPolicySummaryList = ( output , context ) : OriginRequestPolicySummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlOriginRequestPolicySummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlOrigins = ( output , context ) : Origins => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Origin" ] !== undefined ) { contents . Items = deserializeAws_restXmlOriginList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Origin" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlOriginShield = ( output , context ) : OriginShield => { const contents = { Enabled : undefined , OriginShieldRegion : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "OriginShieldRegion" ] !== undefined ) { contents . OriginShieldRegion = __expectString ( output [ "OriginShieldRegion" ] ) ; } return contents ; } ; const deserializeAws_restXmlOriginSslProtocols = ( output , context ) : OriginSslProtocols => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "SslProtocol" ] !== undefined ) { contents . Items = deserializeAws_restXmlSslProtocolsList ( __getArrayIfSingleItem ( output [ "Items" ] [ "SslProtocol" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlParametersInCacheKeyAndForwardedToOrigin = ( output , context ) : ParametersInCacheKeyAndForwardedToOrigin => { const contents = { EnableAcceptEncodingGzip : undefined , EnableAcceptEncodingBrotli : undefined , HeadersConfig : undefined , CookiesConfig : undefined , QueryStringsConfig : undefined , } ; if ( output [ "EnableAcceptEncodingGzip" ] !== undefined ) { contents . EnableAcceptEncodingGzip = __parseBoolean ( output [ "EnableAcceptEncodingGzip" ] ) ; } if ( output [ "EnableAcceptEncodingBrotli" ] !== undefined ) { contents . EnableAcceptEncodingBrotli = __parseBoolean ( output [ "EnableAcceptEncodingBrotli" ] ) ; } if ( output [ "HeadersConfig" ] !== undefined ) { contents . HeadersConfig = deserializeAws_restXmlCachePolicyHeadersConfig ( output [ "HeadersConfig" ] , context ) ; } if ( output [ "CookiesConfig" ] !== undefined ) { contents . CookiesConfig = deserializeAws_restXmlCachePolicyCookiesConfig ( output [ "CookiesConfig" ] , context ) ; } if ( output [ "QueryStringsConfig" ] !== undefined ) { contents . QueryStringsConfig = deserializeAws_restXmlCachePolicyQueryStringsConfig ( output [ "QueryStringsConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlPathList = ( 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_restXmlPaths = ( output , context ) : Paths => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Path" ] !== undefined ) { contents . Items = deserializeAws_restXmlPathList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Path" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlPublicKey = ( output , context ) : PublicKey => { const contents = { Id : undefined , CreatedTime : undefined , PublicKeyConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "CreatedTime" ] !== undefined ) { contents . CreatedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreatedTime" ] ) ) ; } if ( output [ "PublicKeyConfig" ] !== undefined ) { contents . PublicKeyConfig = deserializeAws_restXmlPublicKeyConfig ( output [ "PublicKeyConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlPublicKeyConfig = ( output , context ) : PublicKeyConfig => { const contents = { CallerReference : undefined , Name : undefined , EncodedKey : undefined , Comment : undefined , } ; if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "EncodedKey" ] !== undefined ) { contents . EncodedKey = __expectString ( output [ "EncodedKey" ] ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } return contents ; } ; const deserializeAws_restXmlPublicKeyIdList = ( 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_restXmlPublicKeyList = ( output , context ) : PublicKeyList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "PublicKeySummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlPublicKeySummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "PublicKeySummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlPublicKeySummary = ( output , context ) : PublicKeySummary => { const contents = { Id : undefined , Name : undefined , CreatedTime : undefined , EncodedKey : undefined , Comment : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "CreatedTime" ] !== undefined ) { contents . CreatedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreatedTime" ] ) ) ; } if ( output [ "EncodedKey" ] !== undefined ) { contents . EncodedKey = __expectString ( output [ "EncodedKey" ] ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } return contents ; } ; const deserializeAws_restXmlPublicKeySummaryList = ( output , context ) : PublicKeySummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlPublicKeySummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlQueryArgProfile = ( output , context ) : QueryArgProfile => { const contents = { QueryArg : undefined , ProfileId : undefined , } ; if ( output [ "QueryArg" ] !== undefined ) { contents . QueryArg = __expectString ( output [ "QueryArg" ] ) ; } if ( output [ "ProfileId" ] !== undefined ) { contents . ProfileId = __expectString ( output [ "ProfileId" ] ) ; } return contents ; } ; const deserializeAws_restXmlQueryArgProfileConfig = ( output , context ) : QueryArgProfileConfig => { const contents = { ForwardWhenQueryArgProfileIsUnknown : undefined , QueryArgProfiles : undefined , } ; if ( output [ "ForwardWhenQueryArgProfileIsUnknown" ] !== undefined ) { contents . ForwardWhenQueryArgProfileIsUnknown = __parseBoolean ( output [ "ForwardWhenQueryArgProfileIsUnknown" ] ) ; } if ( output [ "QueryArgProfiles" ] !== undefined ) { contents . QueryArgProfiles = deserializeAws_restXmlQueryArgProfiles ( output [ "QueryArgProfiles" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlQueryArgProfileList = ( output , context ) : QueryArgProfile [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlQueryArgProfile ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlQueryArgProfiles = ( output , context ) : QueryArgProfiles => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "QueryArgProfile" ] !== undefined ) { contents . Items = deserializeAws_restXmlQueryArgProfileList ( __getArrayIfSingleItem ( output [ "Items" ] [ "QueryArgProfile" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlQueryStringCacheKeys = ( output , context ) : QueryStringCacheKeys => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Name" ] !== undefined ) { contents . Items = deserializeAws_restXmlQueryStringCacheKeysList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Name" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlQueryStringCacheKeysList = ( 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_restXmlQueryStringNames = ( output , context ) : QueryStringNames => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Name" ] !== undefined ) { contents . Items = deserializeAws_restXmlQueryStringNamesList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Name" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlQueryStringNamesList = ( 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_restXmlRealtimeLogConfig = ( output , context ) : RealtimeLogConfig => { const contents = { ARN : undefined , Name : undefined , SamplingRate : undefined , EndPoints : undefined , Fields : undefined , } ; if ( output [ "ARN" ] !== undefined ) { contents . ARN = __expectString ( output [ "ARN" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "SamplingRate" ] !== undefined ) { contents . SamplingRate = __strictParseLong ( output [ "SamplingRate" ] ) as number ; } if ( output . EndPoints === "" ) { contents . EndPoints = [ ] ; } if ( output [ "EndPoints" ] !== undefined && output [ "EndPoints" ] [ "member" ] !== undefined ) { contents . EndPoints = deserializeAws_restXmlEndPointList ( __getArrayIfSingleItem ( output [ "EndPoints" ] [ "member" ] ) , context ) ; } if ( output . Fields === "" ) { contents . Fields = [ ] ; } if ( output [ "Fields" ] !== undefined && output [ "Fields" ] [ "Field" ] !== undefined ) { contents . Fields = deserializeAws_restXmlFieldList ( __getArrayIfSingleItem ( output [ "Fields" ] [ "Field" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlRealtimeLogConfigList = ( output , context ) : RealtimeLogConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlRealtimeLogConfig ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlRealtimeLogConfigs = ( output , context ) : RealtimeLogConfigs => { const contents = { MaxItems : undefined , Items : undefined , IsTruncated : undefined , Marker : undefined , NextMarker : undefined , } ; if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "member" ] !== undefined ) { contents . Items = deserializeAws_restXmlRealtimeLogConfigList ( __getArrayIfSingleItem ( output [ "Items" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } return contents ; } ; const deserializeAws_restXmlRealtimeMetricsSubscriptionConfig = ( output , context ) : RealtimeMetricsSubscriptionConfig => { const contents = { RealtimeMetricsSubscriptionStatus : undefined , } ; if ( output [ "RealtimeMetricsSubscriptionStatus" ] !== undefined ) { contents . RealtimeMetricsSubscriptionStatus = __expectString ( output [ "RealtimeMetricsSubscriptionStatus" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicy = ( output , context ) : ResponseHeadersPolicy => { const contents = { Id : undefined , LastModifiedTime : undefined , ResponseHeadersPolicyConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "ResponseHeadersPolicyConfig" ] !== undefined ) { contents . ResponseHeadersPolicyConfig = deserializeAws_restXmlResponseHeadersPolicyConfig ( output [ "ResponseHeadersPolicyConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyAccessControlAllowHeaders = ( output , context ) : ResponseHeadersPolicyAccessControlAllowHeaders => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Header" ] !== undefined ) { contents . Items = deserializeAws_restXmlAccessControlAllowHeadersList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Header" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyAccessControlAllowMethods = ( output , context ) : ResponseHeadersPolicyAccessControlAllowMethods => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Method" ] !== undefined ) { contents . Items = deserializeAws_restXmlAccessControlAllowMethodsList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Method" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyAccessControlAllowOrigins = ( output , context ) : ResponseHeadersPolicyAccessControlAllowOrigins => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Origin" ] !== undefined ) { contents . Items = deserializeAws_restXmlAccessControlAllowOriginsList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Origin" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyAccessControlExposeHeaders = ( output , context ) : ResponseHeadersPolicyAccessControlExposeHeaders => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Header" ] !== undefined ) { contents . Items = deserializeAws_restXmlAccessControlExposeHeadersList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Header" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyConfig = ( output , context ) : ResponseHeadersPolicyConfig => { const contents = { Comment : undefined , Name : undefined , CorsConfig : undefined , SecurityHeadersConfig : undefined , CustomHeadersConfig : undefined , } ; if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "CorsConfig" ] !== undefined ) { contents . CorsConfig = deserializeAws_restXmlResponseHeadersPolicyCorsConfig ( output [ "CorsConfig" ] , context ) ; } if ( output [ "SecurityHeadersConfig" ] !== undefined ) { contents . SecurityHeadersConfig = deserializeAws_restXmlResponseHeadersPolicySecurityHeadersConfig ( output [ "SecurityHeadersConfig" ] , context ) ; } if ( output [ "CustomHeadersConfig" ] !== undefined ) { contents . CustomHeadersConfig = deserializeAws_restXmlResponseHeadersPolicyCustomHeadersConfig ( output [ "CustomHeadersConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyContentSecurityPolicy = ( output , context ) : ResponseHeadersPolicyContentSecurityPolicy => { const contents = { Override : undefined , ContentSecurityPolicy : undefined , } ; if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } if ( output [ "ContentSecurityPolicy" ] !== undefined ) { contents . ContentSecurityPolicy = __expectString ( output [ "ContentSecurityPolicy" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyContentTypeOptions = ( output , context ) : ResponseHeadersPolicyContentTypeOptions => { const contents = { Override : undefined , } ; if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyCorsConfig = ( output , context ) : ResponseHeadersPolicyCorsConfig => { const contents = { AccessControlAllowOrigins : undefined , AccessControlAllowHeaders : undefined , AccessControlAllowMethods : undefined , AccessControlAllowCredentials : undefined , AccessControlExposeHeaders : undefined , AccessControlMaxAgeSec : undefined , OriginOverride : undefined , } ; if ( output [ "AccessControlAllowOrigins" ] !== undefined ) { contents . AccessControlAllowOrigins = deserializeAws_restXmlResponseHeadersPolicyAccessControlAllowOrigins ( output [ "AccessControlAllowOrigins" ] , context ) ; } if ( output [ "AccessControlAllowHeaders" ] !== undefined ) { contents . AccessControlAllowHeaders = deserializeAws_restXmlResponseHeadersPolicyAccessControlAllowHeaders ( output [ "AccessControlAllowHeaders" ] , context ) ; } if ( output [ "AccessControlAllowMethods" ] !== undefined ) { contents . AccessControlAllowMethods = deserializeAws_restXmlResponseHeadersPolicyAccessControlAllowMethods ( output [ "AccessControlAllowMethods" ] , context ) ; } if ( output [ "AccessControlAllowCredentials" ] !== undefined ) { contents . AccessControlAllowCredentials = __parseBoolean ( output [ "AccessControlAllowCredentials" ] ) ; } if ( output [ "AccessControlExposeHeaders" ] !== undefined ) { contents . AccessControlExposeHeaders = deserializeAws_restXmlResponseHeadersPolicyAccessControlExposeHeaders ( output [ "AccessControlExposeHeaders" ] , context ) ; } if ( output [ "AccessControlMaxAgeSec" ] !== undefined ) { contents . AccessControlMaxAgeSec = __strictParseInt32 ( output [ "AccessControlMaxAgeSec" ] ) as number ; } if ( output [ "OriginOverride" ] !== undefined ) { contents . OriginOverride = __parseBoolean ( output [ "OriginOverride" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyCustomHeader = ( output , context ) : ResponseHeadersPolicyCustomHeader => { const contents = { Header : undefined , Value : undefined , Override : undefined , } ; if ( output [ "Header" ] !== undefined ) { contents . Header = __expectString ( output [ "Header" ] ) ; } if ( output [ "Value" ] !== undefined ) { contents . Value = __expectString ( output [ "Value" ] ) ; } if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyCustomHeaderList = ( output , context ) : ResponseHeadersPolicyCustomHeader [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlResponseHeadersPolicyCustomHeader ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlResponseHeadersPolicyCustomHeadersConfig = ( output , context ) : ResponseHeadersPolicyCustomHeadersConfig => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "ResponseHeadersPolicyCustomHeader" ] !== undefined ) { contents . Items = deserializeAws_restXmlResponseHeadersPolicyCustomHeaderList ( __getArrayIfSingleItem ( output [ "Items" ] [ "ResponseHeadersPolicyCustomHeader" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyFrameOptions = ( output , context ) : ResponseHeadersPolicyFrameOptions => { const contents = { Override : undefined , FrameOption : undefined , } ; if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } if ( output [ "FrameOption" ] !== undefined ) { contents . FrameOption = __expectString ( output [ "FrameOption" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyList = ( output , context ) : ResponseHeadersPolicyList => { const contents = { NextMarker : undefined , MaxItems : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "ResponseHeadersPolicySummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlResponseHeadersPolicySummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "ResponseHeadersPolicySummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyReferrerPolicy = ( output , context ) : ResponseHeadersPolicyReferrerPolicy => { const contents = { Override : undefined , ReferrerPolicy : undefined , } ; if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } if ( output [ "ReferrerPolicy" ] !== undefined ) { contents . ReferrerPolicy = __expectString ( output [ "ReferrerPolicy" ] ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicySecurityHeadersConfig = ( output , context ) : ResponseHeadersPolicySecurityHeadersConfig => { const contents = { XSSProtection : undefined , FrameOptions : undefined , ReferrerPolicy : undefined , ContentSecurityPolicy : undefined , ContentTypeOptions : undefined , StrictTransportSecurity : undefined , } ; if ( output [ "XSSProtection" ] !== undefined ) { contents . XSSProtection = deserializeAws_restXmlResponseHeadersPolicyXSSProtection ( output [ "XSSProtection" ] , context ) ; } if ( output [ "FrameOptions" ] !== undefined ) { contents . FrameOptions = deserializeAws_restXmlResponseHeadersPolicyFrameOptions ( output [ "FrameOptions" ] , context ) ; } if ( output [ "ReferrerPolicy" ] !== undefined ) { contents . ReferrerPolicy = deserializeAws_restXmlResponseHeadersPolicyReferrerPolicy ( output [ "ReferrerPolicy" ] , context ) ; } if ( output [ "ContentSecurityPolicy" ] !== undefined ) { contents . ContentSecurityPolicy = deserializeAws_restXmlResponseHeadersPolicyContentSecurityPolicy ( output [ "ContentSecurityPolicy" ] , context ) ; } if ( output [ "ContentTypeOptions" ] !== undefined ) { contents . ContentTypeOptions = deserializeAws_restXmlResponseHeadersPolicyContentTypeOptions ( output [ "ContentTypeOptions" ] , context ) ; } if ( output [ "StrictTransportSecurity" ] !== undefined ) { contents . StrictTransportSecurity = deserializeAws_restXmlResponseHeadersPolicyStrictTransportSecurity ( output [ "StrictTransportSecurity" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicyStrictTransportSecurity = ( output , context ) : ResponseHeadersPolicyStrictTransportSecurity => { const contents = { Override : undefined , IncludeSubdomains : undefined , Preload : undefined , AccessControlMaxAgeSec : undefined , } ; if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } if ( output [ "IncludeSubdomains" ] !== undefined ) { contents . IncludeSubdomains = __parseBoolean ( output [ "IncludeSubdomains" ] ) ; } if ( output [ "Preload" ] !== undefined ) { contents . Preload = __parseBoolean ( output [ "Preload" ] ) ; } if ( output [ "AccessControlMaxAgeSec" ] !== undefined ) { contents . AccessControlMaxAgeSec = __strictParseInt32 ( output [ "AccessControlMaxAgeSec" ] ) as number ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicySummary = ( output , context ) : ResponseHeadersPolicySummary => { const contents = { Type : undefined , ResponseHeadersPolicy : undefined , } ; if ( output [ "Type" ] !== undefined ) { contents . Type = __expectString ( output [ "Type" ] ) ; } if ( output [ "ResponseHeadersPolicy" ] !== undefined ) { contents . ResponseHeadersPolicy = deserializeAws_restXmlResponseHeadersPolicy ( output [ "ResponseHeadersPolicy" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlResponseHeadersPolicySummaryList = ( output , context ) : ResponseHeadersPolicySummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlResponseHeadersPolicySummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlResponseHeadersPolicyXSSProtection = ( output , context ) : ResponseHeadersPolicyXSSProtection => { const contents = { Override : undefined , Protection : undefined , ModeBlock : undefined , ReportUri : undefined , } ; if ( output [ "Override" ] !== undefined ) { contents . Override = __parseBoolean ( output [ "Override" ] ) ; } if ( output [ "Protection" ] !== undefined ) { contents . Protection = __parseBoolean ( output [ "Protection" ] ) ; } if ( output [ "ModeBlock" ] !== undefined ) { contents . ModeBlock = __parseBoolean ( output [ "ModeBlock" ] ) ; } if ( output [ "ReportUri" ] !== undefined ) { contents . ReportUri = __expectString ( output [ "ReportUri" ] ) ; } return contents ; } ; const deserializeAws_restXmlRestrictions = ( output , context ) : Restrictions => { const contents = { GeoRestriction : undefined , } ; if ( output [ "GeoRestriction" ] !== undefined ) { contents . GeoRestriction = deserializeAws_restXmlGeoRestriction ( output [ "GeoRestriction" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlS3Origin = ( output , context ) : S3Origin => { const contents = { DomainName : undefined , OriginAccessIdentity : undefined , } ; if ( output [ "DomainName" ] !== undefined ) { contents . DomainName = __expectString ( output [ "DomainName" ] ) ; } if ( output [ "OriginAccessIdentity" ] !== undefined ) { contents . OriginAccessIdentity = __expectString ( output [ "OriginAccessIdentity" ] ) ; } return contents ; } ; const deserializeAws_restXmlS3OriginConfig = ( output , context ) : S3OriginConfig => { const contents = { OriginAccessIdentity : undefined , } ; if ( output [ "OriginAccessIdentity" ] !== undefined ) { contents . OriginAccessIdentity = __expectString ( output [ "OriginAccessIdentity" ] ) ; } return contents ; } ; const deserializeAws_restXmlSigner = ( output , context ) : Signer => { const contents = { AwsAccountNumber : undefined , KeyPairIds : undefined , } ; if ( output [ "AwsAccountNumber" ] !== undefined ) { contents . AwsAccountNumber = __expectString ( output [ "AwsAccountNumber" ] ) ; } if ( output [ "KeyPairIds" ] !== undefined ) { contents . KeyPairIds = deserializeAws_restXmlKeyPairIds ( output [ "KeyPairIds" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlSignerList = ( output , context ) : Signer [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlSigner ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlSslProtocolsList = ( output , context ) : ( SslProtocol | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restXmlStatusCodeList = ( output , context ) : number [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __strictParseInt32 ( entry ) as number ; } ) ; } ; const deserializeAws_restXmlStatusCodes = ( output , context ) : StatusCodes => { const contents = { Quantity : undefined , Items : undefined , } ; if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "StatusCode" ] !== undefined ) { contents . Items = deserializeAws_restXmlStatusCodeList ( __getArrayIfSingleItem ( output [ "Items" ] [ "StatusCode" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistribution = ( output , context ) : StreamingDistribution => { const contents = { Id : undefined , ARN : undefined , Status : undefined , LastModifiedTime : undefined , DomainName : undefined , ActiveTrustedSigners : undefined , StreamingDistributionConfig : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "ARN" ] !== undefined ) { contents . ARN = __expectString ( output [ "ARN" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "DomainName" ] !== undefined ) { contents . DomainName = __expectString ( output [ "DomainName" ] ) ; } if ( output [ "ActiveTrustedSigners" ] !== undefined ) { contents . ActiveTrustedSigners = deserializeAws_restXmlActiveTrustedSigners ( output [ "ActiveTrustedSigners" ] , context ) ; } if ( output [ "StreamingDistributionConfig" ] !== undefined ) { contents . StreamingDistributionConfig = deserializeAws_restXmlStreamingDistributionConfig ( output [ "StreamingDistributionConfig" ] , context ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistributionConfig = ( output , context ) : StreamingDistributionConfig => { const contents = { CallerReference : undefined , S3Origin : undefined , Aliases : undefined , Comment : undefined , Logging : undefined , TrustedSigners : undefined , PriceClass : undefined , Enabled : undefined , } ; if ( output [ "CallerReference" ] !== undefined ) { contents . CallerReference = __expectString ( output [ "CallerReference" ] ) ; } if ( output [ "S3Origin" ] !== undefined ) { contents . S3Origin = deserializeAws_restXmlS3Origin ( output [ "S3Origin" ] , context ) ; } if ( output [ "Aliases" ] !== undefined ) { contents . Aliases = deserializeAws_restXmlAliases ( output [ "Aliases" ] , context ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "Logging" ] !== undefined ) { contents . Logging = deserializeAws_restXmlStreamingLoggingConfig ( output [ "Logging" ] , context ) ; } if ( output [ "TrustedSigners" ] !== undefined ) { contents . TrustedSigners = deserializeAws_restXmlTrustedSigners ( output [ "TrustedSigners" ] , context ) ; } if ( output [ "PriceClass" ] !== undefined ) { contents . PriceClass = __expectString ( output [ "PriceClass" ] ) ; } if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistributionList = ( output , context ) : StreamingDistributionList => { const contents = { Marker : undefined , NextMarker : undefined , MaxItems : undefined , IsTruncated : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "NextMarker" ] !== undefined ) { contents . NextMarker = __expectString ( output [ "NextMarker" ] ) ; } if ( output [ "MaxItems" ] !== undefined ) { contents . MaxItems = __strictParseInt32 ( output [ "MaxItems" ] ) as number ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "StreamingDistributionSummary" ] !== undefined ) { contents . Items = deserializeAws_restXmlStreamingDistributionSummaryList ( __getArrayIfSingleItem ( output [ "Items" ] [ "StreamingDistributionSummary" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistributionSummary = ( output , context ) : StreamingDistributionSummary => { const contents = { Id : undefined , ARN : undefined , Status : undefined , LastModifiedTime : undefined , DomainName : undefined , S3Origin : undefined , Aliases : undefined , TrustedSigners : undefined , Comment : undefined , PriceClass : undefined , Enabled : undefined , } ; if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "ARN" ] !== undefined ) { contents . ARN = __expectString ( output [ "ARN" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "LastModifiedTime" ] !== undefined ) { contents . LastModifiedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastModifiedTime" ] ) ) ; } if ( output [ "DomainName" ] !== undefined ) { contents . DomainName = __expectString ( output [ "DomainName" ] ) ; } if ( output [ "S3Origin" ] !== undefined ) { contents . S3Origin = deserializeAws_restXmlS3Origin ( output [ "S3Origin" ] , context ) ; } if ( output [ "Aliases" ] !== undefined ) { contents . Aliases = deserializeAws_restXmlAliases ( output [ "Aliases" ] , context ) ; } if ( output [ "TrustedSigners" ] !== undefined ) { contents . TrustedSigners = deserializeAws_restXmlTrustedSigners ( output [ "TrustedSigners" ] , context ) ; } if ( output [ "Comment" ] !== undefined ) { contents . Comment = __expectString ( output [ "Comment" ] ) ; } if ( output [ "PriceClass" ] !== undefined ) { contents . PriceClass = __expectString ( output [ "PriceClass" ] ) ; } if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } return contents ; } ; const deserializeAws_restXmlStreamingDistributionSummaryList = ( output , context ) : StreamingDistributionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlStreamingDistributionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlStreamingLoggingConfig = ( output , context ) : StreamingLoggingConfig => { const contents = { Enabled : undefined , Bucket : undefined , Prefix : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "Bucket" ] !== undefined ) { contents . Bucket = __expectString ( output [ "Bucket" ] ) ; } if ( output [ "Prefix" ] !== undefined ) { contents . Prefix = __expectString ( output [ "Prefix" ] ) ; } return contents ; } ; const deserializeAws_restXmlTag = ( 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_restXmlTagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restXmlTag ( entry , context ) ; } ) ; } ; const deserializeAws_restXmlTags = ( output , context ) : Tags => { const contents = { Items : undefined , } ; if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "Tag" ] !== undefined ) { contents . Items = deserializeAws_restXmlTagList ( __getArrayIfSingleItem ( output [ "Items" ] [ "Tag" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlTestResult = ( output , context ) : TestResult => { const contents = { FunctionSummary : undefined , ComputeUtilization : undefined , FunctionExecutionLogs : undefined , FunctionErrorMessage : undefined , FunctionOutput : undefined , } ; if ( output [ "FunctionSummary" ] !== undefined ) { contents . FunctionSummary = deserializeAws_restXmlFunctionSummary ( output [ "FunctionSummary" ] , context ) ; } if ( output [ "ComputeUtilization" ] !== undefined ) { contents . ComputeUtilization = __expectString ( output [ "ComputeUtilization" ] ) ; } if ( output . FunctionExecutionLogs === "" ) { contents . FunctionExecutionLogs = [ ] ; } if ( output [ "FunctionExecutionLogs" ] !== undefined && output [ "FunctionExecutionLogs" ] [ "member" ] !== undefined ) { contents . FunctionExecutionLogs = deserializeAws_restXmlFunctionExecutionLogList ( __getArrayIfSingleItem ( output [ "FunctionExecutionLogs" ] [ "member" ] ) , context ) ; } if ( output [ "FunctionErrorMessage" ] !== undefined ) { contents . FunctionErrorMessage = __expectString ( output [ "FunctionErrorMessage" ] ) ; } if ( output [ "FunctionOutput" ] !== undefined ) { contents . FunctionOutput = __expectString ( output [ "FunctionOutput" ] ) ; } return contents ; } ; const deserializeAws_restXmlTrustedKeyGroupIdList = ( 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_restXmlTrustedKeyGroups = ( output , context ) : TrustedKeyGroups => { const contents = { Enabled : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "KeyGroup" ] !== undefined ) { contents . Items = deserializeAws_restXmlTrustedKeyGroupIdList ( __getArrayIfSingleItem ( output [ "Items" ] [ "KeyGroup" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlTrustedSigners = ( output , context ) : TrustedSigners => { const contents = { Enabled : undefined , Quantity : undefined , Items : undefined , } ; if ( output [ "Enabled" ] !== undefined ) { contents . Enabled = __parseBoolean ( output [ "Enabled" ] ) ; } if ( output [ "Quantity" ] !== undefined ) { contents . Quantity = __strictParseInt32 ( output [ "Quantity" ] ) as number ; } if ( output . Items === "" ) { contents . Items = [ ] ; } if ( output [ "Items" ] !== undefined && output [ "Items" ] [ "AwsAccountNumber" ] !== undefined ) { contents . Items = deserializeAws_restXmlAwsAccountNumberList ( __getArrayIfSingleItem ( output [ "Items" ] [ "AwsAccountNumber" ] ) , context ) ; } return contents ; } ; const deserializeAws_restXmlViewerCertificate = ( output , context ) : ViewerCertificate => { const contents = { CloudFrontDefaultCertificate : undefined , IAMCertificateId : undefined , ACMCertificateArn : undefined , SSLSupportMethod : undefined , MinimumProtocolVersion : undefined , Certificate : undefined , CertificateSource : undefined , } ; if ( output [ "CloudFrontDefaultCertificate" ] !== undefined ) { contents . CloudFrontDefaultCertificate = __parseBoolean ( output [ "CloudFrontDefaultCertificate" ] ) ; } if ( output [ "IAMCertificateId" ] !== undefined ) { contents . IAMCertificateId = __expectString ( output [ "IAMCertificateId" ] ) ; } if ( output [ "ACMCertificateArn" ] !== undefined ) { contents . ACMCertificateArn = __expectString ( output [ "ACMCertificateArn" ] ) ; } if ( output [ "SSLSupportMethod" ] !== undefined ) { contents . SSLSupportMethod = __expectString ( output [ "SSLSupportMethod" ] ) ; } if ( output [ "MinimumProtocolVersion" ] !== undefined ) { contents . MinimumProtocolVersion = __expectString ( output [ "MinimumProtocolVersion" ] ) ; } if ( output [ "Certificate" ] !== undefined ) { contents . Certificate = __expectString ( output [ "Certificate" ] ) ; } if ( output [ "CertificateSource" ] !== undefined ) { contents . CertificateSource = __expectString ( output [ "CertificateSource" ] ) ; } return contents ; } ; 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 isSerializableHeaderValue = ( value ) : boolean => value !== undefined && value !== null && value !== "" && ( ! Object . getOwnPropertyNames ( value ) . includes ( "length" ) || value . length != 0 ) && ( ! Object . getOwnPropertyNames ( value ) . includes ( "size" ) || value . size != 0 ) ; 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 loadRestXmlErrorCode = ( output , data ) : string => { if ( data . Error . Code !== undefined ) { return data . Error . Code ; } if ( output . statusCode == 404 ) { return "NotFound" ; } return "" ; } ;