import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , limitedParseDouble as __limitedParseDouble , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { AcceptDomainTransferFromAnotherAwsAccountCommandInput , AcceptDomainTransferFromAnotherAwsAccountCommandOutput , } from "../commands/AcceptDomainTransferFromAnotherAwsAccountCommand" ; import { CancelDomainTransferToAnotherAwsAccountCommandInput , CancelDomainTransferToAnotherAwsAccountCommandOutput , } from "../commands/CancelDomainTransferToAnotherAwsAccountCommand" ; import { CheckDomainAvailabilityCommandInput , CheckDomainAvailabilityCommandOutput , } from "../commands/CheckDomainAvailabilityCommand" ; import { CheckDomainTransferabilityCommandInput , CheckDomainTransferabilityCommandOutput , } from "../commands/CheckDomainTransferabilityCommand" ; import { DeleteDomainCommandInput , DeleteDomainCommandOutput } from "../commands/DeleteDomainCommand" ; import { DeleteTagsForDomainCommandInput , DeleteTagsForDomainCommandOutput , } from "../commands/DeleteTagsForDomainCommand" ; import { DisableDomainAutoRenewCommandInput , DisableDomainAutoRenewCommandOutput , } from "../commands/DisableDomainAutoRenewCommand" ; import { DisableDomainTransferLockCommandInput , DisableDomainTransferLockCommandOutput , } from "../commands/DisableDomainTransferLockCommand" ; import { EnableDomainAutoRenewCommandInput , EnableDomainAutoRenewCommandOutput , } from "../commands/EnableDomainAutoRenewCommand" ; import { EnableDomainTransferLockCommandInput , EnableDomainTransferLockCommandOutput , } from "../commands/EnableDomainTransferLockCommand" ; import { GetContactReachabilityStatusCommandInput , GetContactReachabilityStatusCommandOutput , } from "../commands/GetContactReachabilityStatusCommand" ; import { GetDomainDetailCommandInput , GetDomainDetailCommandOutput } from "../commands/GetDomainDetailCommand" ; import { GetDomainSuggestionsCommandInput , GetDomainSuggestionsCommandOutput , } from "../commands/GetDomainSuggestionsCommand" ; import { GetOperationDetailCommandInput , GetOperationDetailCommandOutput } from "../commands/GetOperationDetailCommand" ; import { ListDomainsCommandInput , ListDomainsCommandOutput } from "../commands/ListDomainsCommand" ; import { ListOperationsCommandInput , ListOperationsCommandOutput } from "../commands/ListOperationsCommand" ; import { ListPricesCommandInput , ListPricesCommandOutput } from "../commands/ListPricesCommand" ; import { ListTagsForDomainCommandInput , ListTagsForDomainCommandOutput } from "../commands/ListTagsForDomainCommand" ; import { RegisterDomainCommandInput , RegisterDomainCommandOutput } from "../commands/RegisterDomainCommand" ; import { RejectDomainTransferFromAnotherAwsAccountCommandInput , RejectDomainTransferFromAnotherAwsAccountCommandOutput , } from "../commands/RejectDomainTransferFromAnotherAwsAccountCommand" ; import { RenewDomainCommandInput , RenewDomainCommandOutput } from "../commands/RenewDomainCommand" ; import { ResendContactReachabilityEmailCommandInput , ResendContactReachabilityEmailCommandOutput , } from "../commands/ResendContactReachabilityEmailCommand" ; import { RetrieveDomainAuthCodeCommandInput , RetrieveDomainAuthCodeCommandOutput , } from "../commands/RetrieveDomainAuthCodeCommand" ; import { TransferDomainCommandInput , TransferDomainCommandOutput } from "../commands/TransferDomainCommand" ; import { TransferDomainToAnotherAwsAccountCommandInput , TransferDomainToAnotherAwsAccountCommandOutput , } from "../commands/TransferDomainToAnotherAwsAccountCommand" ; import { UpdateDomainContactCommandInput , UpdateDomainContactCommandOutput , } from "../commands/UpdateDomainContactCommand" ; import { UpdateDomainContactPrivacyCommandInput , UpdateDomainContactPrivacyCommandOutput , } from "../commands/UpdateDomainContactPrivacyCommand" ; import { UpdateDomainNameserversCommandInput , UpdateDomainNameserversCommandOutput , } from "../commands/UpdateDomainNameserversCommand" ; import { UpdateTagsForDomainCommandInput , UpdateTagsForDomainCommandOutput , } from "../commands/UpdateTagsForDomainCommand" ; import { ViewBillingCommandInput , ViewBillingCommandOutput } from "../commands/ViewBillingCommand" ; import { AcceptDomainTransferFromAnotherAwsAccountRequest , AcceptDomainTransferFromAnotherAwsAccountResponse , BillingRecord , CancelDomainTransferToAnotherAwsAccountRequest , CancelDomainTransferToAnotherAwsAccountResponse , CheckDomainAvailabilityRequest , CheckDomainAvailabilityResponse , CheckDomainTransferabilityRequest , CheckDomainTransferabilityResponse , ContactDetail , DeleteDomainRequest , DeleteDomainResponse , DeleteTagsForDomainRequest , DeleteTagsForDomainResponse , DisableDomainAutoRenewRequest , DisableDomainAutoRenewResponse , DisableDomainTransferLockRequest , DisableDomainTransferLockResponse , DomainLimitExceeded , DomainPrice , DomainSuggestion , DomainSummary , DomainTransferability , DuplicateRequest , EnableDomainAutoRenewRequest , EnableDomainAutoRenewResponse , EnableDomainTransferLockRequest , EnableDomainTransferLockResponse , ExtraParam , FilterCondition , GetContactReachabilityStatusRequest , GetContactReachabilityStatusResponse , GetDomainDetailRequest , GetDomainDetailResponse , GetDomainSuggestionsRequest , GetDomainSuggestionsResponse , GetOperationDetailRequest , GetOperationDetailResponse , InvalidInput , ListDomainsRequest , ListDomainsResponse , ListOperationsRequest , ListOperationsResponse , ListPricesRequest , ListPricesResponse , ListTagsForDomainRequest , ListTagsForDomainResponse , Nameserver , OperationLimitExceeded , OperationSummary , PriceWithCurrency , RegisterDomainRequest , RegisterDomainResponse , RejectDomainTransferFromAnotherAwsAccountRequest , RejectDomainTransferFromAnotherAwsAccountResponse , RenewDomainRequest , RenewDomainResponse , ResendContactReachabilityEmailRequest , ResendContactReachabilityEmailResponse , RetrieveDomainAuthCodeRequest , RetrieveDomainAuthCodeResponse , SortCondition , Tag , TLDRulesViolation , TransferDomainRequest , TransferDomainResponse , TransferDomainToAnotherAwsAccountRequest , TransferDomainToAnotherAwsAccountResponse , UnsupportedTLD , UpdateDomainContactPrivacyRequest , UpdateDomainContactPrivacyResponse , UpdateDomainContactRequest , UpdateDomainContactResponse , UpdateDomainNameserversRequest , UpdateDomainNameserversResponse , UpdateTagsForDomainRequest , UpdateTagsForDomainResponse , ViewBillingRequest , ViewBillingResponse , } from "../models/models_0" ; export const serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.AcceptDomainTransferFromAnotherAwsAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.CancelDomainTransferToAnotherAwsAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CheckDomainAvailabilityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.CheckDomainAvailability" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CheckDomainAvailabilityRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CheckDomainTransferabilityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.CheckDomainTransferability" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CheckDomainTransferabilityRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.DeleteDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteTagsForDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.DeleteTagsForDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteTagsForDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DisableDomainAutoRenewCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.DisableDomainAutoRenew" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DisableDomainAutoRenewRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DisableDomainTransferLockCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.DisableDomainTransferLock" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DisableDomainTransferLockRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1EnableDomainAutoRenewCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.EnableDomainAutoRenew" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1EnableDomainAutoRenewRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1EnableDomainTransferLockCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.EnableDomainTransferLock" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1EnableDomainTransferLockRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetContactReachabilityStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.GetContactReachabilityStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetContactReachabilityStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDomainDetailCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.GetDomainDetail" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDomainDetailRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDomainSuggestionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.GetDomainSuggestions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDomainSuggestionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetOperationDetailCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.GetOperationDetail" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetOperationDetailRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListDomainsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.ListDomains" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListDomainsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListOperationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.ListOperations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListOperationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListPricesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.ListPrices" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListPricesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListTagsForDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.ListTagsForDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RegisterDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.RegisterDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RegisterDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.RejectDomainTransferFromAnotherAwsAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RenewDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.RenewDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RenewDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ResendContactReachabilityEmailCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.ResendContactReachabilityEmail" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ResendContactReachabilityEmailRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RetrieveDomainAuthCodeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.RetrieveDomainAuthCode" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RetrieveDomainAuthCodeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TransferDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.TransferDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TransferDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TransferDomainToAnotherAwsAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.TransferDomainToAnotherAwsAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TransferDomainToAnotherAwsAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDomainContactCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.UpdateDomainContact" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDomainContactRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDomainContactPrivacyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.UpdateDomainContactPrivacy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDomainContactPrivacyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDomainNameserversCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.UpdateDomainNameservers" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDomainNameserversRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateTagsForDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.UpdateTagsForDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateTagsForDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ViewBillingCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "Route53Domains_v20140515.ViewBilling" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ViewBillingRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommand = async ( output , context ) : Promise < AcceptDomainTransferFromAnotherAwsAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountCommandError = async ( output , context ) : Promise < AcceptDomainTransferFromAnotherAwsAccountCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DomainLimitExceeded" : case "com.amazonaws.route53domains#DomainLimitExceeded" : response = { ... ( await deserializeAws_json1_1DomainLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1CancelDomainTransferToAnotherAwsAccountCommand = async ( output , context ) : Promise < CancelDomainTransferToAnotherAwsAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountCommandError = async ( output , context ) : Promise < CancelDomainTransferToAnotherAwsAccountCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1CheckDomainAvailabilityCommand = async ( output , context ) : Promise < CheckDomainAvailabilityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CheckDomainAvailabilityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CheckDomainAvailabilityResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CheckDomainAvailabilityCommandError = async ( output , context ) : Promise < CheckDomainAvailabilityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1CheckDomainTransferabilityCommand = async ( output , context ) : Promise < CheckDomainTransferabilityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CheckDomainTransferabilityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CheckDomainTransferabilityResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CheckDomainTransferabilityCommandError = async ( output , context ) : Promise < CheckDomainTransferabilityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1DeleteDomainCommand = async ( output , context ) : Promise < DeleteDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteDomainCommandError = async ( output , context ) : Promise < DeleteDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1DeleteTagsForDomainCommand = async ( output , context ) : Promise < DeleteTagsForDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteTagsForDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteTagsForDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteTagsForDomainCommandError = async ( output , context ) : Promise < DeleteTagsForDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1DisableDomainAutoRenewCommand = async ( output , context ) : Promise < DisableDomainAutoRenewCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DisableDomainAutoRenewCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DisableDomainAutoRenewResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DisableDomainAutoRenewCommandError = async ( output , context ) : Promise < DisableDomainAutoRenewCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1DisableDomainTransferLockCommand = async ( output , context ) : Promise < DisableDomainTransferLockCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DisableDomainTransferLockCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DisableDomainTransferLockResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DisableDomainTransferLockCommandError = async ( output , context ) : Promise < DisableDomainTransferLockCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1EnableDomainAutoRenewCommand = async ( output , context ) : Promise < EnableDomainAutoRenewCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1EnableDomainAutoRenewCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1EnableDomainAutoRenewResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1EnableDomainAutoRenewCommandError = async ( output , context ) : Promise < EnableDomainAutoRenewCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1EnableDomainTransferLockCommand = async ( output , context ) : Promise < EnableDomainTransferLockCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1EnableDomainTransferLockCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1EnableDomainTransferLockResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1EnableDomainTransferLockCommandError = async ( output , context ) : Promise < EnableDomainTransferLockCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1GetContactReachabilityStatusCommand = async ( output , context ) : Promise < GetContactReachabilityStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetContactReachabilityStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetContactReachabilityStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetContactReachabilityStatusCommandError = async ( output , context ) : Promise < GetContactReachabilityStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1GetDomainDetailCommand = async ( output , context ) : Promise < GetDomainDetailCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDomainDetailCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDomainDetailResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDomainDetailCommandError = async ( output , context ) : Promise < GetDomainDetailCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1GetDomainSuggestionsCommand = async ( output , context ) : Promise < GetDomainSuggestionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDomainSuggestionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDomainSuggestionsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDomainSuggestionsCommandError = async ( output , context ) : Promise < GetDomainSuggestionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1GetOperationDetailCommand = async ( output , context ) : Promise < GetOperationDetailCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetOperationDetailCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetOperationDetailResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetOperationDetailCommandError = async ( output , context ) : Promise < GetOperationDetailCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1ListDomainsCommand = async ( output , context ) : Promise < ListDomainsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListDomainsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListDomainsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListDomainsCommandError = async ( output , context ) : Promise < ListDomainsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1ListOperationsCommand = async ( output , context ) : Promise < ListOperationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListOperationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListOperationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListOperationsCommandError = async ( output , context ) : Promise < ListOperationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1ListPricesCommand = async ( output , context ) : Promise < ListPricesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListPricesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListPricesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListPricesCommandError = async ( output , context ) : Promise < ListPricesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1ListTagsForDomainCommand = async ( output , context ) : Promise < ListTagsForDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTagsForDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTagsForDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTagsForDomainCommandError = async ( output , context ) : Promise < ListTagsForDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1RegisterDomainCommand = async ( output , context ) : Promise < RegisterDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RegisterDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RegisterDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RegisterDomainCommandError = async ( output , context ) : Promise < RegisterDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DomainLimitExceeded" : case "com.amazonaws.route53domains#DomainLimitExceeded" : response = { ... ( await deserializeAws_json1_1DomainLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1RejectDomainTransferFromAnotherAwsAccountCommand = async ( output , context ) : Promise < RejectDomainTransferFromAnotherAwsAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountCommandError = async ( output , context ) : Promise < RejectDomainTransferFromAnotherAwsAccountCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1RenewDomainCommand = async ( output , context ) : Promise < RenewDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RenewDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RenewDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RenewDomainCommandError = async ( output , context ) : Promise < RenewDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1ResendContactReachabilityEmailCommand = async ( output , context ) : Promise < ResendContactReachabilityEmailCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ResendContactReachabilityEmailCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ResendContactReachabilityEmailResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ResendContactReachabilityEmailCommandError = async ( output , context ) : Promise < ResendContactReachabilityEmailCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1RetrieveDomainAuthCodeCommand = async ( output , context ) : Promise < RetrieveDomainAuthCodeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RetrieveDomainAuthCodeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RetrieveDomainAuthCodeResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RetrieveDomainAuthCodeCommandError = async ( output , context ) : Promise < RetrieveDomainAuthCodeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1TransferDomainCommand = async ( output , context ) : Promise < TransferDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TransferDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TransferDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TransferDomainCommandError = async ( output , context ) : Promise < TransferDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DomainLimitExceeded" : case "com.amazonaws.route53domains#DomainLimitExceeded" : response = { ... ( await deserializeAws_json1_1DomainLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1TransferDomainToAnotherAwsAccountCommand = async ( output , context ) : Promise < TransferDomainToAnotherAwsAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TransferDomainToAnotherAwsAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TransferDomainToAnotherAwsAccountResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TransferDomainToAnotherAwsAccountCommandError = async ( output , context ) : Promise < TransferDomainToAnotherAwsAccountCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1UpdateDomainContactCommand = async ( output , context ) : Promise < UpdateDomainContactCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDomainContactCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDomainContactResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDomainContactCommandError = async ( output , context ) : Promise < UpdateDomainContactCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1UpdateDomainContactPrivacyCommand = async ( output , context ) : Promise < UpdateDomainContactPrivacyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDomainContactPrivacyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDomainContactPrivacyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDomainContactPrivacyCommandError = async ( output , context ) : Promise < UpdateDomainContactPrivacyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1UpdateDomainNameserversCommand = async ( output , context ) : Promise < UpdateDomainNameserversCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDomainNameserversCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDomainNameserversResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDomainNameserversCommandError = async ( output , context ) : Promise < UpdateDomainNameserversCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateRequest" : case "com.amazonaws.route53domains#DuplicateRequest" : response = { ... ( await deserializeAws_json1_1DuplicateRequestResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TLDRulesViolation" : case "com.amazonaws.route53domains#TLDRulesViolation" : response = { ... ( await deserializeAws_json1_1TLDRulesViolationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1UpdateTagsForDomainCommand = async ( output , context ) : Promise < UpdateTagsForDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateTagsForDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateTagsForDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateTagsForDomainCommandError = async ( output , context ) : Promise < UpdateTagsForDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationLimitExceeded" : case "com.amazonaws.route53domains#OperationLimitExceeded" : response = { ... ( await deserializeAws_json1_1OperationLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTLD" : case "com.amazonaws.route53domains#UnsupportedTLD" : response = { ... ( await deserializeAws_json1_1UnsupportedTLDResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1ViewBillingCommand = async ( output , context ) : Promise < ViewBillingCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ViewBillingCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ViewBillingResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ViewBillingCommandError = async ( output , context ) : Promise < ViewBillingCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInput" : case "com.amazonaws.route53domains#InvalidInput" : response = { ... ( await deserializeAws_json1_1InvalidInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . 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_json1_1DomainLimitExceededResponse = async ( parsedOutput , context ) : Promise < DomainLimitExceeded > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1DomainLimitExceeded ( body , context ) ; const contents = { name : "DomainLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1DuplicateRequestResponse = async ( parsedOutput , context ) : Promise < DuplicateRequest > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1DuplicateRequest ( body , context ) ; const contents = { name : "DuplicateRequest" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidInputResponse = async ( parsedOutput , context ) : Promise < InvalidInput > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidInput ( body , context ) ; const contents = { name : "InvalidInput" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1OperationLimitExceededResponse = async ( parsedOutput , context ) : Promise < OperationLimitExceeded > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1OperationLimitExceeded ( body , context ) ; const contents = { name : "OperationLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1TLDRulesViolationResponse = async ( parsedOutput , context ) : Promise < TLDRulesViolation > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1TLDRulesViolation ( body , context ) ; const contents = { name : "TLDRulesViolation" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedTLDResponse = async ( parsedOutput , context ) : Promise < UnsupportedTLD > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedTLD ( body , context ) ; const contents = { name : "UnsupportedTLD" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . Password !== undefined && input . Password !== null && { Password : input . Password } ) , } ; } ; const serializeAws_json1_1CancelDomainTransferToAnotherAwsAccountRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1CheckDomainAvailabilityRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . IdnLangCode !== undefined && input . IdnLangCode !== null && { IdnLangCode : input . IdnLangCode } ) , } ; } ; const serializeAws_json1_1CheckDomainTransferabilityRequest = ( input , context ) : any => { return { ... ( input . AuthCode !== undefined && input . AuthCode !== null && { AuthCode : input . AuthCode } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1ContactDetail = ( input , context ) : any => { return { ... ( input . AddressLine1 !== undefined && input . AddressLine1 !== null && { AddressLine1 : input . AddressLine1 } ) , ... ( input . AddressLine2 !== undefined && input . AddressLine2 !== null && { AddressLine2 : input . AddressLine2 } ) , ... ( input . City !== undefined && input . City !== null && { City : input . City } ) , ... ( input . ContactType !== undefined && input . ContactType !== null && { ContactType : input . ContactType } ) , ... ( input . CountryCode !== undefined && input . CountryCode !== null && { CountryCode : input . CountryCode } ) , ... ( input . Email !== undefined && input . Email !== null && { Email : input . Email } ) , ... ( input . ExtraParams !== undefined && input . ExtraParams !== null && { ExtraParams : serializeAws_json1_1ExtraParamList ( input . ExtraParams , context ) } ) , ... ( input . Fax !== undefined && input . Fax !== null && { Fax : input . Fax } ) , ... ( input . FirstName !== undefined && input . FirstName !== null && { FirstName : input . FirstName } ) , ... ( input . LastName !== undefined && input . LastName !== null && { LastName : input . LastName } ) , ... ( input . OrganizationName !== undefined && input . OrganizationName !== null && { OrganizationName : input . OrganizationName } ) , ... ( input . PhoneNumber !== undefined && input . PhoneNumber !== null && { PhoneNumber : input . PhoneNumber } ) , ... ( input . State !== undefined && input . State !== null && { State : input . State } ) , ... ( input . ZipCode !== undefined && input . ZipCode !== null && { ZipCode : input . ZipCode } ) , } ; } ; const serializeAws_json1_1DeleteDomainRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1DeleteTagsForDomainRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . TagsToDelete !== undefined && input . TagsToDelete !== null && { TagsToDelete : serializeAws_json1_1TagKeyList ( input . TagsToDelete , context ) } ) , } ; } ; const serializeAws_json1_1DisableDomainAutoRenewRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1DisableDomainTransferLockRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1EnableDomainAutoRenewRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1EnableDomainTransferLockRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1ExtraParam = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1ExtraParamList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ExtraParam ( entry , context ) ; } ) ; } ; const serializeAws_json1_1FilterCondition = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Operator !== undefined && input . Operator !== null && { Operator : input . Operator } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_json1_1Values ( input . Values , context ) } ) , } ; } ; const serializeAws_json1_1FilterConditions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1FilterCondition ( entry , context ) ; } ) ; } ; const serializeAws_json1_1GetContactReachabilityStatusRequest = ( input , context ) : any => { return { ... ( input . domainName !== undefined && input . domainName !== null && { domainName : input . domainName } ) , } ; } ; const serializeAws_json1_1GetDomainDetailRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1GetDomainSuggestionsRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . OnlyAvailable !== undefined && input . OnlyAvailable !== null && { OnlyAvailable : input . OnlyAvailable } ) , ... ( input . SuggestionCount !== undefined && input . SuggestionCount !== null && { SuggestionCount : input . SuggestionCount } ) , } ; } ; const serializeAws_json1_1GetOperationDetailRequest = ( input , context ) : any => { return { ... ( input . OperationId !== undefined && input . OperationId !== null && { OperationId : input . OperationId } ) , } ; } ; const serializeAws_json1_1GlueIpList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ListDomainsRequest = ( input , context ) : any => { return { ... ( input . FilterConditions !== undefined && input . FilterConditions !== null && { FilterConditions : serializeAws_json1_1FilterConditions ( input . FilterConditions , context ) , } ) , ... ( input . Marker !== undefined && input . Marker !== null && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && input . MaxItems !== null && { MaxItems : input . MaxItems } ) , ... ( input . SortCondition !== undefined && input . SortCondition !== null && { SortCondition : serializeAws_json1_1SortCondition ( input . SortCondition , context ) , } ) , } ; } ; const serializeAws_json1_1ListOperationsRequest = ( input , context ) : any => { return { ... ( input . Marker !== undefined && input . Marker !== null && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && input . MaxItems !== null && { MaxItems : input . MaxItems } ) , ... ( input . SubmittedSince !== undefined && input . SubmittedSince !== null && { SubmittedSince : Math . round ( input . SubmittedSince . getTime ( ) / 1000 ) } ) , } ; } ; const serializeAws_json1_1ListPricesRequest = ( input , context ) : any => { return { ... ( input . Marker !== undefined && input . Marker !== null && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && input . MaxItems !== null && { MaxItems : input . MaxItems } ) , ... ( input . Tld !== undefined && input . Tld !== null && { Tld : input . Tld } ) , } ; } ; const serializeAws_json1_1ListTagsForDomainRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1Nameserver = ( input , context ) : any => { return { ... ( input . GlueIps !== undefined && input . GlueIps !== null && { GlueIps : serializeAws_json1_1GlueIpList ( input . GlueIps , context ) } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1NameserverList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Nameserver ( entry , context ) ; } ) ; } ; const serializeAws_json1_1RegisterDomainRequest = ( input , context ) : any => { return { ... ( input . AdminContact !== undefined && input . AdminContact !== null && { AdminContact : serializeAws_json1_1ContactDetail ( input . AdminContact , context ) } ) , ... ( input . AutoRenew !== undefined && input . AutoRenew !== null && { AutoRenew : input . AutoRenew } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . DurationInYears !== undefined && input . DurationInYears !== null && { DurationInYears : input . DurationInYears } ) , ... ( input . IdnLangCode !== undefined && input . IdnLangCode !== null && { IdnLangCode : input . IdnLangCode } ) , ... ( input . PrivacyProtectAdminContact !== undefined && input . PrivacyProtectAdminContact !== null && { PrivacyProtectAdminContact : input . PrivacyProtectAdminContact } ) , ... ( input . PrivacyProtectRegistrantContact !== undefined && input . PrivacyProtectRegistrantContact !== null && { PrivacyProtectRegistrantContact : input . PrivacyProtectRegistrantContact , } ) , ... ( input . PrivacyProtectTechContact !== undefined && input . PrivacyProtectTechContact !== null && { PrivacyProtectTechContact : input . PrivacyProtectTechContact } ) , ... ( input . RegistrantContact !== undefined && input . RegistrantContact !== null && { RegistrantContact : serializeAws_json1_1ContactDetail ( input . RegistrantContact , context ) , } ) , ... ( input . TechContact !== undefined && input . TechContact !== null && { TechContact : serializeAws_json1_1ContactDetail ( input . TechContact , context ) } ) , } ; } ; const serializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1RenewDomainRequest = ( input , context ) : any => { return { ... ( input . CurrentExpiryYear !== undefined && input . CurrentExpiryYear !== null && { CurrentExpiryYear : input . CurrentExpiryYear } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . DurationInYears !== undefined && input . DurationInYears !== null && { DurationInYears : input . DurationInYears } ) , } ; } ; const serializeAws_json1_1ResendContactReachabilityEmailRequest = ( input , context ) : any => { return { ... ( input . domainName !== undefined && input . domainName !== null && { domainName : input . domainName } ) , } ; } ; const serializeAws_json1_1RetrieveDomainAuthCodeRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1SortCondition = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SortOrder !== undefined && input . SortOrder !== null && { SortOrder : input . SortOrder } ) , } ; } ; const serializeAws_json1_1Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TransferDomainRequest = ( input , context ) : any => { return { ... ( input . AdminContact !== undefined && input . AdminContact !== null && { AdminContact : serializeAws_json1_1ContactDetail ( input . AdminContact , context ) } ) , ... ( input . AuthCode !== undefined && input . AuthCode !== null && { AuthCode : input . AuthCode } ) , ... ( input . AutoRenew !== undefined && input . AutoRenew !== null && { AutoRenew : input . AutoRenew } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . DurationInYears !== undefined && input . DurationInYears !== null && { DurationInYears : input . DurationInYears } ) , ... ( input . IdnLangCode !== undefined && input . IdnLangCode !== null && { IdnLangCode : input . IdnLangCode } ) , ... ( input . Nameservers !== undefined && input . Nameservers !== null && { Nameservers : serializeAws_json1_1NameserverList ( input . Nameservers , context ) } ) , ... ( input . PrivacyProtectAdminContact !== undefined && input . PrivacyProtectAdminContact !== null && { PrivacyProtectAdminContact : input . PrivacyProtectAdminContact } ) , ... ( input . PrivacyProtectRegistrantContact !== undefined && input . PrivacyProtectRegistrantContact !== null && { PrivacyProtectRegistrantContact : input . PrivacyProtectRegistrantContact , } ) , ... ( input . PrivacyProtectTechContact !== undefined && input . PrivacyProtectTechContact !== null && { PrivacyProtectTechContact : input . PrivacyProtectTechContact } ) , ... ( input . RegistrantContact !== undefined && input . RegistrantContact !== null && { RegistrantContact : serializeAws_json1_1ContactDetail ( input . RegistrantContact , context ) , } ) , ... ( input . TechContact !== undefined && input . TechContact !== null && { TechContact : serializeAws_json1_1ContactDetail ( input . TechContact , context ) } ) , } ; } ; const serializeAws_json1_1TransferDomainToAnotherAwsAccountRequest = ( input , context ) : any => { return { ... ( input . AccountId !== undefined && input . AccountId !== null && { AccountId : input . AccountId } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , } ; } ; const serializeAws_json1_1UpdateDomainContactPrivacyRequest = ( input , context ) : any => { return { ... ( input . AdminPrivacy !== undefined && input . AdminPrivacy !== null && { AdminPrivacy : input . AdminPrivacy } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . RegistrantPrivacy !== undefined && input . RegistrantPrivacy !== null && { RegistrantPrivacy : input . RegistrantPrivacy } ) , ... ( input . TechPrivacy !== undefined && input . TechPrivacy !== null && { TechPrivacy : input . TechPrivacy } ) , } ; } ; const serializeAws_json1_1UpdateDomainContactRequest = ( input , context ) : any => { return { ... ( input . AdminContact !== undefined && input . AdminContact !== null && { AdminContact : serializeAws_json1_1ContactDetail ( input . AdminContact , context ) } ) , ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . RegistrantContact !== undefined && input . RegistrantContact !== null && { RegistrantContact : serializeAws_json1_1ContactDetail ( input . RegistrantContact , context ) , } ) , ... ( input . TechContact !== undefined && input . TechContact !== null && { TechContact : serializeAws_json1_1ContactDetail ( input . TechContact , context ) } ) , } ; } ; const serializeAws_json1_1UpdateDomainNameserversRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . FIAuthKey !== undefined && input . FIAuthKey !== null && { FIAuthKey : input . FIAuthKey } ) , ... ( input . Nameservers !== undefined && input . Nameservers !== null && { Nameservers : serializeAws_json1_1NameserverList ( input . Nameservers , context ) } ) , } ; } ; const serializeAws_json1_1UpdateTagsForDomainRequest = ( input , context ) : any => { return { ... ( input . DomainName !== undefined && input . DomainName !== null && { DomainName : input . DomainName } ) , ... ( input . TagsToUpdate !== undefined && input . TagsToUpdate !== null && { TagsToUpdate : serializeAws_json1_1TagList ( input . TagsToUpdate , context ) } ) , } ; } ; const serializeAws_json1_1Values = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ViewBillingRequest = ( input , context ) : any => { return { ... ( input . End !== undefined && input . End !== null && { End : Math . round ( input . End . getTime ( ) / 1000 ) } ) , ... ( input . Marker !== undefined && input . Marker !== null && { Marker : input . Marker } ) , ... ( input . MaxItems !== undefined && input . MaxItems !== null && { MaxItems : input . MaxItems } ) , ... ( input . Start !== undefined && input . Start !== null && { Start : Math . round ( input . Start . getTime ( ) / 1000 ) } ) , } ; } ; const deserializeAws_json1_1AcceptDomainTransferFromAnotherAwsAccountResponse = ( output , context ) : AcceptDomainTransferFromAnotherAwsAccountResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1BillingRecord = ( output , context ) : BillingRecord => { return { BillDate : output . BillDate !== undefined && output . BillDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . BillDate ) ) ) : undefined , DomainName : __expectString ( output . DomainName ) , InvoiceId : __expectString ( output . InvoiceId ) , Operation : __expectString ( output . Operation ) , Price : __limitedParseDouble ( output . Price ) , } as any ; } ; const deserializeAws_json1_1BillingRecords = ( output , context ) : BillingRecord [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1BillingRecord ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CancelDomainTransferToAnotherAwsAccountResponse = ( output , context ) : CancelDomainTransferToAnotherAwsAccountResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1CheckDomainAvailabilityResponse = ( output , context ) : CheckDomainAvailabilityResponse => { return { Availability : __expectString ( output . Availability ) , } as any ; } ; const deserializeAws_json1_1CheckDomainTransferabilityResponse = ( output , context ) : CheckDomainTransferabilityResponse => { return { Transferability : output . Transferability !== undefined && output . Transferability !== null ? deserializeAws_json1_1DomainTransferability ( output . Transferability , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ContactDetail = ( output , context ) : ContactDetail => { return { AddressLine1 : __expectString ( output . AddressLine1 ) , AddressLine2 : __expectString ( output . AddressLine2 ) , City : __expectString ( output . City ) , ContactType : __expectString ( output . ContactType ) , CountryCode : __expectString ( output . CountryCode ) , Email : __expectString ( output . Email ) , ExtraParams : output . ExtraParams !== undefined && output . ExtraParams !== null ? deserializeAws_json1_1ExtraParamList ( output . ExtraParams , context ) : undefined , Fax : __expectString ( output . Fax ) , FirstName : __expectString ( output . FirstName ) , LastName : __expectString ( output . LastName ) , OrganizationName : __expectString ( output . OrganizationName ) , PhoneNumber : __expectString ( output . PhoneNumber ) , State : __expectString ( output . State ) , ZipCode : __expectString ( output . ZipCode ) , } as any ; } ; const deserializeAws_json1_1DeleteDomainResponse = ( output , context ) : DeleteDomainResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1DeleteTagsForDomainResponse = ( output , context ) : DeleteTagsForDomainResponse => { return { } as any ; } ; const deserializeAws_json1_1DisableDomainAutoRenewResponse = ( output , context ) : DisableDomainAutoRenewResponse => { return { } as any ; } ; const deserializeAws_json1_1DisableDomainTransferLockResponse = ( output , context ) : DisableDomainTransferLockResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1DomainLimitExceeded = ( output , context ) : DomainLimitExceeded => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1DomainPrice = ( output , context ) : DomainPrice => { return { ChangeOwnershipPrice : output . ChangeOwnershipPrice !== undefined && output . ChangeOwnershipPrice !== null ? deserializeAws_json1_1PriceWithCurrency ( output . ChangeOwnershipPrice , context ) : undefined , Name : __expectString ( output . Name ) , RegistrationPrice : output . RegistrationPrice !== undefined && output . RegistrationPrice !== null ? deserializeAws_json1_1PriceWithCurrency ( output . RegistrationPrice , context ) : undefined , RenewalPrice : output . RenewalPrice !== undefined && output . RenewalPrice !== null ? deserializeAws_json1_1PriceWithCurrency ( output . RenewalPrice , context ) : undefined , RestorationPrice : output . RestorationPrice !== undefined && output . RestorationPrice !== null ? deserializeAws_json1_1PriceWithCurrency ( output . RestorationPrice , context ) : undefined , TransferPrice : output . TransferPrice !== undefined && output . TransferPrice !== null ? deserializeAws_json1_1PriceWithCurrency ( output . TransferPrice , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DomainPriceList = ( output , context ) : DomainPrice [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DomainPrice ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DomainStatusList = ( 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_json1_1DomainSuggestion = ( output , context ) : DomainSuggestion => { return { Availability : __expectString ( output . Availability ) , DomainName : __expectString ( output . DomainName ) , } as any ; } ; const deserializeAws_json1_1DomainSuggestionsList = ( output , context ) : DomainSuggestion [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DomainSuggestion ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DomainSummary = ( output , context ) : DomainSummary => { return { AutoRenew : __expectBoolean ( output . AutoRenew ) , DomainName : __expectString ( output . DomainName ) , Expiry : output . Expiry !== undefined && output . Expiry !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . Expiry ) ) ) : undefined , TransferLock : __expectBoolean ( output . TransferLock ) , } as any ; } ; const deserializeAws_json1_1DomainSummaryList = ( output , context ) : DomainSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DomainSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DomainTransferability = ( output , context ) : DomainTransferability => { return { Transferable : __expectString ( output . Transferable ) , } as any ; } ; const deserializeAws_json1_1DuplicateRequest = ( output , context ) : DuplicateRequest => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1EnableDomainAutoRenewResponse = ( output , context ) : EnableDomainAutoRenewResponse => { return { } as any ; } ; const deserializeAws_json1_1EnableDomainTransferLockResponse = ( output , context ) : EnableDomainTransferLockResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1ExtraParam = ( output , context ) : ExtraParam => { return { Name : __expectString ( output . Name ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1ExtraParamList = ( output , context ) : ExtraParam [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ExtraParam ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GetContactReachabilityStatusResponse = ( output , context ) : GetContactReachabilityStatusResponse => { return { domainName : __expectString ( output . domainName ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1GetDomainDetailResponse = ( output , context ) : GetDomainDetailResponse => { return { AbuseContactEmail : __expectString ( output . AbuseContactEmail ) , AbuseContactPhone : __expectString ( output . AbuseContactPhone ) , AdminContact : output . AdminContact !== undefined && output . AdminContact !== null ? deserializeAws_json1_1ContactDetail ( output . AdminContact , context ) : undefined , AdminPrivacy : __expectBoolean ( output . AdminPrivacy ) , AutoRenew : __expectBoolean ( output . AutoRenew ) , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , DnsSec : __expectString ( output . DnsSec ) , DomainName : __expectString ( output . DomainName ) , ExpirationDate : output . ExpirationDate !== undefined && output . ExpirationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . ExpirationDate ) ) ) : undefined , Nameservers : output . Nameservers !== undefined && output . Nameservers !== null ? deserializeAws_json1_1NameserverList ( output . Nameservers , context ) : undefined , RegistrantContact : output . RegistrantContact !== undefined && output . RegistrantContact !== null ? deserializeAws_json1_1ContactDetail ( output . RegistrantContact , context ) : undefined , RegistrantPrivacy : __expectBoolean ( output . RegistrantPrivacy ) , RegistrarName : __expectString ( output . RegistrarName ) , RegistrarUrl : __expectString ( output . RegistrarUrl ) , RegistryDomainId : __expectString ( output . RegistryDomainId ) , Reseller : __expectString ( output . Reseller ) , StatusList : output . StatusList !== undefined && output . StatusList !== null ? deserializeAws_json1_1DomainStatusList ( output . StatusList , context ) : undefined , TechContact : output . TechContact !== undefined && output . TechContact !== null ? deserializeAws_json1_1ContactDetail ( output . TechContact , context ) : undefined , TechPrivacy : __expectBoolean ( output . TechPrivacy ) , UpdatedDate : output . UpdatedDate !== undefined && output . UpdatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . UpdatedDate ) ) ) : undefined , WhoIsServer : __expectString ( output . WhoIsServer ) , } as any ; } ; const deserializeAws_json1_1GetDomainSuggestionsResponse = ( output , context ) : GetDomainSuggestionsResponse => { return { SuggestionsList : output . SuggestionsList !== undefined && output . SuggestionsList !== null ? deserializeAws_json1_1DomainSuggestionsList ( output . SuggestionsList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetOperationDetailResponse = ( output , context ) : GetOperationDetailResponse => { return { DomainName : __expectString ( output . DomainName ) , Message : __expectString ( output . Message ) , OperationId : __expectString ( output . OperationId ) , Status : __expectString ( output . Status ) , SubmittedDate : output . SubmittedDate !== undefined && output . SubmittedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . SubmittedDate ) ) ) : undefined , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1GlueIpList = ( 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_json1_1InvalidInput = ( output , context ) : InvalidInput => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ListDomainsResponse = ( output , context ) : ListDomainsResponse => { return { Domains : output . Domains !== undefined && output . Domains !== null ? deserializeAws_json1_1DomainSummaryList ( output . Domains , context ) : undefined , NextPageMarker : __expectString ( output . NextPageMarker ) , } as any ; } ; const deserializeAws_json1_1ListOperationsResponse = ( output , context ) : ListOperationsResponse => { return { NextPageMarker : __expectString ( output . NextPageMarker ) , Operations : output . Operations !== undefined && output . Operations !== null ? deserializeAws_json1_1OperationSummaryList ( output . Operations , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListPricesResponse = ( output , context ) : ListPricesResponse => { return { NextPageMarker : __expectString ( output . NextPageMarker ) , Prices : output . Prices !== undefined && output . Prices !== null ? deserializeAws_json1_1DomainPriceList ( output . Prices , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListTagsForDomainResponse = ( output , context ) : ListTagsForDomainResponse => { return { TagList : output . TagList !== undefined && output . TagList !== null ? deserializeAws_json1_1TagList ( output . TagList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Nameserver = ( output , context ) : Nameserver => { return { GlueIps : output . GlueIps !== undefined && output . GlueIps !== null ? deserializeAws_json1_1GlueIpList ( output . GlueIps , context ) : undefined , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_json1_1NameserverList = ( output , context ) : Nameserver [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Nameserver ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1OperationLimitExceeded = ( output , context ) : OperationLimitExceeded => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1OperationSummary = ( output , context ) : OperationSummary => { return { OperationId : __expectString ( output . OperationId ) , Status : __expectString ( output . Status ) , SubmittedDate : output . SubmittedDate !== undefined && output . SubmittedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . SubmittedDate ) ) ) : undefined , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1OperationSummaryList = ( output , context ) : OperationSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1OperationSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PriceWithCurrency = ( output , context ) : PriceWithCurrency => { return { Currency : __expectString ( output . Currency ) , Price : __limitedParseDouble ( output . Price ) , } as any ; } ; const deserializeAws_json1_1RegisterDomainResponse = ( output , context ) : RegisterDomainResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1RejectDomainTransferFromAnotherAwsAccountResponse = ( output , context ) : RejectDomainTransferFromAnotherAwsAccountResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1RenewDomainResponse = ( output , context ) : RenewDomainResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1ResendContactReachabilityEmailResponse = ( output , context ) : ResendContactReachabilityEmailResponse => { return { domainName : __expectString ( output . domainName ) , emailAddress : __expectString ( output . emailAddress ) , isAlreadyVerified : __expectBoolean ( output . isAlreadyVerified ) , } as any ; } ; const deserializeAws_json1_1RetrieveDomainAuthCodeResponse = ( output , context ) : RetrieveDomainAuthCodeResponse => { return { AuthCode : __expectString ( output . AuthCode ) , } as any ; } ; const deserializeAws_json1_1Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TLDRulesViolation = ( output , context ) : TLDRulesViolation => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1TransferDomainResponse = ( output , context ) : TransferDomainResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1TransferDomainToAnotherAwsAccountResponse = ( output , context ) : TransferDomainToAnotherAwsAccountResponse => { return { OperationId : __expectString ( output . OperationId ) , Password : __expectString ( output . Password ) , } as any ; } ; const deserializeAws_json1_1UnsupportedTLD = ( output , context ) : UnsupportedTLD => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UpdateDomainContactPrivacyResponse = ( output , context ) : UpdateDomainContactPrivacyResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1UpdateDomainContactResponse = ( output , context ) : UpdateDomainContactResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1UpdateDomainNameserversResponse = ( output , context ) : UpdateDomainNameserversResponse => { return { OperationId : __expectString ( output . OperationId ) , } as any ; } ; const deserializeAws_json1_1UpdateTagsForDomainResponse = ( output , context ) : UpdateTagsForDomainResponse => { return { } as any ; } ; const deserializeAws_json1_1ViewBillingResponse = ( output , context ) : ViewBillingResponse => { return { BillingRecords : output . BillingRecords !== undefined && output . BillingRecords !== null ? deserializeAws_json1_1BillingRecords ( output . BillingRecords , context ) : undefined , NextPageMarker : __expectString ( output . NextPageMarker ) , } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;