import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , 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 { AddCustomAttributesCommandInput , AddCustomAttributesCommandOutput , } from "../commands/AddCustomAttributesCommand" ; import { AdminAddUserToGroupCommandInput , AdminAddUserToGroupCommandOutput , } from "../commands/AdminAddUserToGroupCommand" ; import { AdminConfirmSignUpCommandInput , AdminConfirmSignUpCommandOutput } from "../commands/AdminConfirmSignUpCommand" ; import { AdminCreateUserCommandInput , AdminCreateUserCommandOutput } from "../commands/AdminCreateUserCommand" ; import { AdminDeleteUserAttributesCommandInput , AdminDeleteUserAttributesCommandOutput , } from "../commands/AdminDeleteUserAttributesCommand" ; import { AdminDeleteUserCommandInput , AdminDeleteUserCommandOutput } from "../commands/AdminDeleteUserCommand" ; import { AdminDisableProviderForUserCommandInput , AdminDisableProviderForUserCommandOutput , } from "../commands/AdminDisableProviderForUserCommand" ; import { AdminDisableUserCommandInput , AdminDisableUserCommandOutput } from "../commands/AdminDisableUserCommand" ; import { AdminEnableUserCommandInput , AdminEnableUserCommandOutput } from "../commands/AdminEnableUserCommand" ; import { AdminForgetDeviceCommandInput , AdminForgetDeviceCommandOutput } from "../commands/AdminForgetDeviceCommand" ; import { AdminGetDeviceCommandInput , AdminGetDeviceCommandOutput } from "../commands/AdminGetDeviceCommand" ; import { AdminGetUserCommandInput , AdminGetUserCommandOutput } from "../commands/AdminGetUserCommand" ; import { AdminInitiateAuthCommandInput , AdminInitiateAuthCommandOutput } from "../commands/AdminInitiateAuthCommand" ; import { AdminLinkProviderForUserCommandInput , AdminLinkProviderForUserCommandOutput , } from "../commands/AdminLinkProviderForUserCommand" ; import { AdminListDevicesCommandInput , AdminListDevicesCommandOutput } from "../commands/AdminListDevicesCommand" ; import { AdminListGroupsForUserCommandInput , AdminListGroupsForUserCommandOutput , } from "../commands/AdminListGroupsForUserCommand" ; import { AdminListUserAuthEventsCommandInput , AdminListUserAuthEventsCommandOutput , } from "../commands/AdminListUserAuthEventsCommand" ; import { AdminRemoveUserFromGroupCommandInput , AdminRemoveUserFromGroupCommandOutput , } from "../commands/AdminRemoveUserFromGroupCommand" ; import { AdminResetUserPasswordCommandInput , AdminResetUserPasswordCommandOutput , } from "../commands/AdminResetUserPasswordCommand" ; import { AdminRespondToAuthChallengeCommandInput , AdminRespondToAuthChallengeCommandOutput , } from "../commands/AdminRespondToAuthChallengeCommand" ; import { AdminSetUserMFAPreferenceCommandInput , AdminSetUserMFAPreferenceCommandOutput , } from "../commands/AdminSetUserMFAPreferenceCommand" ; import { AdminSetUserPasswordCommandInput , AdminSetUserPasswordCommandOutput , } from "../commands/AdminSetUserPasswordCommand" ; import { AdminSetUserSettingsCommandInput , AdminSetUserSettingsCommandOutput , } from "../commands/AdminSetUserSettingsCommand" ; import { AdminUpdateAuthEventFeedbackCommandInput , AdminUpdateAuthEventFeedbackCommandOutput , } from "../commands/AdminUpdateAuthEventFeedbackCommand" ; import { AdminUpdateDeviceStatusCommandInput , AdminUpdateDeviceStatusCommandOutput , } from "../commands/AdminUpdateDeviceStatusCommand" ; import { AdminUpdateUserAttributesCommandInput , AdminUpdateUserAttributesCommandOutput , } from "../commands/AdminUpdateUserAttributesCommand" ; import { AdminUserGlobalSignOutCommandInput , AdminUserGlobalSignOutCommandOutput , } from "../commands/AdminUserGlobalSignOutCommand" ; import { AssociateSoftwareTokenCommandInput , AssociateSoftwareTokenCommandOutput , } from "../commands/AssociateSoftwareTokenCommand" ; import { ChangePasswordCommandInput , ChangePasswordCommandOutput } from "../commands/ChangePasswordCommand" ; import { ConfirmDeviceCommandInput , ConfirmDeviceCommandOutput } from "../commands/ConfirmDeviceCommand" ; import { ConfirmForgotPasswordCommandInput , ConfirmForgotPasswordCommandOutput , } from "../commands/ConfirmForgotPasswordCommand" ; import { ConfirmSignUpCommandInput , ConfirmSignUpCommandOutput } from "../commands/ConfirmSignUpCommand" ; import { CreateGroupCommandInput , CreateGroupCommandOutput } from "../commands/CreateGroupCommand" ; import { CreateIdentityProviderCommandInput , CreateIdentityProviderCommandOutput , } from "../commands/CreateIdentityProviderCommand" ; import { CreateResourceServerCommandInput , CreateResourceServerCommandOutput , } from "../commands/CreateResourceServerCommand" ; import { CreateUserImportJobCommandInput , CreateUserImportJobCommandOutput , } from "../commands/CreateUserImportJobCommand" ; import { CreateUserPoolClientCommandInput , CreateUserPoolClientCommandOutput , } from "../commands/CreateUserPoolClientCommand" ; import { CreateUserPoolCommandInput , CreateUserPoolCommandOutput } from "../commands/CreateUserPoolCommand" ; import { CreateUserPoolDomainCommandInput , CreateUserPoolDomainCommandOutput , } from "../commands/CreateUserPoolDomainCommand" ; import { DeleteGroupCommandInput , DeleteGroupCommandOutput } from "../commands/DeleteGroupCommand" ; import { DeleteIdentityProviderCommandInput , DeleteIdentityProviderCommandOutput , } from "../commands/DeleteIdentityProviderCommand" ; import { DeleteResourceServerCommandInput , DeleteResourceServerCommandOutput , } from "../commands/DeleteResourceServerCommand" ; import { DeleteUserAttributesCommandInput , DeleteUserAttributesCommandOutput , } from "../commands/DeleteUserAttributesCommand" ; import { DeleteUserCommandInput , DeleteUserCommandOutput } from "../commands/DeleteUserCommand" ; import { DeleteUserPoolClientCommandInput , DeleteUserPoolClientCommandOutput , } from "../commands/DeleteUserPoolClientCommand" ; import { DeleteUserPoolCommandInput , DeleteUserPoolCommandOutput } from "../commands/DeleteUserPoolCommand" ; import { DeleteUserPoolDomainCommandInput , DeleteUserPoolDomainCommandOutput , } from "../commands/DeleteUserPoolDomainCommand" ; import { DescribeIdentityProviderCommandInput , DescribeIdentityProviderCommandOutput , } from "../commands/DescribeIdentityProviderCommand" ; import { DescribeResourceServerCommandInput , DescribeResourceServerCommandOutput , } from "../commands/DescribeResourceServerCommand" ; import { DescribeRiskConfigurationCommandInput , DescribeRiskConfigurationCommandOutput , } from "../commands/DescribeRiskConfigurationCommand" ; import { DescribeUserImportJobCommandInput , DescribeUserImportJobCommandOutput , } from "../commands/DescribeUserImportJobCommand" ; import { DescribeUserPoolClientCommandInput , DescribeUserPoolClientCommandOutput , } from "../commands/DescribeUserPoolClientCommand" ; import { DescribeUserPoolCommandInput , DescribeUserPoolCommandOutput } from "../commands/DescribeUserPoolCommand" ; import { DescribeUserPoolDomainCommandInput , DescribeUserPoolDomainCommandOutput , } from "../commands/DescribeUserPoolDomainCommand" ; import { ForgetDeviceCommandInput , ForgetDeviceCommandOutput } from "../commands/ForgetDeviceCommand" ; import { ForgotPasswordCommandInput , ForgotPasswordCommandOutput } from "../commands/ForgotPasswordCommand" ; import { GetCSVHeaderCommandInput , GetCSVHeaderCommandOutput } from "../commands/GetCSVHeaderCommand" ; import { GetDeviceCommandInput , GetDeviceCommandOutput } from "../commands/GetDeviceCommand" ; import { GetGroupCommandInput , GetGroupCommandOutput } from "../commands/GetGroupCommand" ; import { GetIdentityProviderByIdentifierCommandInput , GetIdentityProviderByIdentifierCommandOutput , } from "../commands/GetIdentityProviderByIdentifierCommand" ; import { GetSigningCertificateCommandInput , GetSigningCertificateCommandOutput , } from "../commands/GetSigningCertificateCommand" ; import { GetUICustomizationCommandInput , GetUICustomizationCommandOutput } from "../commands/GetUICustomizationCommand" ; import { GetUserAttributeVerificationCodeCommandInput , GetUserAttributeVerificationCodeCommandOutput , } from "../commands/GetUserAttributeVerificationCodeCommand" ; import { GetUserCommandInput , GetUserCommandOutput } from "../commands/GetUserCommand" ; import { GetUserPoolMfaConfigCommandInput , GetUserPoolMfaConfigCommandOutput , } from "../commands/GetUserPoolMfaConfigCommand" ; import { GlobalSignOutCommandInput , GlobalSignOutCommandOutput } from "../commands/GlobalSignOutCommand" ; import { InitiateAuthCommandInput , InitiateAuthCommandOutput } from "../commands/InitiateAuthCommand" ; import { ListDevicesCommandInput , ListDevicesCommandOutput } from "../commands/ListDevicesCommand" ; import { ListGroupsCommandInput , ListGroupsCommandOutput } from "../commands/ListGroupsCommand" ; import { ListIdentityProvidersCommandInput , ListIdentityProvidersCommandOutput , } from "../commands/ListIdentityProvidersCommand" ; import { ListResourceServersCommandInput , ListResourceServersCommandOutput , } from "../commands/ListResourceServersCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { ListUserImportJobsCommandInput , ListUserImportJobsCommandOutput } from "../commands/ListUserImportJobsCommand" ; import { ListUserPoolClientsCommandInput , ListUserPoolClientsCommandOutput , } from "../commands/ListUserPoolClientsCommand" ; import { ListUserPoolsCommandInput , ListUserPoolsCommandOutput } from "../commands/ListUserPoolsCommand" ; import { ListUsersCommandInput , ListUsersCommandOutput } from "../commands/ListUsersCommand" ; import { ListUsersInGroupCommandInput , ListUsersInGroupCommandOutput } from "../commands/ListUsersInGroupCommand" ; import { ResendConfirmationCodeCommandInput , ResendConfirmationCodeCommandOutput , } from "../commands/ResendConfirmationCodeCommand" ; import { RespondToAuthChallengeCommandInput , RespondToAuthChallengeCommandOutput , } from "../commands/RespondToAuthChallengeCommand" ; import { RevokeTokenCommandInput , RevokeTokenCommandOutput } from "../commands/RevokeTokenCommand" ; import { SetRiskConfigurationCommandInput , SetRiskConfigurationCommandOutput , } from "../commands/SetRiskConfigurationCommand" ; import { SetUICustomizationCommandInput , SetUICustomizationCommandOutput } from "../commands/SetUICustomizationCommand" ; import { SetUserMFAPreferenceCommandInput , SetUserMFAPreferenceCommandOutput , } from "../commands/SetUserMFAPreferenceCommand" ; import { SetUserPoolMfaConfigCommandInput , SetUserPoolMfaConfigCommandOutput , } from "../commands/SetUserPoolMfaConfigCommand" ; import { SetUserSettingsCommandInput , SetUserSettingsCommandOutput } from "../commands/SetUserSettingsCommand" ; import { SignUpCommandInput , SignUpCommandOutput } from "../commands/SignUpCommand" ; import { StartUserImportJobCommandInput , StartUserImportJobCommandOutput } from "../commands/StartUserImportJobCommand" ; import { StopUserImportJobCommandInput , StopUserImportJobCommandOutput } from "../commands/StopUserImportJobCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateAuthEventFeedbackCommandInput , UpdateAuthEventFeedbackCommandOutput , } from "../commands/UpdateAuthEventFeedbackCommand" ; import { UpdateDeviceStatusCommandInput , UpdateDeviceStatusCommandOutput } from "../commands/UpdateDeviceStatusCommand" ; import { UpdateGroupCommandInput , UpdateGroupCommandOutput } from "../commands/UpdateGroupCommand" ; import { UpdateIdentityProviderCommandInput , UpdateIdentityProviderCommandOutput , } from "../commands/UpdateIdentityProviderCommand" ; import { UpdateResourceServerCommandInput , UpdateResourceServerCommandOutput , } from "../commands/UpdateResourceServerCommand" ; import { UpdateUserAttributesCommandInput , UpdateUserAttributesCommandOutput , } from "../commands/UpdateUserAttributesCommand" ; import { UpdateUserPoolClientCommandInput , UpdateUserPoolClientCommandOutput , } from "../commands/UpdateUserPoolClientCommand" ; import { UpdateUserPoolCommandInput , UpdateUserPoolCommandOutput } from "../commands/UpdateUserPoolCommand" ; import { UpdateUserPoolDomainCommandInput , UpdateUserPoolDomainCommandOutput , } from "../commands/UpdateUserPoolDomainCommand" ; import { VerifySoftwareTokenCommandInput , VerifySoftwareTokenCommandOutput , } from "../commands/VerifySoftwareTokenCommand" ; import { VerifyUserAttributeCommandInput , VerifyUserAttributeCommandOutput , } from "../commands/VerifyUserAttributeCommand" ; import { AccountRecoverySettingType , AccountTakeoverActionsType , AccountTakeoverActionType , AccountTakeoverRiskConfigurationType , AddCustomAttributesRequest , AddCustomAttributesResponse , AdminAddUserToGroupRequest , AdminConfirmSignUpRequest , AdminConfirmSignUpResponse , AdminCreateUserConfigType , AdminCreateUserRequest , AdminCreateUserResponse , AdminDeleteUserAttributesRequest , AdminDeleteUserAttributesResponse , AdminDeleteUserRequest , AdminDisableProviderForUserRequest , AdminDisableProviderForUserResponse , AdminDisableUserRequest , AdminDisableUserResponse , AdminEnableUserRequest , AdminEnableUserResponse , AdminForgetDeviceRequest , AdminGetDeviceRequest , AdminGetDeviceResponse , AdminGetUserRequest , AdminGetUserResponse , AdminInitiateAuthRequest , AdminInitiateAuthResponse , AdminLinkProviderForUserRequest , AdminLinkProviderForUserResponse , AdminListDevicesRequest , AdminListDevicesResponse , AdminListGroupsForUserRequest , AdminListGroupsForUserResponse , AdminListUserAuthEventsRequest , AdminListUserAuthEventsResponse , AdminRemoveUserFromGroupRequest , AdminResetUserPasswordRequest , AdminResetUserPasswordResponse , AdminRespondToAuthChallengeRequest , AdminRespondToAuthChallengeResponse , AdminSetUserMFAPreferenceRequest , AdminSetUserMFAPreferenceResponse , AdminSetUserPasswordRequest , AdminSetUserPasswordResponse , AdminSetUserSettingsRequest , AdminSetUserSettingsResponse , AdminUpdateAuthEventFeedbackRequest , AdminUpdateAuthEventFeedbackResponse , AdminUpdateDeviceStatusRequest , AdminUpdateDeviceStatusResponse , AdminUpdateUserAttributesRequest , AdminUpdateUserAttributesResponse , AdminUserGlobalSignOutRequest , AdminUserGlobalSignOutResponse , AliasAttributeType , AliasExistsException , AnalyticsConfigurationType , AnalyticsMetadataType , AssociateSoftwareTokenRequest , AssociateSoftwareTokenResponse , AttributeType , AuthenticationResultType , AuthEventType , ChallengeResponseType , ChangePasswordRequest , ChangePasswordResponse , CodeDeliveryDetailsType , CodeDeliveryFailureException , CodeMismatchException , CompromisedCredentialsActionsType , CompromisedCredentialsRiskConfigurationType , ConcurrentModificationException , ConfirmDeviceRequest , ConfirmDeviceResponse , ConfirmForgotPasswordRequest , ConfirmForgotPasswordResponse , ConfirmSignUpRequest , ConfirmSignUpResponse , ContextDataType , CreateGroupRequest , CreateGroupResponse , CreateIdentityProviderRequest , CreateIdentityProviderResponse , CreateResourceServerRequest , CreateResourceServerResponse , CreateUserImportJobRequest , CreateUserImportJobResponse , CreateUserPoolClientRequest , CreateUserPoolClientResponse , CreateUserPoolDomainRequest , CreateUserPoolDomainResponse , CreateUserPoolRequest , CreateUserPoolResponse , CustomDomainConfigType , CustomEmailLambdaVersionConfigType , CustomSMSLambdaVersionConfigType , DeleteGroupRequest , DeleteIdentityProviderRequest , DeleteResourceServerRequest , DeleteUserAttributesRequest , DeleteUserAttributesResponse , DeleteUserPoolClientRequest , DeleteUserPoolDomainRequest , DeleteUserPoolDomainResponse , DeleteUserPoolRequest , DeleteUserRequest , DeliveryMediumType , DescribeIdentityProviderRequest , DescribeIdentityProviderResponse , DescribeResourceServerRequest , DescribeResourceServerResponse , DescribeRiskConfigurationRequest , DescribeRiskConfigurationResponse , DescribeUserImportJobRequest , DescribeUserImportJobResponse , DescribeUserPoolClientRequest , DescribeUserPoolClientResponse , DescribeUserPoolDomainRequest , DescribeUserPoolDomainResponse , DescribeUserPoolRequest , DescribeUserPoolResponse , DeviceConfigurationType , DeviceSecretVerifierConfigType , DeviceType , DomainDescriptionType , DuplicateProviderException , EmailConfigurationType , EventContextDataType , EventFeedbackType , EventFilterType , EventRiskType , ExpiredCodeException , ExplicitAuthFlowsType , ForgetDeviceRequest , ForgotPasswordRequest , ForgotPasswordResponse , GetCSVHeaderRequest , GetCSVHeaderResponse , GetDeviceRequest , GetDeviceResponse , GetGroupRequest , GetGroupResponse , GetIdentityProviderByIdentifierRequest , GetIdentityProviderByIdentifierResponse , GetSigningCertificateRequest , GetSigningCertificateResponse , GetUICustomizationRequest , GetUICustomizationResponse , GetUserAttributeVerificationCodeRequest , GetUserAttributeVerificationCodeResponse , GetUserPoolMfaConfigRequest , GetUserPoolMfaConfigResponse , GetUserRequest , GetUserResponse , GlobalSignOutRequest , GlobalSignOutResponse , GroupExistsException , GroupType , HttpHeader , IdentityProviderType , InitiateAuthRequest , InitiateAuthResponse , InternalErrorException , InvalidEmailRoleAccessPolicyException , InvalidLambdaResponseException , InvalidOAuthFlowException , InvalidParameterException , InvalidPasswordException , InvalidSmsRoleAccessPolicyException , InvalidSmsRoleTrustRelationshipException , InvalidUserPoolConfigurationException , LambdaConfigType , LimitExceededException , ListDevicesRequest , ListDevicesResponse , ListGroupsRequest , ListGroupsResponse , ListIdentityProvidersRequest , ListIdentityProvidersResponse , ListResourceServersRequest , ListResourceServersResponse , ListTagsForResourceRequest , ListTagsForResourceResponse , ListUserImportJobsRequest , ListUserImportJobsResponse , ListUserPoolClientsRequest , ListUserPoolClientsResponse , ListUserPoolsRequest , ListUserPoolsResponse , ListUsersInGroupRequest , ListUsersInGroupResponse , ListUsersRequest , ListUsersResponse , MessageTemplateType , MFAMethodNotFoundException , MFAOptionType , NewDeviceMetadataType , NotAuthorizedException , NotifyConfigurationType , NotifyEmailType , NumberAttributeConstraintsType , OAuthFlowType , PasswordPolicyType , PasswordResetRequiredException , PreconditionNotMetException , ProviderDescription , ProviderUserIdentifierType , RecoveryOptionType , ResendConfirmationCodeRequest , ResendConfirmationCodeResponse , ResourceNotFoundException , ResourceServerScopeType , ResourceServerType , RespondToAuthChallengeRequest , RespondToAuthChallengeResponse , RevokeTokenRequest , RevokeTokenResponse , RiskConfigurationType , RiskExceptionConfigurationType , SchemaAttributeType , ScopeDoesNotExistException , SetRiskConfigurationRequest , SetRiskConfigurationResponse , SetUICustomizationRequest , SetUICustomizationResponse , SetUserMFAPreferenceRequest , SetUserMFAPreferenceResponse , SetUserPoolMfaConfigRequest , SetUserPoolMfaConfigResponse , SetUserSettingsRequest , SetUserSettingsResponse , SignUpRequest , SignUpResponse , SmsConfigurationType , SmsMfaConfigType , SMSMfaSettingsType , SoftwareTokenMfaConfigType , SoftwareTokenMFANotFoundException , SoftwareTokenMfaSettingsType , StartUserImportJobRequest , StringAttributeConstraintsType , TokenValidityUnitsType , TooManyFailedAttemptsException , TooManyRequestsException , UICustomizationType , UnauthorizedException , UnexpectedLambdaException , UnsupportedIdentityProviderException , UnsupportedOperationException , UnsupportedTokenTypeException , UnsupportedUserStateException , UserContextDataType , UserImportInProgressException , UserImportJobType , UserLambdaValidationException , UsernameAttributeType , UsernameConfigurationType , UsernameExistsException , UserNotConfirmedException , UserNotFoundException , UserPoolAddOnNotEnabledException , UserPoolAddOnsType , UserPoolClientDescription , UserPoolClientType , UserPoolDescriptionType , UserPoolPolicyType , UserPoolTaggingException , UserPoolType , UserType , VerificationMessageTemplateType , VerifiedAttributeType , } from "../models/models_0" ; import { EnableSoftwareTokenMFAException , StartUserImportJobResponse , StopUserImportJobRequest , StopUserImportJobResponse , TagResourceRequest , TagResourceResponse , UntagResourceRequest , UntagResourceResponse , UpdateAuthEventFeedbackRequest , UpdateAuthEventFeedbackResponse , UpdateDeviceStatusRequest , UpdateDeviceStatusResponse , UpdateGroupRequest , UpdateGroupResponse , UpdateIdentityProviderRequest , UpdateIdentityProviderResponse , UpdateResourceServerRequest , UpdateResourceServerResponse , UpdateUserAttributesRequest , UpdateUserAttributesResponse , UpdateUserPoolClientRequest , UpdateUserPoolClientResponse , UpdateUserPoolDomainRequest , UpdateUserPoolDomainResponse , UpdateUserPoolRequest , UpdateUserPoolResponse , VerifySoftwareTokenRequest , VerifySoftwareTokenResponse , VerifyUserAttributeRequest , VerifyUserAttributeResponse , } from "../models/models_1" ; export const serializeAws_json1_1AddCustomAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AddCustomAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AddCustomAttributesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminAddUserToGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminAddUserToGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminAddUserToGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminConfirmSignUpCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminConfirmSignUp" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminConfirmSignUpRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminCreateUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminCreateUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminCreateUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminDeleteUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminDeleteUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminDeleteUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminDeleteUserAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminDeleteUserAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminDeleteUserAttributesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminDisableProviderForUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminDisableProviderForUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminDisableProviderForUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminDisableUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminDisableUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminDisableUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminEnableUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminEnableUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminEnableUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminForgetDeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminForgetDevice" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminForgetDeviceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminGetDeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminGetDevice" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminGetDeviceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminGetUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminGetUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminGetUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminInitiateAuthCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminInitiateAuth" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminInitiateAuthRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminLinkProviderForUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminLinkProviderForUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminLinkProviderForUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminListDevicesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminListDevices" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminListDevicesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminListGroupsForUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminListGroupsForUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminListGroupsForUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminListUserAuthEventsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminListUserAuthEvents" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminListUserAuthEventsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminRemoveUserFromGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminRemoveUserFromGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminRemoveUserFromGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminResetUserPasswordCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminResetUserPassword" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminResetUserPasswordRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminRespondToAuthChallengeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminRespondToAuthChallenge" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminRespondToAuthChallengeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminSetUserMFAPreferenceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminSetUserMFAPreference" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminSetUserMFAPreferenceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminSetUserPasswordCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminSetUserPassword" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminSetUserPasswordRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminSetUserSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminSetUserSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminSetUserSettingsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminUpdateAuthEventFeedbackCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminUpdateAuthEventFeedback" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminUpdateAuthEventFeedbackRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminUpdateDeviceStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminUpdateDeviceStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminUpdateDeviceStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminUpdateUserAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminUpdateUserAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminUpdateUserAttributesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AdminUserGlobalSignOutCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AdminUserGlobalSignOut" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AdminUserGlobalSignOutRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AssociateSoftwareTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.AssociateSoftwareToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AssociateSoftwareTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ChangePasswordCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ChangePassword" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ChangePasswordRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ConfirmDeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ConfirmDevice" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ConfirmDeviceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ConfirmForgotPasswordCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ConfirmForgotPassword" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ConfirmForgotPasswordRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ConfirmSignUpCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ConfirmSignUp" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ConfirmSignUpRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateIdentityProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateIdentityProvider" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateIdentityProviderRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateResourceServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateResourceServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateResourceServerRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateUserImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateUserImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateUserImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateUserPoolCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateUserPool" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateUserPoolRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateUserPoolClientCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateUserPoolClient" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateUserPoolClientRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateUserPoolDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.CreateUserPoolDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateUserPoolDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteIdentityProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteIdentityProvider" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteIdentityProviderRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteResourceServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteResourceServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteResourceServerRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteUserAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteUserAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteUserAttributesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteUserPoolCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteUserPool" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteUserPoolRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteUserPoolClientCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteUserPoolClient" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteUserPoolClientRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteUserPoolDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DeleteUserPoolDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteUserPoolDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeIdentityProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeIdentityProvider" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeIdentityProviderRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeResourceServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeResourceServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeResourceServerRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeRiskConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeRiskConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeRiskConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeUserImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeUserImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeUserImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeUserPoolCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeUserPool" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeUserPoolRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeUserPoolClientCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeUserPoolClient" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeUserPoolClientRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeUserPoolDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.DescribeUserPoolDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeUserPoolDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ForgetDeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ForgetDevice" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ForgetDeviceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ForgotPasswordCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ForgotPassword" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ForgotPasswordRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetCSVHeaderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetCSVHeader" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetCSVHeaderRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetDevice" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDeviceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetIdentityProviderByIdentifierCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetIdentityProviderByIdentifier" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetIdentityProviderByIdentifierRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetSigningCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetSigningCertificate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetSigningCertificateRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetUICustomizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetUICustomization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetUICustomizationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetUser" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetUserRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetUserAttributeVerificationCodeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetUserAttributeVerificationCode" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetUserAttributeVerificationCodeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetUserPoolMfaConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GetUserPoolMfaConfig" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetUserPoolMfaConfigRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GlobalSignOutCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.GlobalSignOut" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GlobalSignOutRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1InitiateAuthCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.InitiateAuth" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1InitiateAuthRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListDevicesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListDevices" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListDevicesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListGroups" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListGroupsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListIdentityProvidersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListIdentityProviders" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListIdentityProvidersRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListResourceServersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListResourceServers" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListResourceServersRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListUserImportJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListUserImportJobs" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListUserImportJobsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListUserPoolClientsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListUserPoolClients" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListUserPoolClientsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListUserPoolsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListUserPools" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListUserPoolsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListUsersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListUsers" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListUsersRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListUsersInGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ListUsersInGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListUsersInGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ResendConfirmationCodeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.ResendConfirmationCode" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ResendConfirmationCodeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RespondToAuthChallengeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.RespondToAuthChallenge" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RespondToAuthChallengeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RevokeTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.RevokeToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RevokeTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SetRiskConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.SetRiskConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SetRiskConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SetUICustomizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.SetUICustomization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SetUICustomizationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SetUserMFAPreferenceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.SetUserMFAPreference" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SetUserMFAPreferenceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SetUserPoolMfaConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.SetUserPoolMfaConfig" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SetUserPoolMfaConfigRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SetUserSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.SetUserSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SetUserSettingsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SignUpCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.SignUp" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SignUpRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartUserImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.StartUserImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartUserImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopUserImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.StopUserImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopUserImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateAuthEventFeedbackCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateAuthEventFeedback" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateAuthEventFeedbackRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDeviceStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateDeviceStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDeviceStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateIdentityProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateIdentityProvider" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateIdentityProviderRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateResourceServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateResourceServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateResourceServerRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateUserAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateUserAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateUserAttributesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateUserPoolCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateUserPool" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateUserPoolRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateUserPoolClientCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateUserPoolClient" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateUserPoolClientRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateUserPoolDomainCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.UpdateUserPoolDomain" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateUserPoolDomainRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1VerifySoftwareTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.VerifySoftwareToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1VerifySoftwareTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1VerifyUserAttributeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSCognitoIdentityProviderService.VerifyUserAttribute" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1VerifyUserAttributeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AddCustomAttributesCommand = async ( output , context ) : Promise < AddCustomAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AddCustomAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AddCustomAttributesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AddCustomAttributesCommandError = async ( output , context ) : Promise < AddCustomAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserImportInProgressException" : case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException" : response = { ... ( await deserializeAws_json1_1UserImportInProgressExceptionResponse ( 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_1AdminAddUserToGroupCommand = async ( output , context ) : Promise < AdminAddUserToGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminAddUserToGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminAddUserToGroupCommandError = async ( output , context ) : Promise < AdminAddUserToGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminConfirmSignUpCommand = async ( output , context ) : Promise < AdminConfirmSignUpCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminConfirmSignUpCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminConfirmSignUpResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminConfirmSignUpCommandError = async ( output , context ) : Promise < AdminConfirmSignUpCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFailedAttemptsException" : case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException" : response = { ... ( await deserializeAws_json1_1TooManyFailedAttemptsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminCreateUserCommand = async ( output , context ) : Promise < AdminCreateUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminCreateUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminCreateUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminCreateUserCommandError = async ( output , context ) : Promise < AdminCreateUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException" : response = { ... ( await deserializeAws_json1_1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserStateException" : case "com.amazonaws.cognitoidentityprovider#UnsupportedUserStateException" : response = { ... ( await deserializeAws_json1_1UnsupportedUserStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UsernameExistsException" : case "com.amazonaws.cognitoidentityprovider#UsernameExistsException" : response = { ... ( await deserializeAws_json1_1UsernameExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminDeleteUserCommand = async ( output , context ) : Promise < AdminDeleteUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminDeleteUserCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminDeleteUserCommandError = async ( output , context ) : Promise < AdminDeleteUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminDeleteUserAttributesCommand = async ( output , context ) : Promise < AdminDeleteUserAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminDeleteUserAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminDeleteUserAttributesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminDeleteUserAttributesCommandError = async ( output , context ) : Promise < AdminDeleteUserAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminDisableProviderForUserCommand = async ( output , context ) : Promise < AdminDisableProviderForUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminDisableProviderForUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminDisableProviderForUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminDisableProviderForUserCommandError = async ( output , context ) : Promise < AdminDisableProviderForUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminDisableUserCommand = async ( output , context ) : Promise < AdminDisableUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminDisableUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminDisableUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminDisableUserCommandError = async ( output , context ) : Promise < AdminDisableUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminEnableUserCommand = async ( output , context ) : Promise < AdminEnableUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminEnableUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminEnableUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminEnableUserCommandError = async ( output , context ) : Promise < AdminEnableUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminForgetDeviceCommand = async ( output , context ) : Promise < AdminForgetDeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminForgetDeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminForgetDeviceCommandError = async ( output , context ) : Promise < AdminForgetDeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminGetDeviceCommand = async ( output , context ) : Promise < AdminGetDeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminGetDeviceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminGetDeviceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminGetDeviceCommandError = async ( output , context ) : Promise < AdminGetDeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1AdminGetUserCommand = async ( output , context ) : Promise < AdminGetUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminGetUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminGetUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminGetUserCommandError = async ( output , context ) : Promise < AdminGetUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminInitiateAuthCommand = async ( output , context ) : Promise < AdminInitiateAuthCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminInitiateAuthCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminInitiateAuthResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminInitiateAuthCommandError = async ( output , context ) : Promise < AdminInitiateAuthCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MFAMethodNotFoundException" : case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException" : response = { ... ( await deserializeAws_json1_1MFAMethodNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminLinkProviderForUserCommand = async ( output , context ) : Promise < AdminLinkProviderForUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminLinkProviderForUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminLinkProviderForUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminLinkProviderForUserCommandError = async ( output , context ) : Promise < AdminLinkProviderForUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminListDevicesCommand = async ( output , context ) : Promise < AdminListDevicesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminListDevicesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminListDevicesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminListDevicesCommandError = async ( output , context ) : Promise < AdminListDevicesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1AdminListGroupsForUserCommand = async ( output , context ) : Promise < AdminListGroupsForUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminListGroupsForUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminListGroupsForUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminListGroupsForUserCommandError = async ( output , context ) : Promise < AdminListGroupsForUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminListUserAuthEventsCommand = async ( output , context ) : Promise < AdminListUserAuthEventsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminListUserAuthEventsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminListUserAuthEventsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminListUserAuthEventsCommandError = async ( output , context ) : Promise < AdminListUserAuthEventsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolAddOnNotEnabledException" : case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException" : response = { ... ( await deserializeAws_json1_1UserPoolAddOnNotEnabledExceptionResponse ( 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_1AdminRemoveUserFromGroupCommand = async ( output , context ) : Promise < AdminRemoveUserFromGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminRemoveUserFromGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminRemoveUserFromGroupCommandError = async ( output , context ) : Promise < AdminRemoveUserFromGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminResetUserPasswordCommand = async ( output , context ) : Promise < AdminResetUserPasswordCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminResetUserPasswordCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminResetUserPasswordResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminResetUserPasswordCommandError = async ( output , context ) : Promise < AdminResetUserPasswordCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminRespondToAuthChallengeCommand = async ( output , context ) : Promise < AdminRespondToAuthChallengeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminRespondToAuthChallengeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminRespondToAuthChallengeResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminRespondToAuthChallengeCommandError = async ( output , context ) : Promise < AdminRespondToAuthChallengeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExpiredCodeException" : case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException" : response = { ... ( await deserializeAws_json1_1ExpiredCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MFAMethodNotFoundException" : case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException" : response = { ... ( await deserializeAws_json1_1MFAMethodNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SoftwareTokenMFANotFoundException" : case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException" : response = { ... ( await deserializeAws_json1_1SoftwareTokenMFANotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminSetUserMFAPreferenceCommand = async ( output , context ) : Promise < AdminSetUserMFAPreferenceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminSetUserMFAPreferenceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminSetUserMFAPreferenceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminSetUserMFAPreferenceCommandError = async ( output , context ) : Promise < AdminSetUserMFAPreferenceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminSetUserPasswordCommand = async ( output , context ) : Promise < AdminSetUserPasswordCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminSetUserPasswordCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminSetUserPasswordResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminSetUserPasswordCommandError = async ( output , context ) : Promise < AdminSetUserPasswordCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminSetUserSettingsCommand = async ( output , context ) : Promise < AdminSetUserSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminSetUserSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminSetUserSettingsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminSetUserSettingsCommandError = async ( output , context ) : Promise < AdminSetUserSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminUpdateAuthEventFeedbackCommand = async ( output , context ) : Promise < AdminUpdateAuthEventFeedbackCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminUpdateAuthEventFeedbackResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminUpdateAuthEventFeedbackCommandError = async ( output , context ) : Promise < AdminUpdateAuthEventFeedbackCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolAddOnNotEnabledException" : case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException" : response = { ... ( await deserializeAws_json1_1UserPoolAddOnNotEnabledExceptionResponse ( 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_1AdminUpdateDeviceStatusCommand = async ( output , context ) : Promise < AdminUpdateDeviceStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminUpdateDeviceStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminUpdateDeviceStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminUpdateDeviceStatusCommandError = async ( output , context ) : Promise < AdminUpdateDeviceStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminUpdateUserAttributesCommand = async ( output , context ) : Promise < AdminUpdateUserAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminUpdateUserAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminUpdateUserAttributesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminUpdateUserAttributesCommandError = async ( output , context ) : Promise < AdminUpdateUserAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AdminUserGlobalSignOutCommand = async ( output , context ) : Promise < AdminUserGlobalSignOutCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AdminUserGlobalSignOutCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AdminUserGlobalSignOutResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AdminUserGlobalSignOutCommandError = async ( output , context ) : Promise < AdminUserGlobalSignOutCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AssociateSoftwareTokenCommand = async ( output , context ) : Promise < AssociateSoftwareTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AssociateSoftwareTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AssociateSoftwareTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AssociateSoftwareTokenCommandError = async ( output , context ) : Promise < AssociateSoftwareTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException" : response = { ... ( await deserializeAws_json1_1ConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SoftwareTokenMFANotFoundException" : case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException" : response = { ... ( await deserializeAws_json1_1SoftwareTokenMFANotFoundExceptionResponse ( 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_1ChangePasswordCommand = async ( output , context ) : Promise < ChangePasswordCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ChangePasswordCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ChangePasswordResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ChangePasswordCommandError = async ( output , context ) : Promise < ChangePasswordCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1ConfirmDeviceCommand = async ( output , context ) : Promise < ConfirmDeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ConfirmDeviceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ConfirmDeviceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ConfirmDeviceCommandError = async ( output , context ) : Promise < ConfirmDeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UsernameExistsException" : case "com.amazonaws.cognitoidentityprovider#UsernameExistsException" : response = { ... ( await deserializeAws_json1_1UsernameExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1ConfirmForgotPasswordCommand = async ( output , context ) : Promise < ConfirmForgotPasswordCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ConfirmForgotPasswordCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ConfirmForgotPasswordResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ConfirmForgotPasswordCommandError = async ( output , context ) : Promise < ConfirmForgotPasswordCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExpiredCodeException" : case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException" : response = { ... ( await deserializeAws_json1_1ExpiredCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFailedAttemptsException" : case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException" : response = { ... ( await deserializeAws_json1_1TooManyFailedAttemptsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1ConfirmSignUpCommand = async ( output , context ) : Promise < ConfirmSignUpCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ConfirmSignUpCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ConfirmSignUpResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ConfirmSignUpCommandError = async ( output , context ) : Promise < ConfirmSignUpCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExpiredCodeException" : case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException" : response = { ... ( await deserializeAws_json1_1ExpiredCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyFailedAttemptsException" : case "com.amazonaws.cognitoidentityprovider#TooManyFailedAttemptsException" : response = { ... ( await deserializeAws_json1_1TooManyFailedAttemptsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1CreateGroupCommand = async ( output , context ) : Promise < CreateGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateGroupCommandError = async ( output , context ) : Promise < CreateGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "GroupExistsException" : case "com.amazonaws.cognitoidentityprovider#GroupExistsException" : response = { ... ( await deserializeAws_json1_1GroupExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1CreateIdentityProviderCommand = async ( output , context ) : Promise < CreateIdentityProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateIdentityProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateIdentityProviderResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateIdentityProviderCommandError = async ( output , context ) : Promise < CreateIdentityProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateProviderException" : case "com.amazonaws.cognitoidentityprovider#DuplicateProviderException" : response = { ... ( await deserializeAws_json1_1DuplicateProviderExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1CreateResourceServerCommand = async ( output , context ) : Promise < CreateResourceServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateResourceServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateResourceServerResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateResourceServerCommandError = async ( output , context ) : Promise < CreateResourceServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1CreateUserImportJobCommand = async ( output , context ) : Promise < CreateUserImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateUserImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateUserImportJobResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateUserImportJobCommandError = async ( output , context ) : Promise < CreateUserImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException" : response = { ... ( await deserializeAws_json1_1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1CreateUserPoolCommand = async ( output , context ) : Promise < CreateUserPoolCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateUserPoolCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateUserPoolResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateUserPoolCommandError = async ( output , context ) : Promise < CreateUserPoolCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolTaggingException" : case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException" : response = { ... ( await deserializeAws_json1_1UserPoolTaggingExceptionResponse ( 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_1CreateUserPoolClientCommand = async ( output , context ) : Promise < CreateUserPoolClientCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateUserPoolClientCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateUserPoolClientResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateUserPoolClientCommandError = async ( output , context ) : Promise < CreateUserPoolClientCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOAuthFlowException" : case "com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException" : response = { ... ( await deserializeAws_json1_1InvalidOAuthFlowExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ScopeDoesNotExistException" : case "com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException" : response = { ... ( await deserializeAws_json1_1ScopeDoesNotExistExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1CreateUserPoolDomainCommand = async ( output , context ) : Promise < CreateUserPoolDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateUserPoolDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateUserPoolDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateUserPoolDomainCommandError = async ( output , context ) : Promise < CreateUserPoolDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( 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_1DeleteGroupCommand = async ( output , context ) : Promise < DeleteGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteGroupCommandError = async ( output , context ) : Promise < DeleteGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DeleteIdentityProviderCommand = async ( output , context ) : Promise < DeleteIdentityProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteIdentityProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteIdentityProviderCommandError = async ( output , context ) : Promise < DeleteIdentityProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedIdentityProviderException" : case "com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException" : response = { ... ( await deserializeAws_json1_1UnsupportedIdentityProviderExceptionResponse ( 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_1DeleteResourceServerCommand = async ( output , context ) : Promise < DeleteResourceServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteResourceServerCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteResourceServerCommandError = async ( output , context ) : Promise < DeleteResourceServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DeleteUserCommand = async ( output , context ) : Promise < DeleteUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteUserCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteUserCommandError = async ( output , context ) : Promise < DeleteUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1DeleteUserAttributesCommand = async ( output , context ) : Promise < DeleteUserAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteUserAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteUserAttributesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteUserAttributesCommandError = async ( output , context ) : Promise < DeleteUserAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1DeleteUserPoolCommand = async ( output , context ) : Promise < DeleteUserPoolCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteUserPoolCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteUserPoolCommandError = async ( output , context ) : Promise < DeleteUserPoolCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserImportInProgressException" : case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException" : response = { ... ( await deserializeAws_json1_1UserImportInProgressExceptionResponse ( 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_1DeleteUserPoolClientCommand = async ( output , context ) : Promise < DeleteUserPoolClientCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteUserPoolClientCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteUserPoolClientCommandError = async ( output , context ) : Promise < DeleteUserPoolClientCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DeleteUserPoolDomainCommand = async ( output , context ) : Promise < DeleteUserPoolDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteUserPoolDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteUserPoolDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteUserPoolDomainCommandError = async ( output , context ) : Promise < DeleteUserPoolDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( 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_1DescribeIdentityProviderCommand = async ( output , context ) : Promise < DescribeIdentityProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeIdentityProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeIdentityProviderResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeIdentityProviderCommandError = async ( output , context ) : Promise < DescribeIdentityProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DescribeResourceServerCommand = async ( output , context ) : Promise < DescribeResourceServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeResourceServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeResourceServerResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeResourceServerCommandError = async ( output , context ) : Promise < DescribeResourceServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DescribeRiskConfigurationCommand = async ( output , context ) : Promise < DescribeRiskConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeRiskConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeRiskConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeRiskConfigurationCommandError = async ( output , context ) : Promise < DescribeRiskConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolAddOnNotEnabledException" : case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException" : response = { ... ( await deserializeAws_json1_1UserPoolAddOnNotEnabledExceptionResponse ( 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_1DescribeUserImportJobCommand = async ( output , context ) : Promise < DescribeUserImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeUserImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeUserImportJobResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeUserImportJobCommandError = async ( output , context ) : Promise < DescribeUserImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DescribeUserPoolCommand = async ( output , context ) : Promise < DescribeUserPoolCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeUserPoolCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeUserPoolResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeUserPoolCommandError = async ( output , context ) : Promise < DescribeUserPoolCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolTaggingException" : case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException" : response = { ... ( await deserializeAws_json1_1UserPoolTaggingExceptionResponse ( 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_1DescribeUserPoolClientCommand = async ( output , context ) : Promise < DescribeUserPoolClientCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeUserPoolClientCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeUserPoolClientResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeUserPoolClientCommandError = async ( output , context ) : Promise < DescribeUserPoolClientCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1DescribeUserPoolDomainCommand = async ( output , context ) : Promise < DescribeUserPoolDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeUserPoolDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeUserPoolDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeUserPoolDomainCommandError = async ( output , context ) : Promise < DescribeUserPoolDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( 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_1ForgetDeviceCommand = async ( output , context ) : Promise < ForgetDeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ForgetDeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ForgetDeviceCommandError = async ( output , context ) : Promise < ForgetDeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1ForgotPasswordCommand = async ( output , context ) : Promise < ForgotPasswordCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ForgotPasswordCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ForgotPasswordResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ForgotPasswordCommandError = async ( output , context ) : Promise < ForgotPasswordCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1GetCSVHeaderCommand = async ( output , context ) : Promise < GetCSVHeaderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetCSVHeaderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetCSVHeaderResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetCSVHeaderCommandError = async ( output , context ) : Promise < GetCSVHeaderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1GetDeviceCommand = async ( output , context ) : Promise < GetDeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDeviceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDeviceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDeviceCommandError = async ( output , context ) : Promise < GetDeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1GetGroupCommand = async ( output , context ) : Promise < GetGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetGroupCommandError = async ( output , context ) : Promise < GetGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1GetIdentityProviderByIdentifierCommand = async ( output , context ) : Promise < GetIdentityProviderByIdentifierCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetIdentityProviderByIdentifierCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetIdentityProviderByIdentifierResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetIdentityProviderByIdentifierCommandError = async ( output , context ) : Promise < GetIdentityProviderByIdentifierCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1GetSigningCertificateCommand = async ( output , context ) : Promise < GetSigningCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetSigningCertificateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetSigningCertificateResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetSigningCertificateCommandError = async ( output , context ) : Promise < GetSigningCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( 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_1GetUICustomizationCommand = async ( output , context ) : Promise < GetUICustomizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetUICustomizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetUICustomizationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetUICustomizationCommandError = async ( output , context ) : Promise < GetUICustomizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1GetUserCommand = async ( output , context ) : Promise < GetUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetUserResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetUserCommandError = async ( output , context ) : Promise < GetUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1GetUserAttributeVerificationCodeCommand = async ( output , context ) : Promise < GetUserAttributeVerificationCodeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetUserAttributeVerificationCodeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetUserAttributeVerificationCodeResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetUserAttributeVerificationCodeCommandError = async ( output , context ) : Promise < GetUserAttributeVerificationCodeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1GetUserPoolMfaConfigCommand = async ( output , context ) : Promise < GetUserPoolMfaConfigCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetUserPoolMfaConfigCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetUserPoolMfaConfigResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetUserPoolMfaConfigCommandError = async ( output , context ) : Promise < GetUserPoolMfaConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1GlobalSignOutCommand = async ( output , context ) : Promise < GlobalSignOutCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GlobalSignOutCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GlobalSignOutResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GlobalSignOutCommandError = async ( output , context ) : Promise < GlobalSignOutCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( 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_1InitiateAuthCommand = async ( output , context ) : Promise < InitiateAuthCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1InitiateAuthCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1InitiateAuthResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1InitiateAuthCommandError = async ( output , context ) : Promise < InitiateAuthCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1ListDevicesCommand = async ( output , context ) : Promise < ListDevicesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListDevicesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListDevicesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListDevicesCommandError = async ( output , context ) : Promise < ListDevicesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1ListGroupsCommand = async ( output , context ) : Promise < ListGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListGroupsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListGroupsCommandError = async ( output , context ) : Promise < ListGroupsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListIdentityProvidersCommand = async ( output , context ) : Promise < ListIdentityProvidersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListIdentityProvidersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListIdentityProvidersResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListIdentityProvidersCommandError = async ( output , context ) : Promise < ListIdentityProvidersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListResourceServersCommand = async ( output , context ) : Promise < ListResourceServersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListResourceServersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListResourceServersResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListResourceServersCommandError = async ( output , context ) : Promise < ListResourceServersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTagsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListUserImportJobsCommand = async ( output , context ) : Promise < ListUserImportJobsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListUserImportJobsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListUserImportJobsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListUserImportJobsCommandError = async ( output , context ) : Promise < ListUserImportJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListUserPoolClientsCommand = async ( output , context ) : Promise < ListUserPoolClientsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListUserPoolClientsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListUserPoolClientsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListUserPoolClientsCommandError = async ( output , context ) : Promise < ListUserPoolClientsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListUserPoolsCommand = async ( output , context ) : Promise < ListUserPoolsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListUserPoolsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListUserPoolsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListUserPoolsCommandError = async ( output , context ) : Promise < ListUserPoolsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListUsersCommand = async ( output , context ) : Promise < ListUsersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListUsersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListUsersResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListUsersCommandError = async ( output , context ) : Promise < ListUsersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ListUsersInGroupCommand = async ( output , context ) : Promise < ListUsersInGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListUsersInGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListUsersInGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListUsersInGroupCommandError = async ( output , context ) : Promise < ListUsersInGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1ResendConfirmationCodeCommand = async ( output , context ) : Promise < ResendConfirmationCodeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ResendConfirmationCodeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ResendConfirmationCodeResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ResendConfirmationCodeCommandError = async ( output , context ) : Promise < ResendConfirmationCodeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1RespondToAuthChallengeCommand = async ( output , context ) : Promise < RespondToAuthChallengeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RespondToAuthChallengeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RespondToAuthChallengeResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RespondToAuthChallengeCommandError = async ( output , context ) : Promise < RespondToAuthChallengeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExpiredCodeException" : case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException" : response = { ... ( await deserializeAws_json1_1ExpiredCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MFAMethodNotFoundException" : case "com.amazonaws.cognitoidentityprovider#MFAMethodNotFoundException" : response = { ... ( await deserializeAws_json1_1MFAMethodNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SoftwareTokenMFANotFoundException" : case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException" : response = { ... ( await deserializeAws_json1_1SoftwareTokenMFANotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1RevokeTokenCommand = async ( output , context ) : Promise < RevokeTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RevokeTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RevokeTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RevokeTokenCommandError = async ( output , context ) : Promise < RevokeTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.cognitoidentityprovider#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedOperationException" : case "com.amazonaws.cognitoidentityprovider#UnsupportedOperationException" : response = { ... ( await deserializeAws_json1_1UnsupportedOperationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedTokenTypeException" : case "com.amazonaws.cognitoidentityprovider#UnsupportedTokenTypeException" : response = { ... ( await deserializeAws_json1_1UnsupportedTokenTypeExceptionResponse ( 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_1SetRiskConfigurationCommand = async ( output , context ) : Promise < SetRiskConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SetRiskConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SetRiskConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SetRiskConfigurationCommandError = async ( output , context ) : Promise < SetRiskConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolAddOnNotEnabledException" : case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException" : response = { ... ( await deserializeAws_json1_1UserPoolAddOnNotEnabledExceptionResponse ( 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_1SetUICustomizationCommand = async ( output , context ) : Promise < SetUICustomizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SetUICustomizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SetUICustomizationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SetUICustomizationCommandError = async ( output , context ) : Promise < SetUICustomizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1SetUserMFAPreferenceCommand = async ( output , context ) : Promise < SetUserMFAPreferenceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SetUserMFAPreferenceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SetUserMFAPreferenceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SetUserMFAPreferenceCommandError = async ( output , context ) : Promise < SetUserMFAPreferenceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1SetUserPoolMfaConfigCommand = async ( output , context ) : Promise < SetUserPoolMfaConfigCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SetUserPoolMfaConfigCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SetUserPoolMfaConfigResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SetUserPoolMfaConfigCommandError = async ( output , context ) : Promise < SetUserPoolMfaConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1SetUserSettingsCommand = async ( output , context ) : Promise < SetUserSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SetUserSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SetUserSettingsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SetUserSettingsCommandError = async ( output , context ) : Promise < SetUserSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1SignUpCommand = async ( output , context ) : Promise < SignUpCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SignUpCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SignUpResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SignUpCommandError = async ( output , context ) : Promise < SignUpCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPasswordException" : case "com.amazonaws.cognitoidentityprovider#InvalidPasswordException" : response = { ... ( await deserializeAws_json1_1InvalidPasswordExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UsernameExistsException" : case "com.amazonaws.cognitoidentityprovider#UsernameExistsException" : response = { ... ( await deserializeAws_json1_1UsernameExistsExceptionResponse ( 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_1StartUserImportJobCommand = async ( output , context ) : Promise < StartUserImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartUserImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartUserImportJobResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartUserImportJobCommandError = async ( output , context ) : Promise < StartUserImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException" : response = { ... ( await deserializeAws_json1_1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1StopUserImportJobCommand = async ( output , context ) : Promise < StopUserImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopUserImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopUserImportJobResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopUserImportJobCommandError = async ( output , context ) : Promise < StopUserImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.cognitoidentityprovider#PreconditionNotMetException" : response = { ... ( await deserializeAws_json1_1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UntagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1UpdateAuthEventFeedbackCommand = async ( output , context ) : Promise < UpdateAuthEventFeedbackCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateAuthEventFeedbackCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateAuthEventFeedbackResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateAuthEventFeedbackCommandError = async ( output , context ) : Promise < UpdateAuthEventFeedbackCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolAddOnNotEnabledException" : case "com.amazonaws.cognitoidentityprovider#UserPoolAddOnNotEnabledException" : response = { ... ( await deserializeAws_json1_1UserPoolAddOnNotEnabledExceptionResponse ( 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_1UpdateDeviceStatusCommand = async ( output , context ) : Promise < UpdateDeviceStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDeviceStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDeviceStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDeviceStatusCommandError = async ( output , context ) : Promise < UpdateDeviceStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1UpdateGroupCommand = async ( output , context ) : Promise < UpdateGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateGroupResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateGroupCommandError = async ( output , context ) : Promise < UpdateGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1UpdateIdentityProviderCommand = async ( output , context ) : Promise < UpdateIdentityProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateIdentityProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateIdentityProviderResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateIdentityProviderCommandError = async ( output , context ) : Promise < UpdateIdentityProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedIdentityProviderException" : case "com.amazonaws.cognitoidentityprovider#UnsupportedIdentityProviderException" : response = { ... ( await deserializeAws_json1_1UnsupportedIdentityProviderExceptionResponse ( 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_1UpdateResourceServerCommand = async ( output , context ) : Promise < UpdateResourceServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateResourceServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateResourceServerResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateResourceServerCommandError = async ( output , context ) : Promise < UpdateResourceServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1UpdateUserAttributesCommand = async ( output , context ) : Promise < UpdateUserAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateUserAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateUserAttributesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateUserAttributesCommandError = async ( output , context ) : Promise < UpdateUserAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AliasExistsException" : case "com.amazonaws.cognitoidentityprovider#AliasExistsException" : response = { ... ( await deserializeAws_json1_1AliasExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CodeDeliveryFailureException" : case "com.amazonaws.cognitoidentityprovider#CodeDeliveryFailureException" : response = { ... ( await deserializeAws_json1_1CodeDeliveryFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExpiredCodeException" : case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException" : response = { ... ( await deserializeAws_json1_1ExpiredCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLambdaResponseException" : case "com.amazonaws.cognitoidentityprovider#InvalidLambdaResponseException" : response = { ... ( await deserializeAws_json1_1InvalidLambdaResponseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnexpectedLambdaException" : case "com.amazonaws.cognitoidentityprovider#UnexpectedLambdaException" : response = { ... ( await deserializeAws_json1_1UnexpectedLambdaExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserLambdaValidationException" : case "com.amazonaws.cognitoidentityprovider#UserLambdaValidationException" : response = { ... ( await deserializeAws_json1_1UserLambdaValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1UpdateUserPoolCommand = async ( output , context ) : Promise < UpdateUserPoolCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateUserPoolCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateUserPoolResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateUserPoolCommandError = async ( output , context ) : Promise < UpdateUserPoolCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException" : response = { ... ( await deserializeAws_json1_1ConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidEmailRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidEmailRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleAccessPolicyException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleAccessPolicyException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidSmsRoleTrustRelationshipException" : case "com.amazonaws.cognitoidentityprovider#InvalidSmsRoleTrustRelationshipException" : response = { ... ( await deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserImportInProgressException" : case "com.amazonaws.cognitoidentityprovider#UserImportInProgressException" : response = { ... ( await deserializeAws_json1_1UserImportInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserPoolTaggingException" : case "com.amazonaws.cognitoidentityprovider#UserPoolTaggingException" : response = { ... ( await deserializeAws_json1_1UserPoolTaggingExceptionResponse ( 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_1UpdateUserPoolClientCommand = async ( output , context ) : Promise < UpdateUserPoolClientCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateUserPoolClientCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateUserPoolClientResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateUserPoolClientCommandError = async ( output , context ) : Promise < UpdateUserPoolClientCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.cognitoidentityprovider#ConcurrentModificationException" : response = { ... ( await deserializeAws_json1_1ConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidOAuthFlowException" : case "com.amazonaws.cognitoidentityprovider#InvalidOAuthFlowException" : response = { ... ( await deserializeAws_json1_1InvalidOAuthFlowExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ScopeDoesNotExistException" : case "com.amazonaws.cognitoidentityprovider#ScopeDoesNotExistException" : response = { ... ( await deserializeAws_json1_1ScopeDoesNotExistExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1UpdateUserPoolDomainCommand = async ( output , context ) : Promise < UpdateUserPoolDomainCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateUserPoolDomainCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateUserPoolDomainResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateUserPoolDomainCommandError = async ( output , context ) : Promise < UpdateUserPoolDomainCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( 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_1VerifySoftwareTokenCommand = async ( output , context ) : Promise < VerifySoftwareTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1VerifySoftwareTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1VerifySoftwareTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1VerifySoftwareTokenCommandError = async ( output , context ) : Promise < VerifySoftwareTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EnableSoftwareTokenMFAException" : case "com.amazonaws.cognitoidentityprovider#EnableSoftwareTokenMFAException" : response = { ... ( await deserializeAws_json1_1EnableSoftwareTokenMFAExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserPoolConfigurationException" : case "com.amazonaws.cognitoidentityprovider#InvalidUserPoolConfigurationException" : response = { ... ( await deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SoftwareTokenMFANotFoundException" : case "com.amazonaws.cognitoidentityprovider#SoftwareTokenMFANotFoundException" : response = { ... ( await deserializeAws_json1_1SoftwareTokenMFANotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1VerifyUserAttributeCommand = async ( output , context ) : Promise < VerifyUserAttributeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1VerifyUserAttributeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1VerifyUserAttributeResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1VerifyUserAttributeCommandError = async ( output , context ) : Promise < VerifyUserAttributeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CodeMismatchException" : case "com.amazonaws.cognitoidentityprovider#CodeMismatchException" : response = { ... ( await deserializeAws_json1_1CodeMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExpiredCodeException" : case "com.amazonaws.cognitoidentityprovider#ExpiredCodeException" : response = { ... ( await deserializeAws_json1_1ExpiredCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalErrorException" : case "com.amazonaws.cognitoidentityprovider#InternalErrorException" : response = { ... ( await deserializeAws_json1_1InternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.cognitoidentityprovider#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.cognitoidentityprovider#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotAuthorizedException" : case "com.amazonaws.cognitoidentityprovider#NotAuthorizedException" : response = { ... ( await deserializeAws_json1_1NotAuthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordResetRequiredException" : case "com.amazonaws.cognitoidentityprovider#PasswordResetRequiredException" : response = { ... ( await deserializeAws_json1_1PasswordResetRequiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.cognitoidentityprovider#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyRequestsException" : case "com.amazonaws.cognitoidentityprovider#TooManyRequestsException" : response = { ... ( await deserializeAws_json1_1TooManyRequestsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotConfirmedException" : case "com.amazonaws.cognitoidentityprovider#UserNotConfirmedException" : response = { ... ( await deserializeAws_json1_1UserNotConfirmedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UserNotFoundException" : case "com.amazonaws.cognitoidentityprovider#UserNotFoundException" : response = { ... ( await deserializeAws_json1_1UserNotFoundExceptionResponse ( 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_1AliasExistsExceptionResponse = async ( parsedOutput , context ) : Promise < AliasExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AliasExistsException ( body , context ) ; const contents = { name : "AliasExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1CodeDeliveryFailureExceptionResponse = async ( parsedOutput , context ) : Promise < CodeDeliveryFailureException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1CodeDeliveryFailureException ( body , context ) ; const contents = { name : "CodeDeliveryFailureException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1CodeMismatchExceptionResponse = async ( parsedOutput , context ) : Promise < CodeMismatchException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1CodeMismatchException ( body , context ) ; const contents = { name : "CodeMismatchException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ConcurrentModificationExceptionResponse = async ( parsedOutput , context ) : Promise < ConcurrentModificationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ConcurrentModificationException ( body , context ) ; const contents = { name : "ConcurrentModificationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1DuplicateProviderExceptionResponse = async ( parsedOutput , context ) : Promise < DuplicateProviderException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1DuplicateProviderException ( body , context ) ; const contents = { name : "DuplicateProviderException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1EnableSoftwareTokenMFAExceptionResponse = async ( parsedOutput , context ) : Promise < EnableSoftwareTokenMFAException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1EnableSoftwareTokenMFAException ( body , context ) ; const contents = { name : "EnableSoftwareTokenMFAException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ExpiredCodeExceptionResponse = async ( parsedOutput , context ) : Promise < ExpiredCodeException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ExpiredCodeException ( body , context ) ; const contents = { name : "ExpiredCodeException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1GroupExistsExceptionResponse = async ( parsedOutput , context ) : Promise < GroupExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1GroupExistsException ( body , context ) ; const contents = { name : "GroupExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InternalErrorExceptionResponse = async ( parsedOutput , context ) : Promise < InternalErrorException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InternalErrorException ( body , context ) ; const contents = { name : "InternalErrorException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidEmailRoleAccessPolicyExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidEmailRoleAccessPolicyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidEmailRoleAccessPolicyException ( body , context ) ; const contents = { name : "InvalidEmailRoleAccessPolicyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidLambdaResponseExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidLambdaResponseException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidLambdaResponseException ( body , context ) ; const contents = { name : "InvalidLambdaResponseException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidOAuthFlowExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidOAuthFlowException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidOAuthFlowException ( body , context ) ; const contents = { name : "InvalidOAuthFlowException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidParameterExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidParameterException ( body , context ) ; const contents = { name : "InvalidParameterException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidPasswordExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidPasswordException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidPasswordException ( body , context ) ; const contents = { name : "InvalidPasswordException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidSmsRoleAccessPolicyExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidSmsRoleAccessPolicyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidSmsRoleAccessPolicyException ( body , context ) ; const contents = { name : "InvalidSmsRoleAccessPolicyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidSmsRoleTrustRelationshipExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidSmsRoleTrustRelationshipException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidSmsRoleTrustRelationshipException ( body , context ) ; const contents = { name : "InvalidSmsRoleTrustRelationshipException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidUserPoolConfigurationExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidUserPoolConfigurationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidUserPoolConfigurationException ( body , context ) ; const contents = { name : "InvalidUserPoolConfigurationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LimitExceededException ( body , context ) ; const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1MFAMethodNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < MFAMethodNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1MFAMethodNotFoundException ( body , context ) ; const contents = { name : "MFAMethodNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1NotAuthorizedExceptionResponse = async ( parsedOutput , context ) : Promise < NotAuthorizedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1NotAuthorizedException ( body , context ) ; const contents = { name : "NotAuthorizedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1PasswordResetRequiredExceptionResponse = async ( parsedOutput , context ) : Promise < PasswordResetRequiredException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1PasswordResetRequiredException ( body , context ) ; const contents = { name : "PasswordResetRequiredException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1PreconditionNotMetExceptionResponse = async ( parsedOutput , context ) : Promise < PreconditionNotMetException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1PreconditionNotMetException ( body , context ) ; const contents = { name : "PreconditionNotMetException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceNotFoundException ( body , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ScopeDoesNotExistExceptionResponse = async ( parsedOutput , context ) : Promise < ScopeDoesNotExistException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ScopeDoesNotExistException ( body , context ) ; const contents = { name : "ScopeDoesNotExistException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1SoftwareTokenMFANotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < SoftwareTokenMFANotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1SoftwareTokenMFANotFoundException ( body , context ) ; const contents = { name : "SoftwareTokenMFANotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1TooManyFailedAttemptsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyFailedAttemptsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1TooManyFailedAttemptsException ( body , context ) ; const contents = { name : "TooManyFailedAttemptsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1TooManyRequestsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyRequestsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1TooManyRequestsException ( body , context ) ; const contents = { name : "TooManyRequestsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnauthorizedExceptionResponse = async ( parsedOutput , context ) : Promise < UnauthorizedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnauthorizedException ( body , context ) ; const contents = { name : "UnauthorizedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnexpectedLambdaExceptionResponse = async ( parsedOutput , context ) : Promise < UnexpectedLambdaException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnexpectedLambdaException ( body , context ) ; const contents = { name : "UnexpectedLambdaException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedIdentityProviderExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedIdentityProviderException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedIdentityProviderException ( body , context ) ; const contents = { name : "UnsupportedIdentityProviderException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedOperationExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedOperationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedOperationException ( body , context ) ; const contents = { name : "UnsupportedOperationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedTokenTypeExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedTokenTypeException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedTokenTypeException ( body , context ) ; const contents = { name : "UnsupportedTokenTypeException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedUserStateExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedUserStateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedUserStateException ( body , context ) ; const contents = { name : "UnsupportedUserStateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UserImportInProgressExceptionResponse = async ( parsedOutput , context ) : Promise < UserImportInProgressException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UserImportInProgressException ( body , context ) ; const contents = { name : "UserImportInProgressException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UserLambdaValidationExceptionResponse = async ( parsedOutput , context ) : Promise < UserLambdaValidationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UserLambdaValidationException ( body , context ) ; const contents = { name : "UserLambdaValidationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UsernameExistsExceptionResponse = async ( parsedOutput , context ) : Promise < UsernameExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UsernameExistsException ( body , context ) ; const contents = { name : "UsernameExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UserNotConfirmedExceptionResponse = async ( parsedOutput , context ) : Promise < UserNotConfirmedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UserNotConfirmedException ( body , context ) ; const contents = { name : "UserNotConfirmedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UserNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < UserNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UserNotFoundException ( body , context ) ; const contents = { name : "UserNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UserPoolAddOnNotEnabledExceptionResponse = async ( parsedOutput , context ) : Promise < UserPoolAddOnNotEnabledException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UserPoolAddOnNotEnabledException ( body , context ) ; const contents = { name : "UserPoolAddOnNotEnabledException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UserPoolTaggingExceptionResponse = async ( parsedOutput , context ) : Promise < UserPoolTaggingException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UserPoolTaggingException ( body , context ) ; const contents = { name : "UserPoolTaggingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AccountRecoverySettingType = ( input , context ) : any => { return { ... ( input . RecoveryMechanisms !== undefined && input . RecoveryMechanisms !== null && { RecoveryMechanisms : serializeAws_json1_1RecoveryMechanismsType ( input . RecoveryMechanisms , context ) , } ) , } ; } ; const serializeAws_json1_1AccountTakeoverActionsType = ( input , context ) : any => { return { ... ( input . HighAction !== undefined && input . HighAction !== null && { HighAction : serializeAws_json1_1AccountTakeoverActionType ( input . HighAction , context ) , } ) , ... ( input . LowAction !== undefined && input . LowAction !== null && { LowAction : serializeAws_json1_1AccountTakeoverActionType ( input . LowAction , context ) , } ) , ... ( input . MediumAction !== undefined && input . MediumAction !== null && { MediumAction : serializeAws_json1_1AccountTakeoverActionType ( input . MediumAction , context ) , } ) , } ; } ; const serializeAws_json1_1AccountTakeoverActionType = ( input , context ) : any => { return { ... ( input . EventAction !== undefined && input . EventAction !== null && { EventAction : input . EventAction } ) , ... ( input . Notify !== undefined && input . Notify !== null && { Notify : input . Notify } ) , } ; } ; const serializeAws_json1_1AccountTakeoverRiskConfigurationType = ( input , context ) : any => { return { ... ( input . Actions !== undefined && input . Actions !== null && { Actions : serializeAws_json1_1AccountTakeoverActionsType ( input . Actions , context ) } ) , ... ( input . NotifyConfiguration !== undefined && input . NotifyConfiguration !== null && { NotifyConfiguration : serializeAws_json1_1NotifyConfigurationType ( input . NotifyConfiguration , context ) , } ) , } ; } ; const serializeAws_json1_1AddCustomAttributesRequest = ( input , context ) : any => { return { ... ( input . CustomAttributes !== undefined && input . CustomAttributes !== null && { CustomAttributes : serializeAws_json1_1CustomAttributesListType ( input . CustomAttributes , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1AdminAddUserToGroupRequest = ( input , context ) : any => { return { ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminConfirmSignUpRequest = ( input , context ) : any => { return { ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminCreateUserConfigType = ( input , context ) : any => { return { ... ( input . AllowAdminCreateUserOnly !== undefined && input . AllowAdminCreateUserOnly !== null && { AllowAdminCreateUserOnly : input . AllowAdminCreateUserOnly } ) , ... ( input . InviteMessageTemplate !== undefined && input . InviteMessageTemplate !== null && { InviteMessageTemplate : serializeAws_json1_1MessageTemplateType ( input . InviteMessageTemplate , context ) , } ) , ... ( input . UnusedAccountValidityDays !== undefined && input . UnusedAccountValidityDays !== null && { UnusedAccountValidityDays : input . UnusedAccountValidityDays } ) , } ; } ; const serializeAws_json1_1AdminCreateUserRequest = ( input , context ) : any => { return { ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . DesiredDeliveryMediums !== undefined && input . DesiredDeliveryMediums !== null && { DesiredDeliveryMediums : serializeAws_json1_1DeliveryMediumListType ( input . DesiredDeliveryMediums , context ) , } ) , ... ( input . ForceAliasCreation !== undefined && input . ForceAliasCreation !== null && { ForceAliasCreation : input . ForceAliasCreation } ) , ... ( input . MessageAction !== undefined && input . MessageAction !== null && { MessageAction : input . MessageAction } ) , ... ( input . TemporaryPassword !== undefined && input . TemporaryPassword !== null && { TemporaryPassword : input . TemporaryPassword } ) , ... ( input . UserAttributes !== undefined && input . UserAttributes !== null && { UserAttributes : serializeAws_json1_1AttributeListType ( input . UserAttributes , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , ... ( input . ValidationData !== undefined && input . ValidationData !== null && { ValidationData : serializeAws_json1_1AttributeListType ( input . ValidationData , context ) , } ) , } ; } ; const serializeAws_json1_1AdminDeleteUserAttributesRequest = ( input , context ) : any => { return { ... ( input . UserAttributeNames !== undefined && input . UserAttributeNames !== null && { UserAttributeNames : serializeAws_json1_1AttributeNameListType ( input . UserAttributeNames , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminDeleteUserRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminDisableProviderForUserRequest = ( input , context ) : any => { return { ... ( input . User !== undefined && input . User !== null && { User : serializeAws_json1_1ProviderUserIdentifierType ( input . User , context ) } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1AdminDisableUserRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminEnableUserRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminForgetDeviceRequest = ( input , context ) : any => { return { ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminGetDeviceRequest = ( input , context ) : any => { return { ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminGetUserRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminInitiateAuthRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . AuthFlow !== undefined && input . AuthFlow !== null && { AuthFlow : input . AuthFlow } ) , ... ( input . AuthParameters !== undefined && input . AuthParameters !== null && { AuthParameters : serializeAws_json1_1AuthParametersType ( input . AuthParameters , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . ContextData !== undefined && input . ContextData !== null && { ContextData : serializeAws_json1_1ContextDataType ( input . ContextData , context ) } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1AdminLinkProviderForUserRequest = ( input , context ) : any => { return { ... ( input . DestinationUser !== undefined && input . DestinationUser !== null && { DestinationUser : serializeAws_json1_1ProviderUserIdentifierType ( input . DestinationUser , context ) , } ) , ... ( input . SourceUser !== undefined && input . SourceUser !== null && { SourceUser : serializeAws_json1_1ProviderUserIdentifierType ( input . SourceUser , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1AdminListDevicesRequest = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . PaginationToken !== undefined && input . PaginationToken !== null && { PaginationToken : input . PaginationToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminListGroupsForUserRequest = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminListUserAuthEventsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminRemoveUserFromGroupRequest = ( input , context ) : any => { return { ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminResetUserPasswordRequest = ( input , context ) : any => { return { ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminRespondToAuthChallengeRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ChallengeName !== undefined && input . ChallengeName !== null && { ChallengeName : input . ChallengeName } ) , ... ( input . ChallengeResponses !== undefined && input . ChallengeResponses !== null && { ChallengeResponses : serializeAws_json1_1ChallengeResponsesType ( input . ChallengeResponses , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . ContextData !== undefined && input . ContextData !== null && { ContextData : serializeAws_json1_1ContextDataType ( input . ContextData , context ) } ) , ... ( input . Session !== undefined && input . Session !== null && { Session : input . Session } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1AdminSetUserMFAPreferenceRequest = ( input , context ) : any => { return { ... ( input . SMSMfaSettings !== undefined && input . SMSMfaSettings !== null && { SMSMfaSettings : serializeAws_json1_1SMSMfaSettingsType ( input . SMSMfaSettings , context ) , } ) , ... ( input . SoftwareTokenMfaSettings !== undefined && input . SoftwareTokenMfaSettings !== null && { SoftwareTokenMfaSettings : serializeAws_json1_1SoftwareTokenMfaSettingsType ( input . SoftwareTokenMfaSettings , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminSetUserPasswordRequest = ( input , context ) : any => { return { ... ( input . Password !== undefined && input . Password !== null && { Password : input . Password } ) , ... ( input . Permanent !== undefined && input . Permanent !== null && { Permanent : input . Permanent } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminSetUserSettingsRequest = ( input , context ) : any => { return { ... ( input . MFAOptions !== undefined && input . MFAOptions !== null && { MFAOptions : serializeAws_json1_1MFAOptionListType ( input . MFAOptions , context ) } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminUpdateAuthEventFeedbackRequest = ( input , context ) : any => { return { ... ( input . EventId !== undefined && input . EventId !== null && { EventId : input . EventId } ) , ... ( input . FeedbackValue !== undefined && input . FeedbackValue !== null && { FeedbackValue : input . FeedbackValue } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminUpdateDeviceStatusRequest = ( input , context ) : any => { return { ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , ... ( input . DeviceRememberedStatus !== undefined && input . DeviceRememberedStatus !== null && { DeviceRememberedStatus : input . DeviceRememberedStatus } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminUpdateUserAttributesRequest = ( input , context ) : any => { return { ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . UserAttributes !== undefined && input . UserAttributes !== null && { UserAttributes : serializeAws_json1_1AttributeListType ( input . UserAttributes , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AdminUserGlobalSignOutRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1AliasAttributesListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1AnalyticsConfigurationType = ( input , context ) : any => { return { ... ( input . ApplicationArn !== undefined && input . ApplicationArn !== null && { ApplicationArn : input . ApplicationArn } ) , ... ( input . ApplicationId !== undefined && input . ApplicationId !== null && { ApplicationId : input . ApplicationId } ) , ... ( input . ExternalId !== undefined && input . ExternalId !== null && { ExternalId : input . ExternalId } ) , ... ( input . RoleArn !== undefined && input . RoleArn !== null && { RoleArn : input . RoleArn } ) , ... ( input . UserDataShared !== undefined && input . UserDataShared !== null && { UserDataShared : input . UserDataShared } ) , } ; } ; const serializeAws_json1_1AnalyticsMetadataType = ( input , context ) : any => { return { ... ( input . AnalyticsEndpointId !== undefined && input . AnalyticsEndpointId !== null && { AnalyticsEndpointId : input . AnalyticsEndpointId } ) , } ; } ; const serializeAws_json1_1AssociateSoftwareTokenRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . Session !== undefined && input . Session !== null && { Session : input . Session } ) , } ; } ; const serializeAws_json1_1AttributeListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1AttributeType ( entry , context ) ; } ) ; } ; const serializeAws_json1_1AttributeMappingType = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1AttributeNameListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1AttributeType = ( 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_1AuthParametersType = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1BlockedIPRangeListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1CallbackURLsListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ChallengeResponsesType = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1ChangePasswordRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . PreviousPassword !== undefined && input . PreviousPassword !== null && { PreviousPassword : input . PreviousPassword } ) , ... ( input . ProposedPassword !== undefined && input . ProposedPassword !== null && { ProposedPassword : input . ProposedPassword } ) , } ; } ; const serializeAws_json1_1ClientMetadataType = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1ClientPermissionListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1CompromisedCredentialsActionsType = ( input , context ) : any => { return { ... ( input . EventAction !== undefined && input . EventAction !== null && { EventAction : input . EventAction } ) , } ; } ; const serializeAws_json1_1CompromisedCredentialsRiskConfigurationType = ( input , context ) : any => { return { ... ( input . Actions !== undefined && input . Actions !== null && { Actions : serializeAws_json1_1CompromisedCredentialsActionsType ( input . Actions , context ) , } ) , ... ( input . EventFilter !== undefined && input . EventFilter !== null && { EventFilter : serializeAws_json1_1EventFiltersType ( input . EventFilter , context ) } ) , } ; } ; const serializeAws_json1_1ConfirmDeviceRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , ... ( input . DeviceName !== undefined && input . DeviceName !== null && { DeviceName : input . DeviceName } ) , ... ( input . DeviceSecretVerifierConfig !== undefined && input . DeviceSecretVerifierConfig !== null && { DeviceSecretVerifierConfig : serializeAws_json1_1DeviceSecretVerifierConfigType ( input . DeviceSecretVerifierConfig , context ) , } ) , } ; } ; const serializeAws_json1_1ConfirmForgotPasswordRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . ConfirmationCode !== undefined && input . ConfirmationCode !== null && { ConfirmationCode : input . ConfirmationCode } ) , ... ( input . Password !== undefined && input . Password !== null && { Password : input . Password } ) , ... ( input . SecretHash !== undefined && input . SecretHash !== null && { SecretHash : input . SecretHash } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1ConfirmSignUpRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . ConfirmationCode !== undefined && input . ConfirmationCode !== null && { ConfirmationCode : input . ConfirmationCode } ) , ... ( input . ForceAliasCreation !== undefined && input . ForceAliasCreation !== null && { ForceAliasCreation : input . ForceAliasCreation } ) , ... ( input . SecretHash !== undefined && input . SecretHash !== null && { SecretHash : input . SecretHash } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1ContextDataType = ( input , context ) : any => { return { ... ( input . EncodedData !== undefined && input . EncodedData !== null && { EncodedData : input . EncodedData } ) , ... ( input . HttpHeaders !== undefined && input . HttpHeaders !== null && { HttpHeaders : serializeAws_json1_1HttpHeaderList ( input . HttpHeaders , context ) } ) , ... ( input . IpAddress !== undefined && input . IpAddress !== null && { IpAddress : input . IpAddress } ) , ... ( input . ServerName !== undefined && input . ServerName !== null && { ServerName : input . ServerName } ) , ... ( input . ServerPath !== undefined && input . ServerPath !== null && { ServerPath : input . ServerPath } ) , } ; } ; const serializeAws_json1_1CreateGroupRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . Precedence !== undefined && input . Precedence !== null && { Precedence : input . Precedence } ) , ... ( input . RoleArn !== undefined && input . RoleArn !== null && { RoleArn : input . RoleArn } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1CreateIdentityProviderRequest = ( input , context ) : any => { return { ... ( input . AttributeMapping !== undefined && input . AttributeMapping !== null && { AttributeMapping : serializeAws_json1_1AttributeMappingType ( input . AttributeMapping , context ) , } ) , ... ( input . IdpIdentifiers !== undefined && input . IdpIdentifiers !== null && { IdpIdentifiers : serializeAws_json1_1IdpIdentifiersListType ( input . IdpIdentifiers , context ) , } ) , ... ( input . ProviderDetails !== undefined && input . ProviderDetails !== null && { ProviderDetails : serializeAws_json1_1ProviderDetailsType ( input . ProviderDetails , context ) , } ) , ... ( input . ProviderName !== undefined && input . ProviderName !== null && { ProviderName : input . ProviderName } ) , ... ( input . ProviderType !== undefined && input . ProviderType !== null && { ProviderType : input . ProviderType } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1CreateResourceServerRequest = ( input , context ) : any => { return { ... ( input . Identifier !== undefined && input . Identifier !== null && { Identifier : input . Identifier } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Scopes !== undefined && input . Scopes !== null && { Scopes : serializeAws_json1_1ResourceServerScopeListType ( input . Scopes , context ) } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1CreateUserImportJobRequest = ( input , context ) : any => { return { ... ( input . CloudWatchLogsRoleArn !== undefined && input . CloudWatchLogsRoleArn !== null && { CloudWatchLogsRoleArn : input . CloudWatchLogsRoleArn } ) , ... ( input . JobName !== undefined && input . JobName !== null && { JobName : input . JobName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1CreateUserPoolClientRequest = ( input , context ) : any => { return { ... ( input . AccessTokenValidity !== undefined && input . AccessTokenValidity !== null && { AccessTokenValidity : input . AccessTokenValidity } ) , ... ( input . AllowedOAuthFlows !== undefined && input . AllowedOAuthFlows !== null && { AllowedOAuthFlows : serializeAws_json1_1OAuthFlowsType ( input . AllowedOAuthFlows , context ) , } ) , ... ( input . AllowedOAuthFlowsUserPoolClient !== undefined && input . AllowedOAuthFlowsUserPoolClient !== null && { AllowedOAuthFlowsUserPoolClient : input . AllowedOAuthFlowsUserPoolClient , } ) , ... ( input . AllowedOAuthScopes !== undefined && input . AllowedOAuthScopes !== null && { AllowedOAuthScopes : serializeAws_json1_1ScopeListType ( input . AllowedOAuthScopes , context ) , } ) , ... ( input . AnalyticsConfiguration !== undefined && input . AnalyticsConfiguration !== null && { AnalyticsConfiguration : serializeAws_json1_1AnalyticsConfigurationType ( input . AnalyticsConfiguration , context ) , } ) , ... ( input . CallbackURLs !== undefined && input . CallbackURLs !== null && { CallbackURLs : serializeAws_json1_1CallbackURLsListType ( input . CallbackURLs , context ) , } ) , ... ( input . ClientName !== undefined && input . ClientName !== null && { ClientName : input . ClientName } ) , ... ( input . DefaultRedirectURI !== undefined && input . DefaultRedirectURI !== null && { DefaultRedirectURI : input . DefaultRedirectURI } ) , ... ( input . EnableTokenRevocation !== undefined && input . EnableTokenRevocation !== null && { EnableTokenRevocation : input . EnableTokenRevocation } ) , ... ( input . ExplicitAuthFlows !== undefined && input . ExplicitAuthFlows !== null && { ExplicitAuthFlows : serializeAws_json1_1ExplicitAuthFlowsListType ( input . ExplicitAuthFlows , context ) , } ) , ... ( input . GenerateSecret !== undefined && input . GenerateSecret !== null && { GenerateSecret : input . GenerateSecret } ) , ... ( input . IdTokenValidity !== undefined && input . IdTokenValidity !== null && { IdTokenValidity : input . IdTokenValidity } ) , ... ( input . LogoutURLs !== undefined && input . LogoutURLs !== null && { LogoutURLs : serializeAws_json1_1LogoutURLsListType ( input . LogoutURLs , context ) } ) , ... ( input . PreventUserExistenceErrors !== undefined && input . PreventUserExistenceErrors !== null && { PreventUserExistenceErrors : input . PreventUserExistenceErrors } ) , ... ( input . ReadAttributes !== undefined && input . ReadAttributes !== null && { ReadAttributes : serializeAws_json1_1ClientPermissionListType ( input . ReadAttributes , context ) , } ) , ... ( input . RefreshTokenValidity !== undefined && input . RefreshTokenValidity !== null && { RefreshTokenValidity : input . RefreshTokenValidity } ) , ... ( input . SupportedIdentityProviders !== undefined && input . SupportedIdentityProviders !== null && { SupportedIdentityProviders : serializeAws_json1_1SupportedIdentityProvidersListType ( input . SupportedIdentityProviders , context ) , } ) , ... ( input . TokenValidityUnits !== undefined && input . TokenValidityUnits !== null && { TokenValidityUnits : serializeAws_json1_1TokenValidityUnitsType ( input . TokenValidityUnits , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . WriteAttributes !== undefined && input . WriteAttributes !== null && { WriteAttributes : serializeAws_json1_1ClientPermissionListType ( input . WriteAttributes , context ) , } ) , } ; } ; const serializeAws_json1_1CreateUserPoolDomainRequest = ( input , context ) : any => { return { ... ( input . CustomDomainConfig !== undefined && input . CustomDomainConfig !== null && { CustomDomainConfig : serializeAws_json1_1CustomDomainConfigType ( input . CustomDomainConfig , context ) , } ) , ... ( input . Domain !== undefined && input . Domain !== null && { Domain : input . Domain } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1CreateUserPoolRequest = ( input , context ) : any => { return { ... ( input . AccountRecoverySetting !== undefined && input . AccountRecoverySetting !== null && { AccountRecoverySetting : serializeAws_json1_1AccountRecoverySettingType ( input . AccountRecoverySetting , context ) , } ) , ... ( input . AdminCreateUserConfig !== undefined && input . AdminCreateUserConfig !== null && { AdminCreateUserConfig : serializeAws_json1_1AdminCreateUserConfigType ( input . AdminCreateUserConfig , context ) , } ) , ... ( input . AliasAttributes !== undefined && input . AliasAttributes !== null && { AliasAttributes : serializeAws_json1_1AliasAttributesListType ( input . AliasAttributes , context ) , } ) , ... ( input . AutoVerifiedAttributes !== undefined && input . AutoVerifiedAttributes !== null && { AutoVerifiedAttributes : serializeAws_json1_1VerifiedAttributesListType ( input . AutoVerifiedAttributes , context ) , } ) , ... ( input . DeviceConfiguration !== undefined && input . DeviceConfiguration !== null && { DeviceConfiguration : serializeAws_json1_1DeviceConfigurationType ( input . DeviceConfiguration , context ) , } ) , ... ( input . EmailConfiguration !== undefined && input . EmailConfiguration !== null && { EmailConfiguration : serializeAws_json1_1EmailConfigurationType ( input . EmailConfiguration , context ) , } ) , ... ( input . EmailVerificationMessage !== undefined && input . EmailVerificationMessage !== null && { EmailVerificationMessage : input . EmailVerificationMessage } ) , ... ( input . EmailVerificationSubject !== undefined && input . EmailVerificationSubject !== null && { EmailVerificationSubject : input . EmailVerificationSubject } ) , ... ( input . LambdaConfig !== undefined && input . LambdaConfig !== null && { LambdaConfig : serializeAws_json1_1LambdaConfigType ( input . LambdaConfig , context ) , } ) , ... ( input . MfaConfiguration !== undefined && input . MfaConfiguration !== null && { MfaConfiguration : input . MfaConfiguration } ) , ... ( input . Policies !== undefined && input . Policies !== null && { Policies : serializeAws_json1_1UserPoolPolicyType ( input . Policies , context ) } ) , ... ( input . PoolName !== undefined && input . PoolName !== null && { PoolName : input . PoolName } ) , ... ( input . Schema !== undefined && input . Schema !== null && { Schema : serializeAws_json1_1SchemaAttributesListType ( input . Schema , context ) } ) , ... ( input . SmsAuthenticationMessage !== undefined && input . SmsAuthenticationMessage !== null && { SmsAuthenticationMessage : input . SmsAuthenticationMessage } ) , ... ( input . SmsConfiguration !== undefined && input . SmsConfiguration !== null && { SmsConfiguration : serializeAws_json1_1SmsConfigurationType ( input . SmsConfiguration , context ) , } ) , ... ( input . SmsVerificationMessage !== undefined && input . SmsVerificationMessage !== null && { SmsVerificationMessage : input . SmsVerificationMessage } ) , ... ( input . UserPoolAddOns !== undefined && input . UserPoolAddOns !== null && { UserPoolAddOns : serializeAws_json1_1UserPoolAddOnsType ( input . UserPoolAddOns , context ) , } ) , ... ( input . UserPoolTags !== undefined && input . UserPoolTags !== null && { UserPoolTags : serializeAws_json1_1UserPoolTagsType ( input . UserPoolTags , context ) , } ) , ... ( input . UsernameAttributes !== undefined && input . UsernameAttributes !== null && { UsernameAttributes : serializeAws_json1_1UsernameAttributesListType ( input . UsernameAttributes , context ) , } ) , ... ( input . UsernameConfiguration !== undefined && input . UsernameConfiguration !== null && { UsernameConfiguration : serializeAws_json1_1UsernameConfigurationType ( input . UsernameConfiguration , context ) , } ) , ... ( input . VerificationMessageTemplate !== undefined && input . VerificationMessageTemplate !== null && { VerificationMessageTemplate : serializeAws_json1_1VerificationMessageTemplateType ( input . VerificationMessageTemplate , context ) , } ) , } ; } ; const serializeAws_json1_1CustomAttributesListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1SchemaAttributeType ( entry , context ) ; } ) ; } ; const serializeAws_json1_1CustomDomainConfigType = ( input , context ) : any => { return { ... ( input . CertificateArn !== undefined && input . CertificateArn !== null && { CertificateArn : input . CertificateArn } ) , } ; } ; const serializeAws_json1_1CustomEmailLambdaVersionConfigType = ( input , context ) : any => { return { ... ( input . LambdaArn !== undefined && input . LambdaArn !== null && { LambdaArn : input . LambdaArn } ) , ... ( input . LambdaVersion !== undefined && input . LambdaVersion !== null && { LambdaVersion : input . LambdaVersion } ) , } ; } ; const serializeAws_json1_1CustomSMSLambdaVersionConfigType = ( input , context ) : any => { return { ... ( input . LambdaArn !== undefined && input . LambdaArn !== null && { LambdaArn : input . LambdaArn } ) , ... ( input . LambdaVersion !== undefined && input . LambdaVersion !== null && { LambdaVersion : input . LambdaVersion } ) , } ; } ; const serializeAws_json1_1DeleteGroupRequest = ( input , context ) : any => { return { ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeleteIdentityProviderRequest = ( input , context ) : any => { return { ... ( input . ProviderName !== undefined && input . ProviderName !== null && { ProviderName : input . ProviderName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeleteResourceServerRequest = ( input , context ) : any => { return { ... ( input . Identifier !== undefined && input . Identifier !== null && { Identifier : input . Identifier } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeleteUserAttributesRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . UserAttributeNames !== undefined && input . UserAttributeNames !== null && { UserAttributeNames : serializeAws_json1_1AttributeNameListType ( input . UserAttributeNames , context ) , } ) , } ; } ; const serializeAws_json1_1DeleteUserPoolClientRequest = ( input , context ) : any => { return { ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeleteUserPoolDomainRequest = ( input , context ) : any => { return { ... ( input . Domain !== undefined && input . Domain !== null && { Domain : input . Domain } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeleteUserPoolRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeleteUserRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , } ; } ; const serializeAws_json1_1DeliveryMediumListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1DescribeIdentityProviderRequest = ( input , context ) : any => { return { ... ( input . ProviderName !== undefined && input . ProviderName !== null && { ProviderName : input . ProviderName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DescribeResourceServerRequest = ( input , context ) : any => { return { ... ( input . Identifier !== undefined && input . Identifier !== null && { Identifier : input . Identifier } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DescribeRiskConfigurationRequest = ( input , context ) : any => { return { ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DescribeUserImportJobRequest = ( input , context ) : any => { return { ... ( input . JobId !== undefined && input . JobId !== null && { JobId : input . JobId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DescribeUserPoolClientRequest = ( input , context ) : any => { return { ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DescribeUserPoolDomainRequest = ( input , context ) : any => { return { ... ( input . Domain !== undefined && input . Domain !== null && { Domain : input . Domain } ) , } ; } ; const serializeAws_json1_1DescribeUserPoolRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1DeviceConfigurationType = ( input , context ) : any => { return { ... ( input . ChallengeRequiredOnNewDevice !== undefined && input . ChallengeRequiredOnNewDevice !== null && { ChallengeRequiredOnNewDevice : input . ChallengeRequiredOnNewDevice , } ) , ... ( input . DeviceOnlyRememberedOnUserPrompt !== undefined && input . DeviceOnlyRememberedOnUserPrompt !== null && { DeviceOnlyRememberedOnUserPrompt : input . DeviceOnlyRememberedOnUserPrompt , } ) , } ; } ; const serializeAws_json1_1DeviceSecretVerifierConfigType = ( input , context ) : any => { return { ... ( input . PasswordVerifier !== undefined && input . PasswordVerifier !== null && { PasswordVerifier : input . PasswordVerifier } ) , ... ( input . Salt !== undefined && input . Salt !== null && { Salt : input . Salt } ) , } ; } ; const serializeAws_json1_1EmailConfigurationType = ( input , context ) : any => { return { ... ( input . ConfigurationSet !== undefined && input . ConfigurationSet !== null && { ConfigurationSet : input . ConfigurationSet } ) , ... ( input . EmailSendingAccount !== undefined && input . EmailSendingAccount !== null && { EmailSendingAccount : input . EmailSendingAccount } ) , ... ( input . From !== undefined && input . From !== null && { From : input . From } ) , ... ( input . ReplyToEmailAddress !== undefined && input . ReplyToEmailAddress !== null && { ReplyToEmailAddress : input . ReplyToEmailAddress } ) , ... ( input . SourceArn !== undefined && input . SourceArn !== null && { SourceArn : input . SourceArn } ) , } ; } ; const serializeAws_json1_1EventFiltersType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ExplicitAuthFlowsListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ForgetDeviceRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , } ; } ; const serializeAws_json1_1ForgotPasswordRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . SecretHash !== undefined && input . SecretHash !== null && { SecretHash : input . SecretHash } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1GetCSVHeaderRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1GetDeviceRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , } ; } ; const serializeAws_json1_1GetGroupRequest = ( input , context ) : any => { return { ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1GetIdentityProviderByIdentifierRequest = ( input , context ) : any => { return { ... ( input . IdpIdentifier !== undefined && input . IdpIdentifier !== null && { IdpIdentifier : input . IdpIdentifier } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1GetSigningCertificateRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1GetUICustomizationRequest = ( input , context ) : any => { return { ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1GetUserAttributeVerificationCodeRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . AttributeName !== undefined && input . AttributeName !== null && { AttributeName : input . AttributeName } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , } ; } ; const serializeAws_json1_1GetUserPoolMfaConfigRequest = ( input , context ) : any => { return { ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1GetUserRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , } ; } ; const serializeAws_json1_1GlobalSignOutRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , } ; } ; const serializeAws_json1_1HttpHeader = ( input , context ) : any => { return { ... ( input . headerName !== undefined && input . headerName !== null && { headerName : input . headerName } ) , ... ( input . headerValue !== undefined && input . headerValue !== null && { headerValue : input . headerValue } ) , } ; } ; const serializeAws_json1_1HttpHeaderList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1HttpHeader ( entry , context ) ; } ) ; } ; const serializeAws_json1_1IdpIdentifiersListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1InitiateAuthRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . AuthFlow !== undefined && input . AuthFlow !== null && { AuthFlow : input . AuthFlow } ) , ... ( input . AuthParameters !== undefined && input . AuthParameters !== null && { AuthParameters : serializeAws_json1_1AuthParametersType ( input . AuthParameters , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , } ; } ; const serializeAws_json1_1LambdaConfigType = ( input , context ) : any => { return { ... ( input . CreateAuthChallenge !== undefined && input . CreateAuthChallenge !== null && { CreateAuthChallenge : input . CreateAuthChallenge } ) , ... ( input . CustomEmailSender !== undefined && input . CustomEmailSender !== null && { CustomEmailSender : serializeAws_json1_1CustomEmailLambdaVersionConfigType ( input . CustomEmailSender , context ) , } ) , ... ( input . CustomMessage !== undefined && input . CustomMessage !== null && { CustomMessage : input . CustomMessage } ) , ... ( input . CustomSMSSender !== undefined && input . CustomSMSSender !== null && { CustomSMSSender : serializeAws_json1_1CustomSMSLambdaVersionConfigType ( input . CustomSMSSender , context ) , } ) , ... ( input . DefineAuthChallenge !== undefined && input . DefineAuthChallenge !== null && { DefineAuthChallenge : input . DefineAuthChallenge } ) , ... ( input . KMSKeyID !== undefined && input . KMSKeyID !== null && { KMSKeyID : input . KMSKeyID } ) , ... ( input . PostAuthentication !== undefined && input . PostAuthentication !== null && { PostAuthentication : input . PostAuthentication } ) , ... ( input . PostConfirmation !== undefined && input . PostConfirmation !== null && { PostConfirmation : input . PostConfirmation } ) , ... ( input . PreAuthentication !== undefined && input . PreAuthentication !== null && { PreAuthentication : input . PreAuthentication } ) , ... ( input . PreSignUp !== undefined && input . PreSignUp !== null && { PreSignUp : input . PreSignUp } ) , ... ( input . PreTokenGeneration !== undefined && input . PreTokenGeneration !== null && { PreTokenGeneration : input . PreTokenGeneration } ) , ... ( input . UserMigration !== undefined && input . UserMigration !== null && { UserMigration : input . UserMigration } ) , ... ( input . VerifyAuthChallengeResponse !== undefined && input . VerifyAuthChallengeResponse !== null && { VerifyAuthChallengeResponse : input . VerifyAuthChallengeResponse } ) , } ; } ; const serializeAws_json1_1ListDevicesRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . PaginationToken !== undefined && input . PaginationToken !== null && { PaginationToken : input . PaginationToken } ) , } ; } ; const serializeAws_json1_1ListGroupsRequest = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1ListIdentityProvidersRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1ListResourceServersRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_1ListUserImportJobsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . PaginationToken !== undefined && input . PaginationToken !== null && { PaginationToken : input . PaginationToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1ListUserPoolClientsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1ListUserPoolsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListUsersInGroupRequest = ( input , context ) : any => { return { ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1ListUsersRequest = ( input , context ) : any => { return { ... ( input . AttributesToGet !== undefined && input . AttributesToGet !== null && { AttributesToGet : serializeAws_json1_1SearchedAttributeNamesListType ( input . AttributesToGet , context ) , } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : input . Filter } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . PaginationToken !== undefined && input . PaginationToken !== null && { PaginationToken : input . PaginationToken } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1LogoutURLsListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MessageTemplateType = ( input , context ) : any => { return { ... ( input . EmailMessage !== undefined && input . EmailMessage !== null && { EmailMessage : input . EmailMessage } ) , ... ( input . EmailSubject !== undefined && input . EmailSubject !== null && { EmailSubject : input . EmailSubject } ) , ... ( input . SMSMessage !== undefined && input . SMSMessage !== null && { SMSMessage : input . SMSMessage } ) , } ; } ; const serializeAws_json1_1MFAOptionListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1MFAOptionType ( entry , context ) ; } ) ; } ; const serializeAws_json1_1MFAOptionType = ( input , context ) : any => { return { ... ( input . AttributeName !== undefined && input . AttributeName !== null && { AttributeName : input . AttributeName } ) , ... ( input . DeliveryMedium !== undefined && input . DeliveryMedium !== null && { DeliveryMedium : input . DeliveryMedium } ) , } ; } ; const serializeAws_json1_1NotifyConfigurationType = ( input , context ) : any => { return { ... ( input . BlockEmail !== undefined && input . BlockEmail !== null && { BlockEmail : serializeAws_json1_1NotifyEmailType ( input . BlockEmail , context ) } ) , ... ( input . From !== undefined && input . From !== null && { From : input . From } ) , ... ( input . MfaEmail !== undefined && input . MfaEmail !== null && { MfaEmail : serializeAws_json1_1NotifyEmailType ( input . MfaEmail , context ) } ) , ... ( input . NoActionEmail !== undefined && input . NoActionEmail !== null && { NoActionEmail : serializeAws_json1_1NotifyEmailType ( input . NoActionEmail , context ) , } ) , ... ( input . ReplyTo !== undefined && input . ReplyTo !== null && { ReplyTo : input . ReplyTo } ) , ... ( input . SourceArn !== undefined && input . SourceArn !== null && { SourceArn : input . SourceArn } ) , } ; } ; const serializeAws_json1_1NotifyEmailType = ( input , context ) : any => { return { ... ( input . HtmlBody !== undefined && input . HtmlBody !== null && { HtmlBody : input . HtmlBody } ) , ... ( input . Subject !== undefined && input . Subject !== null && { Subject : input . Subject } ) , ... ( input . TextBody !== undefined && input . TextBody !== null && { TextBody : input . TextBody } ) , } ; } ; const serializeAws_json1_1NumberAttributeConstraintsType = ( input , context ) : any => { return { ... ( input . MaxValue !== undefined && input . MaxValue !== null && { MaxValue : input . MaxValue } ) , ... ( input . MinValue !== undefined && input . MinValue !== null && { MinValue : input . MinValue } ) , } ; } ; const serializeAws_json1_1OAuthFlowsType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1PasswordPolicyType = ( input , context ) : any => { return { ... ( input . MinimumLength !== undefined && input . MinimumLength !== null && { MinimumLength : input . MinimumLength } ) , ... ( input . RequireLowercase !== undefined && input . RequireLowercase !== null && { RequireLowercase : input . RequireLowercase } ) , ... ( input . RequireNumbers !== undefined && input . RequireNumbers !== null && { RequireNumbers : input . RequireNumbers } ) , ... ( input . RequireSymbols !== undefined && input . RequireSymbols !== null && { RequireSymbols : input . RequireSymbols } ) , ... ( input . RequireUppercase !== undefined && input . RequireUppercase !== null && { RequireUppercase : input . RequireUppercase } ) , ... ( input . TemporaryPasswordValidityDays !== undefined && input . TemporaryPasswordValidityDays !== null && { TemporaryPasswordValidityDays : input . TemporaryPasswordValidityDays , } ) , } ; } ; const serializeAws_json1_1ProviderDetailsType = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1ProviderUserIdentifierType = ( input , context ) : any => { return { ... ( input . ProviderAttributeName !== undefined && input . ProviderAttributeName !== null && { ProviderAttributeName : input . ProviderAttributeName } ) , ... ( input . ProviderAttributeValue !== undefined && input . ProviderAttributeValue !== null && { ProviderAttributeValue : input . ProviderAttributeValue } ) , ... ( input . ProviderName !== undefined && input . ProviderName !== null && { ProviderName : input . ProviderName } ) , } ; } ; const serializeAws_json1_1RecoveryMechanismsType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1RecoveryOptionType ( entry , context ) ; } ) ; } ; const serializeAws_json1_1RecoveryOptionType = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Priority !== undefined && input . Priority !== null && { Priority : input . Priority } ) , } ; } ; const serializeAws_json1_1ResendConfirmationCodeRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . SecretHash !== undefined && input . SecretHash !== null && { SecretHash : input . SecretHash } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1ResourceServerScopeListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ResourceServerScopeType ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ResourceServerScopeType = ( input , context ) : any => { return { ... ( input . ScopeDescription !== undefined && input . ScopeDescription !== null && { ScopeDescription : input . ScopeDescription } ) , ... ( input . ScopeName !== undefined && input . ScopeName !== null && { ScopeName : input . ScopeName } ) , } ; } ; const serializeAws_json1_1RespondToAuthChallengeRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ChallengeName !== undefined && input . ChallengeName !== null && { ChallengeName : input . ChallengeName } ) , ... ( input . ChallengeResponses !== undefined && input . ChallengeResponses !== null && { ChallengeResponses : serializeAws_json1_1ChallengeResponsesType ( input . ChallengeResponses , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . Session !== undefined && input . Session !== null && { Session : input . Session } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , } ; } ; const serializeAws_json1_1RevokeTokenRequest = ( input , context ) : any => { return { ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientSecret !== undefined && input . ClientSecret !== null && { ClientSecret : input . ClientSecret } ) , ... ( input . Token !== undefined && input . Token !== null && { Token : input . Token } ) , } ; } ; const serializeAws_json1_1RiskExceptionConfigurationType = ( input , context ) : any => { return { ... ( input . BlockedIPRangeList !== undefined && input . BlockedIPRangeList !== null && { BlockedIPRangeList : serializeAws_json1_1BlockedIPRangeListType ( input . BlockedIPRangeList , context ) , } ) , ... ( input . SkippedIPRangeList !== undefined && input . SkippedIPRangeList !== null && { SkippedIPRangeList : serializeAws_json1_1SkippedIPRangeListType ( input . SkippedIPRangeList , context ) , } ) , } ; } ; const serializeAws_json1_1SchemaAttributesListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1SchemaAttributeType ( entry , context ) ; } ) ; } ; const serializeAws_json1_1SchemaAttributeType = ( input , context ) : any => { return { ... ( input . AttributeDataType !== undefined && input . AttributeDataType !== null && { AttributeDataType : input . AttributeDataType } ) , ... ( input . DeveloperOnlyAttribute !== undefined && input . DeveloperOnlyAttribute !== null && { DeveloperOnlyAttribute : input . DeveloperOnlyAttribute } ) , ... ( input . Mutable !== undefined && input . Mutable !== null && { Mutable : input . Mutable } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NumberAttributeConstraints !== undefined && input . NumberAttributeConstraints !== null && { NumberAttributeConstraints : serializeAws_json1_1NumberAttributeConstraintsType ( input . NumberAttributeConstraints , context ) , } ) , ... ( input . Required !== undefined && input . Required !== null && { Required : input . Required } ) , ... ( input . StringAttributeConstraints !== undefined && input . StringAttributeConstraints !== null && { StringAttributeConstraints : serializeAws_json1_1StringAttributeConstraintsType ( input . StringAttributeConstraints , context ) , } ) , } ; } ; const serializeAws_json1_1ScopeListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1SearchedAttributeNamesListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1SetRiskConfigurationRequest = ( input , context ) : any => { return { ... ( input . AccountTakeoverRiskConfiguration !== undefined && input . AccountTakeoverRiskConfiguration !== null && { AccountTakeoverRiskConfiguration : serializeAws_json1_1AccountTakeoverRiskConfigurationType ( input . AccountTakeoverRiskConfiguration , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . CompromisedCredentialsRiskConfiguration !== undefined && input . CompromisedCredentialsRiskConfiguration !== null && { CompromisedCredentialsRiskConfiguration : serializeAws_json1_1CompromisedCredentialsRiskConfigurationType ( input . CompromisedCredentialsRiskConfiguration , context ) , } ) , ... ( input . RiskExceptionConfiguration !== undefined && input . RiskExceptionConfiguration !== null && { RiskExceptionConfiguration : serializeAws_json1_1RiskExceptionConfigurationType ( input . RiskExceptionConfiguration , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1SetUICustomizationRequest = ( input , context ) : any => { return { ... ( input . CSS !== undefined && input . CSS !== null && { CSS : input . CSS } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ImageFile !== undefined && input . ImageFile !== null && { ImageFile : context . base64Encoder ( input . ImageFile ) } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1SetUserMFAPreferenceRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . SMSMfaSettings !== undefined && input . SMSMfaSettings !== null && { SMSMfaSettings : serializeAws_json1_1SMSMfaSettingsType ( input . SMSMfaSettings , context ) , } ) , ... ( input . SoftwareTokenMfaSettings !== undefined && input . SoftwareTokenMfaSettings !== null && { SoftwareTokenMfaSettings : serializeAws_json1_1SoftwareTokenMfaSettingsType ( input . SoftwareTokenMfaSettings , context ) , } ) , } ; } ; const serializeAws_json1_1SetUserPoolMfaConfigRequest = ( input , context ) : any => { return { ... ( input . MfaConfiguration !== undefined && input . MfaConfiguration !== null && { MfaConfiguration : input . MfaConfiguration } ) , ... ( input . SmsMfaConfiguration !== undefined && input . SmsMfaConfiguration !== null && { SmsMfaConfiguration : serializeAws_json1_1SmsMfaConfigType ( input . SmsMfaConfiguration , context ) , } ) , ... ( input . SoftwareTokenMfaConfiguration !== undefined && input . SoftwareTokenMfaConfiguration !== null && { SoftwareTokenMfaConfiguration : serializeAws_json1_1SoftwareTokenMfaConfigType ( input . SoftwareTokenMfaConfiguration , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1SetUserSettingsRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . MFAOptions !== undefined && input . MFAOptions !== null && { MFAOptions : serializeAws_json1_1MFAOptionListType ( input . MFAOptions , context ) } ) , } ; } ; const serializeAws_json1_1SignUpRequest = ( input , context ) : any => { return { ... ( input . AnalyticsMetadata !== undefined && input . AnalyticsMetadata !== null && { AnalyticsMetadata : serializeAws_json1_1AnalyticsMetadataType ( input . AnalyticsMetadata , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . Password !== undefined && input . Password !== null && { Password : input . Password } ) , ... ( input . SecretHash !== undefined && input . SecretHash !== null && { SecretHash : input . SecretHash } ) , ... ( input . UserAttributes !== undefined && input . UserAttributes !== null && { UserAttributes : serializeAws_json1_1AttributeListType ( input . UserAttributes , context ) , } ) , ... ( input . UserContextData !== undefined && input . UserContextData !== null && { UserContextData : serializeAws_json1_1UserContextDataType ( input . UserContextData , context ) , } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , ... ( input . ValidationData !== undefined && input . ValidationData !== null && { ValidationData : serializeAws_json1_1AttributeListType ( input . ValidationData , context ) , } ) , } ; } ; const serializeAws_json1_1SkippedIPRangeListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1SmsConfigurationType = ( input , context ) : any => { return { ... ( input . ExternalId !== undefined && input . ExternalId !== null && { ExternalId : input . ExternalId } ) , ... ( input . SnsCallerArn !== undefined && input . SnsCallerArn !== null && { SnsCallerArn : input . SnsCallerArn } ) , } ; } ; const serializeAws_json1_1SmsMfaConfigType = ( input , context ) : any => { return { ... ( input . SmsAuthenticationMessage !== undefined && input . SmsAuthenticationMessage !== null && { SmsAuthenticationMessage : input . SmsAuthenticationMessage } ) , ... ( input . SmsConfiguration !== undefined && input . SmsConfiguration !== null && { SmsConfiguration : serializeAws_json1_1SmsConfigurationType ( input . SmsConfiguration , context ) , } ) , } ; } ; const serializeAws_json1_1SMSMfaSettingsType = ( input , context ) : any => { return { ... ( input . Enabled !== undefined && input . Enabled !== null && { Enabled : input . Enabled } ) , ... ( input . PreferredMfa !== undefined && input . PreferredMfa !== null && { PreferredMfa : input . PreferredMfa } ) , } ; } ; const serializeAws_json1_1SoftwareTokenMfaConfigType = ( input , context ) : any => { return { ... ( input . Enabled !== undefined && input . Enabled !== null && { Enabled : input . Enabled } ) , } ; } ; const serializeAws_json1_1SoftwareTokenMfaSettingsType = ( input , context ) : any => { return { ... ( input . Enabled !== undefined && input . Enabled !== null && { Enabled : input . Enabled } ) , ... ( input . PreferredMfa !== undefined && input . PreferredMfa !== null && { PreferredMfa : input . PreferredMfa } ) , } ; } ; const serializeAws_json1_1StartUserImportJobRequest = ( input , context ) : any => { return { ... ( input . JobId !== undefined && input . JobId !== null && { JobId : input . JobId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1StopUserImportJobRequest = ( input , context ) : any => { return { ... ( input . JobId !== undefined && input . JobId !== null && { JobId : input . JobId } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1StringAttributeConstraintsType = ( input , context ) : any => { return { ... ( input . MaxLength !== undefined && input . MaxLength !== null && { MaxLength : input . MaxLength } ) , ... ( input . MinLength !== undefined && input . MinLength !== null && { MinLength : input . MinLength } ) , } ; } ; const serializeAws_json1_1SupportedIdentityProvidersListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1TagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1UserPoolTagsType ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1TokenValidityUnitsType = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . IdToken !== undefined && input . IdToken !== null && { IdToken : input . IdToken } ) , ... ( input . RefreshToken !== undefined && input . RefreshToken !== null && { RefreshToken : input . RefreshToken } ) , } ; } ; const serializeAws_json1_1UntagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . TagKeys !== undefined && input . TagKeys !== null && { TagKeys : serializeAws_json1_1UserPoolTagsListType ( input . TagKeys , context ) } ) , } ; } ; const serializeAws_json1_1UpdateAuthEventFeedbackRequest = ( input , context ) : any => { return { ... ( input . EventId !== undefined && input . EventId !== null && { EventId : input . EventId } ) , ... ( input . FeedbackToken !== undefined && input . FeedbackToken !== null && { FeedbackToken : input . FeedbackToken } ) , ... ( input . FeedbackValue !== undefined && input . FeedbackValue !== null && { FeedbackValue : input . FeedbackValue } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_json1_1UpdateDeviceStatusRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . DeviceKey !== undefined && input . DeviceKey !== null && { DeviceKey : input . DeviceKey } ) , ... ( input . DeviceRememberedStatus !== undefined && input . DeviceRememberedStatus !== null && { DeviceRememberedStatus : input . DeviceRememberedStatus } ) , } ; } ; const serializeAws_json1_1UpdateGroupRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . Precedence !== undefined && input . Precedence !== null && { Precedence : input . Precedence } ) , ... ( input . RoleArn !== undefined && input . RoleArn !== null && { RoleArn : input . RoleArn } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1UpdateIdentityProviderRequest = ( input , context ) : any => { return { ... ( input . AttributeMapping !== undefined && input . AttributeMapping !== null && { AttributeMapping : serializeAws_json1_1AttributeMappingType ( input . AttributeMapping , context ) , } ) , ... ( input . IdpIdentifiers !== undefined && input . IdpIdentifiers !== null && { IdpIdentifiers : serializeAws_json1_1IdpIdentifiersListType ( input . IdpIdentifiers , context ) , } ) , ... ( input . ProviderDetails !== undefined && input . ProviderDetails !== null && { ProviderDetails : serializeAws_json1_1ProviderDetailsType ( input . ProviderDetails , context ) , } ) , ... ( input . ProviderName !== undefined && input . ProviderName !== null && { ProviderName : input . ProviderName } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1UpdateResourceServerRequest = ( input , context ) : any => { return { ... ( input . Identifier !== undefined && input . Identifier !== null && { Identifier : input . Identifier } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Scopes !== undefined && input . Scopes !== null && { Scopes : serializeAws_json1_1ResourceServerScopeListType ( input . Scopes , context ) } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1UpdateUserAttributesRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . ClientMetadata !== undefined && input . ClientMetadata !== null && { ClientMetadata : serializeAws_json1_1ClientMetadataType ( input . ClientMetadata , context ) , } ) , ... ( input . UserAttributes !== undefined && input . UserAttributes !== null && { UserAttributes : serializeAws_json1_1AttributeListType ( input . UserAttributes , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateUserPoolClientRequest = ( input , context ) : any => { return { ... ( input . AccessTokenValidity !== undefined && input . AccessTokenValidity !== null && { AccessTokenValidity : input . AccessTokenValidity } ) , ... ( input . AllowedOAuthFlows !== undefined && input . AllowedOAuthFlows !== null && { AllowedOAuthFlows : serializeAws_json1_1OAuthFlowsType ( input . AllowedOAuthFlows , context ) , } ) , ... ( input . AllowedOAuthFlowsUserPoolClient !== undefined && input . AllowedOAuthFlowsUserPoolClient !== null && { AllowedOAuthFlowsUserPoolClient : input . AllowedOAuthFlowsUserPoolClient , } ) , ... ( input . AllowedOAuthScopes !== undefined && input . AllowedOAuthScopes !== null && { AllowedOAuthScopes : serializeAws_json1_1ScopeListType ( input . AllowedOAuthScopes , context ) , } ) , ... ( input . AnalyticsConfiguration !== undefined && input . AnalyticsConfiguration !== null && { AnalyticsConfiguration : serializeAws_json1_1AnalyticsConfigurationType ( input . AnalyticsConfiguration , context ) , } ) , ... ( input . CallbackURLs !== undefined && input . CallbackURLs !== null && { CallbackURLs : serializeAws_json1_1CallbackURLsListType ( input . CallbackURLs , context ) , } ) , ... ( input . ClientId !== undefined && input . ClientId !== null && { ClientId : input . ClientId } ) , ... ( input . ClientName !== undefined && input . ClientName !== null && { ClientName : input . ClientName } ) , ... ( input . DefaultRedirectURI !== undefined && input . DefaultRedirectURI !== null && { DefaultRedirectURI : input . DefaultRedirectURI } ) , ... ( input . EnableTokenRevocation !== undefined && input . EnableTokenRevocation !== null && { EnableTokenRevocation : input . EnableTokenRevocation } ) , ... ( input . ExplicitAuthFlows !== undefined && input . ExplicitAuthFlows !== null && { ExplicitAuthFlows : serializeAws_json1_1ExplicitAuthFlowsListType ( input . ExplicitAuthFlows , context ) , } ) , ... ( input . IdTokenValidity !== undefined && input . IdTokenValidity !== null && { IdTokenValidity : input . IdTokenValidity } ) , ... ( input . LogoutURLs !== undefined && input . LogoutURLs !== null && { LogoutURLs : serializeAws_json1_1LogoutURLsListType ( input . LogoutURLs , context ) } ) , ... ( input . PreventUserExistenceErrors !== undefined && input . PreventUserExistenceErrors !== null && { PreventUserExistenceErrors : input . PreventUserExistenceErrors } ) , ... ( input . ReadAttributes !== undefined && input . ReadAttributes !== null && { ReadAttributes : serializeAws_json1_1ClientPermissionListType ( input . ReadAttributes , context ) , } ) , ... ( input . RefreshTokenValidity !== undefined && input . RefreshTokenValidity !== null && { RefreshTokenValidity : input . RefreshTokenValidity } ) , ... ( input . SupportedIdentityProviders !== undefined && input . SupportedIdentityProviders !== null && { SupportedIdentityProviders : serializeAws_json1_1SupportedIdentityProvidersListType ( input . SupportedIdentityProviders , context ) , } ) , ... ( input . TokenValidityUnits !== undefined && input . TokenValidityUnits !== null && { TokenValidityUnits : serializeAws_json1_1TokenValidityUnitsType ( input . TokenValidityUnits , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . WriteAttributes !== undefined && input . WriteAttributes !== null && { WriteAttributes : serializeAws_json1_1ClientPermissionListType ( input . WriteAttributes , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateUserPoolDomainRequest = ( input , context ) : any => { return { ... ( input . CustomDomainConfig !== undefined && input . CustomDomainConfig !== null && { CustomDomainConfig : serializeAws_json1_1CustomDomainConfigType ( input . CustomDomainConfig , context ) , } ) , ... ( input . Domain !== undefined && input . Domain !== null && { Domain : input . Domain } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , } ; } ; const serializeAws_json1_1UpdateUserPoolRequest = ( input , context ) : any => { return { ... ( input . AccountRecoverySetting !== undefined && input . AccountRecoverySetting !== null && { AccountRecoverySetting : serializeAws_json1_1AccountRecoverySettingType ( input . AccountRecoverySetting , context ) , } ) , ... ( input . AdminCreateUserConfig !== undefined && input . AdminCreateUserConfig !== null && { AdminCreateUserConfig : serializeAws_json1_1AdminCreateUserConfigType ( input . AdminCreateUserConfig , context ) , } ) , ... ( input . AutoVerifiedAttributes !== undefined && input . AutoVerifiedAttributes !== null && { AutoVerifiedAttributes : serializeAws_json1_1VerifiedAttributesListType ( input . AutoVerifiedAttributes , context ) , } ) , ... ( input . DeviceConfiguration !== undefined && input . DeviceConfiguration !== null && { DeviceConfiguration : serializeAws_json1_1DeviceConfigurationType ( input . DeviceConfiguration , context ) , } ) , ... ( input . EmailConfiguration !== undefined && input . EmailConfiguration !== null && { EmailConfiguration : serializeAws_json1_1EmailConfigurationType ( input . EmailConfiguration , context ) , } ) , ... ( input . EmailVerificationMessage !== undefined && input . EmailVerificationMessage !== null && { EmailVerificationMessage : input . EmailVerificationMessage } ) , ... ( input . EmailVerificationSubject !== undefined && input . EmailVerificationSubject !== null && { EmailVerificationSubject : input . EmailVerificationSubject } ) , ... ( input . LambdaConfig !== undefined && input . LambdaConfig !== null && { LambdaConfig : serializeAws_json1_1LambdaConfigType ( input . LambdaConfig , context ) , } ) , ... ( input . MfaConfiguration !== undefined && input . MfaConfiguration !== null && { MfaConfiguration : input . MfaConfiguration } ) , ... ( input . Policies !== undefined && input . Policies !== null && { Policies : serializeAws_json1_1UserPoolPolicyType ( input . Policies , context ) } ) , ... ( input . SmsAuthenticationMessage !== undefined && input . SmsAuthenticationMessage !== null && { SmsAuthenticationMessage : input . SmsAuthenticationMessage } ) , ... ( input . SmsConfiguration !== undefined && input . SmsConfiguration !== null && { SmsConfiguration : serializeAws_json1_1SmsConfigurationType ( input . SmsConfiguration , context ) , } ) , ... ( input . SmsVerificationMessage !== undefined && input . SmsVerificationMessage !== null && { SmsVerificationMessage : input . SmsVerificationMessage } ) , ... ( input . UserPoolAddOns !== undefined && input . UserPoolAddOns !== null && { UserPoolAddOns : serializeAws_json1_1UserPoolAddOnsType ( input . UserPoolAddOns , context ) , } ) , ... ( input . UserPoolId !== undefined && input . UserPoolId !== null && { UserPoolId : input . UserPoolId } ) , ... ( input . UserPoolTags !== undefined && input . UserPoolTags !== null && { UserPoolTags : serializeAws_json1_1UserPoolTagsType ( input . UserPoolTags , context ) , } ) , ... ( input . VerificationMessageTemplate !== undefined && input . VerificationMessageTemplate !== null && { VerificationMessageTemplate : serializeAws_json1_1VerificationMessageTemplateType ( input . VerificationMessageTemplate , context ) , } ) , } ; } ; const serializeAws_json1_1UserContextDataType = ( input , context ) : any => { return { ... ( input . EncodedData !== undefined && input . EncodedData !== null && { EncodedData : input . EncodedData } ) , } ; } ; const serializeAws_json1_1UsernameAttributesListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1UsernameConfigurationType = ( input , context ) : any => { return { ... ( input . CaseSensitive !== undefined && input . CaseSensitive !== null && { CaseSensitive : input . CaseSensitive } ) , } ; } ; const serializeAws_json1_1UserPoolAddOnsType = ( input , context ) : any => { return { ... ( input . AdvancedSecurityMode !== undefined && input . AdvancedSecurityMode !== null && { AdvancedSecurityMode : input . AdvancedSecurityMode } ) , } ; } ; const serializeAws_json1_1UserPoolPolicyType = ( input , context ) : any => { return { ... ( input . PasswordPolicy !== undefined && input . PasswordPolicy !== null && { PasswordPolicy : serializeAws_json1_1PasswordPolicyType ( input . PasswordPolicy , context ) , } ) , } ; } ; const serializeAws_json1_1UserPoolTagsListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1UserPoolTagsType = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1VerificationMessageTemplateType = ( input , context ) : any => { return { ... ( input . DefaultEmailOption !== undefined && input . DefaultEmailOption !== null && { DefaultEmailOption : input . DefaultEmailOption } ) , ... ( input . EmailMessage !== undefined && input . EmailMessage !== null && { EmailMessage : input . EmailMessage } ) , ... ( input . EmailMessageByLink !== undefined && input . EmailMessageByLink !== null && { EmailMessageByLink : input . EmailMessageByLink } ) , ... ( input . EmailSubject !== undefined && input . EmailSubject !== null && { EmailSubject : input . EmailSubject } ) , ... ( input . EmailSubjectByLink !== undefined && input . EmailSubjectByLink !== null && { EmailSubjectByLink : input . EmailSubjectByLink } ) , ... ( input . SmsMessage !== undefined && input . SmsMessage !== null && { SmsMessage : input . SmsMessage } ) , } ; } ; const serializeAws_json1_1VerifiedAttributesListType = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1VerifySoftwareTokenRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . FriendlyDeviceName !== undefined && input . FriendlyDeviceName !== null && { FriendlyDeviceName : input . FriendlyDeviceName } ) , ... ( input . Session !== undefined && input . Session !== null && { Session : input . Session } ) , ... ( input . UserCode !== undefined && input . UserCode !== null && { UserCode : input . UserCode } ) , } ; } ; const serializeAws_json1_1VerifyUserAttributeRequest = ( input , context ) : any => { return { ... ( input . AccessToken !== undefined && input . AccessToken !== null && { AccessToken : input . AccessToken } ) , ... ( input . AttributeName !== undefined && input . AttributeName !== null && { AttributeName : input . AttributeName } ) , ... ( input . Code !== undefined && input . Code !== null && { Code : input . Code } ) , } ; } ; const deserializeAws_json1_1AccountRecoverySettingType = ( output , context ) : AccountRecoverySettingType => { return { RecoveryMechanisms : output . RecoveryMechanisms !== undefined && output . RecoveryMechanisms !== null ? deserializeAws_json1_1RecoveryMechanismsType ( output . RecoveryMechanisms , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AccountTakeoverActionsType = ( output , context ) : AccountTakeoverActionsType => { return { HighAction : output . HighAction !== undefined && output . HighAction !== null ? deserializeAws_json1_1AccountTakeoverActionType ( output . HighAction , context ) : undefined , LowAction : output . LowAction !== undefined && output . LowAction !== null ? deserializeAws_json1_1AccountTakeoverActionType ( output . LowAction , context ) : undefined , MediumAction : output . MediumAction !== undefined && output . MediumAction !== null ? deserializeAws_json1_1AccountTakeoverActionType ( output . MediumAction , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AccountTakeoverActionType = ( output , context ) : AccountTakeoverActionType => { return { EventAction : __expectString ( output . EventAction ) , Notify : __expectBoolean ( output . Notify ) , } as any ; } ; const deserializeAws_json1_1AccountTakeoverRiskConfigurationType = ( output , context ) : AccountTakeoverRiskConfigurationType => { return { Actions : output . Actions !== undefined && output . Actions !== null ? deserializeAws_json1_1AccountTakeoverActionsType ( output . Actions , context ) : undefined , NotifyConfiguration : output . NotifyConfiguration !== undefined && output . NotifyConfiguration !== null ? deserializeAws_json1_1NotifyConfigurationType ( output . NotifyConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AddCustomAttributesResponse = ( output , context ) : AddCustomAttributesResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminConfirmSignUpResponse = ( output , context ) : AdminConfirmSignUpResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminCreateUserConfigType = ( output , context ) : AdminCreateUserConfigType => { return { AllowAdminCreateUserOnly : __expectBoolean ( output . AllowAdminCreateUserOnly ) , InviteMessageTemplate : output . InviteMessageTemplate !== undefined && output . InviteMessageTemplate !== null ? deserializeAws_json1_1MessageTemplateType ( output . InviteMessageTemplate , context ) : undefined , UnusedAccountValidityDays : __expectInt32 ( output . UnusedAccountValidityDays ) , } as any ; } ; const deserializeAws_json1_1AdminCreateUserResponse = ( output , context ) : AdminCreateUserResponse => { return { User : output . User !== undefined && output . User !== null ? deserializeAws_json1_1UserType ( output . User , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AdminDeleteUserAttributesResponse = ( output , context ) : AdminDeleteUserAttributesResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminDisableProviderForUserResponse = ( output , context ) : AdminDisableProviderForUserResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminDisableUserResponse = ( output , context ) : AdminDisableUserResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminEnableUserResponse = ( output , context ) : AdminEnableUserResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminGetDeviceResponse = ( output , context ) : AdminGetDeviceResponse => { return { Device : output . Device !== undefined && output . Device !== null ? deserializeAws_json1_1DeviceType ( output . Device , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AdminGetUserResponse = ( output , context ) : AdminGetUserResponse => { return { Enabled : __expectBoolean ( output . Enabled ) , MFAOptions : output . MFAOptions !== undefined && output . MFAOptions !== null ? deserializeAws_json1_1MFAOptionListType ( output . MFAOptions , context ) : undefined , PreferredMfaSetting : __expectString ( output . PreferredMfaSetting ) , UserAttributes : output . UserAttributes !== undefined && output . UserAttributes !== null ? deserializeAws_json1_1AttributeListType ( output . UserAttributes , context ) : undefined , UserCreateDate : output . UserCreateDate !== undefined && output . UserCreateDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . UserCreateDate ) ) ) : undefined , UserLastModifiedDate : output . UserLastModifiedDate !== undefined && output . UserLastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . UserLastModifiedDate ) ) ) : undefined , UserMFASettingList : output . UserMFASettingList !== undefined && output . UserMFASettingList !== null ? deserializeAws_json1_1UserMFASettingListType ( output . UserMFASettingList , context ) : undefined , UserStatus : __expectString ( output . UserStatus ) , Username : __expectString ( output . Username ) , } as any ; } ; const deserializeAws_json1_1AdminInitiateAuthResponse = ( output , context ) : AdminInitiateAuthResponse => { return { AuthenticationResult : output . AuthenticationResult !== undefined && output . AuthenticationResult !== null ? deserializeAws_json1_1AuthenticationResultType ( output . AuthenticationResult , context ) : undefined , ChallengeName : __expectString ( output . ChallengeName ) , ChallengeParameters : output . ChallengeParameters !== undefined && output . ChallengeParameters !== null ? deserializeAws_json1_1ChallengeParametersType ( output . ChallengeParameters , context ) : undefined , Session : __expectString ( output . Session ) , } as any ; } ; const deserializeAws_json1_1AdminLinkProviderForUserResponse = ( output , context ) : AdminLinkProviderForUserResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminListDevicesResponse = ( output , context ) : AdminListDevicesResponse => { return { Devices : output . Devices !== undefined && output . Devices !== null ? deserializeAws_json1_1DeviceListType ( output . Devices , context ) : undefined , PaginationToken : __expectString ( output . PaginationToken ) , } as any ; } ; const deserializeAws_json1_1AdminListGroupsForUserResponse = ( output , context ) : AdminListGroupsForUserResponse => { return { Groups : output . Groups !== undefined && output . Groups !== null ? deserializeAws_json1_1GroupListType ( output . Groups , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1AdminListUserAuthEventsResponse = ( output , context ) : AdminListUserAuthEventsResponse => { return { AuthEvents : output . AuthEvents !== undefined && output . AuthEvents !== null ? deserializeAws_json1_1AuthEventsType ( output . AuthEvents , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1AdminResetUserPasswordResponse = ( output , context ) : AdminResetUserPasswordResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminRespondToAuthChallengeResponse = ( output , context ) : AdminRespondToAuthChallengeResponse => { return { AuthenticationResult : output . AuthenticationResult !== undefined && output . AuthenticationResult !== null ? deserializeAws_json1_1AuthenticationResultType ( output . AuthenticationResult , context ) : undefined , ChallengeName : __expectString ( output . ChallengeName ) , ChallengeParameters : output . ChallengeParameters !== undefined && output . ChallengeParameters !== null ? deserializeAws_json1_1ChallengeParametersType ( output . ChallengeParameters , context ) : undefined , Session : __expectString ( output . Session ) , } as any ; } ; const deserializeAws_json1_1AdminSetUserMFAPreferenceResponse = ( output , context ) : AdminSetUserMFAPreferenceResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminSetUserPasswordResponse = ( output , context ) : AdminSetUserPasswordResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminSetUserSettingsResponse = ( output , context ) : AdminSetUserSettingsResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminUpdateAuthEventFeedbackResponse = ( output , context ) : AdminUpdateAuthEventFeedbackResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminUpdateDeviceStatusResponse = ( output , context ) : AdminUpdateDeviceStatusResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminUpdateUserAttributesResponse = ( output , context ) : AdminUpdateUserAttributesResponse => { return { } as any ; } ; const deserializeAws_json1_1AdminUserGlobalSignOutResponse = ( output , context ) : AdminUserGlobalSignOutResponse => { return { } as any ; } ; const deserializeAws_json1_1AliasAttributesListType = ( output , context ) : ( AliasAttributeType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1AliasExistsException = ( output , context ) : AliasExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1AnalyticsConfigurationType = ( output , context ) : AnalyticsConfigurationType => { return { ApplicationArn : __expectString ( output . ApplicationArn ) , ApplicationId : __expectString ( output . ApplicationId ) , ExternalId : __expectString ( output . ExternalId ) , RoleArn : __expectString ( output . RoleArn ) , UserDataShared : __expectBoolean ( output . UserDataShared ) , } as any ; } ; const deserializeAws_json1_1AssociateSoftwareTokenResponse = ( output , context ) : AssociateSoftwareTokenResponse => { return { SecretCode : __expectString ( output . SecretCode ) , Session : __expectString ( output . Session ) , } as any ; } ; const deserializeAws_json1_1AttributeListType = ( output , context ) : AttributeType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AttributeType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AttributeMappingType = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1AttributeType = ( output , context ) : AttributeType => { return { Name : __expectString ( output . Name ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1AuthenticationResultType = ( output , context ) : AuthenticationResultType => { return { AccessToken : __expectString ( output . AccessToken ) , ExpiresIn : __expectInt32 ( output . ExpiresIn ) , IdToken : __expectString ( output . IdToken ) , NewDeviceMetadata : output . NewDeviceMetadata !== undefined && output . NewDeviceMetadata !== null ? deserializeAws_json1_1NewDeviceMetadataType ( output . NewDeviceMetadata , context ) : undefined , RefreshToken : __expectString ( output . RefreshToken ) , TokenType : __expectString ( output . TokenType ) , } as any ; } ; const deserializeAws_json1_1AuthEventsType = ( output , context ) : AuthEventType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AuthEventType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AuthEventType = ( output , context ) : AuthEventType => { return { ChallengeResponses : output . ChallengeResponses !== undefined && output . ChallengeResponses !== null ? deserializeAws_json1_1ChallengeResponseListType ( output . ChallengeResponses , context ) : undefined , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , EventContextData : output . EventContextData !== undefined && output . EventContextData !== null ? deserializeAws_json1_1EventContextDataType ( output . EventContextData , context ) : undefined , EventFeedback : output . EventFeedback !== undefined && output . EventFeedback !== null ? deserializeAws_json1_1EventFeedbackType ( output . EventFeedback , context ) : undefined , EventId : __expectString ( output . EventId ) , EventResponse : __expectString ( output . EventResponse ) , EventRisk : output . EventRisk !== undefined && output . EventRisk !== null ? deserializeAws_json1_1EventRiskType ( output . EventRisk , context ) : undefined , EventType : __expectString ( output . EventType ) , } as any ; } ; const deserializeAws_json1_1BlockedIPRangeListType = ( 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_1CallbackURLsListType = ( 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_1ChallengeParametersType = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1ChallengeResponseListType = ( output , context ) : ChallengeResponseType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ChallengeResponseType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ChallengeResponseType = ( output , context ) : ChallengeResponseType => { return { ChallengeName : __expectString ( output . ChallengeName ) , ChallengeResponse : __expectString ( output . ChallengeResponse ) , } as any ; } ; const deserializeAws_json1_1ChangePasswordResponse = ( output , context ) : ChangePasswordResponse => { return { } as any ; } ; const deserializeAws_json1_1ClientPermissionListType = ( 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_1CodeDeliveryDetailsListType = ( output , context ) : CodeDeliveryDetailsType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CodeDeliveryDetailsType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CodeDeliveryDetailsType = ( output , context ) : CodeDeliveryDetailsType => { return { AttributeName : __expectString ( output . AttributeName ) , DeliveryMedium : __expectString ( output . DeliveryMedium ) , Destination : __expectString ( output . Destination ) , } as any ; } ; const deserializeAws_json1_1CodeDeliveryFailureException = ( output , context ) : CodeDeliveryFailureException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1CodeMismatchException = ( output , context ) : CodeMismatchException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1CompromisedCredentialsActionsType = ( output , context ) : CompromisedCredentialsActionsType => { return { EventAction : __expectString ( output . EventAction ) , } as any ; } ; const deserializeAws_json1_1CompromisedCredentialsRiskConfigurationType = ( output , context ) : CompromisedCredentialsRiskConfigurationType => { return { Actions : output . Actions !== undefined && output . Actions !== null ? deserializeAws_json1_1CompromisedCredentialsActionsType ( output . Actions , context ) : undefined , EventFilter : output . EventFilter !== undefined && output . EventFilter !== null ? deserializeAws_json1_1EventFiltersType ( output . EventFilter , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ConcurrentModificationException = ( output , context ) : ConcurrentModificationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ConfirmDeviceResponse = ( output , context ) : ConfirmDeviceResponse => { return { UserConfirmationNecessary : __expectBoolean ( output . UserConfirmationNecessary ) , } as any ; } ; const deserializeAws_json1_1ConfirmForgotPasswordResponse = ( output , context ) : ConfirmForgotPasswordResponse => { return { } as any ; } ; const deserializeAws_json1_1ConfirmSignUpResponse = ( output , context ) : ConfirmSignUpResponse => { return { } as any ; } ; const deserializeAws_json1_1CreateGroupResponse = ( output , context ) : CreateGroupResponse => { return { Group : output . Group !== undefined && output . Group !== null ? deserializeAws_json1_1GroupType ( output . Group , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateIdentityProviderResponse = ( output , context ) : CreateIdentityProviderResponse => { return { IdentityProvider : output . IdentityProvider !== undefined && output . IdentityProvider !== null ? deserializeAws_json1_1IdentityProviderType ( output . IdentityProvider , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateResourceServerResponse = ( output , context ) : CreateResourceServerResponse => { return { ResourceServer : output . ResourceServer !== undefined && output . ResourceServer !== null ? deserializeAws_json1_1ResourceServerType ( output . ResourceServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateUserImportJobResponse = ( output , context ) : CreateUserImportJobResponse => { return { UserImportJob : output . UserImportJob !== undefined && output . UserImportJob !== null ? deserializeAws_json1_1UserImportJobType ( output . UserImportJob , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateUserPoolClientResponse = ( output , context ) : CreateUserPoolClientResponse => { return { UserPoolClient : output . UserPoolClient !== undefined && output . UserPoolClient !== null ? deserializeAws_json1_1UserPoolClientType ( output . UserPoolClient , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateUserPoolDomainResponse = ( output , context ) : CreateUserPoolDomainResponse => { return { CloudFrontDomain : __expectString ( output . CloudFrontDomain ) , } as any ; } ; const deserializeAws_json1_1CreateUserPoolResponse = ( output , context ) : CreateUserPoolResponse => { return { UserPool : output . UserPool !== undefined && output . UserPool !== null ? deserializeAws_json1_1UserPoolType ( output . UserPool , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CustomDomainConfigType = ( output , context ) : CustomDomainConfigType => { return { CertificateArn : __expectString ( output . CertificateArn ) , } as any ; } ; const deserializeAws_json1_1CustomEmailLambdaVersionConfigType = ( output , context ) : CustomEmailLambdaVersionConfigType => { return { LambdaArn : __expectString ( output . LambdaArn ) , LambdaVersion : __expectString ( output . LambdaVersion ) , } as any ; } ; const deserializeAws_json1_1CustomSMSLambdaVersionConfigType = ( output , context ) : CustomSMSLambdaVersionConfigType => { return { LambdaArn : __expectString ( output . LambdaArn ) , LambdaVersion : __expectString ( output . LambdaVersion ) , } as any ; } ; const deserializeAws_json1_1DeleteUserAttributesResponse = ( output , context ) : DeleteUserAttributesResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteUserPoolDomainResponse = ( output , context ) : DeleteUserPoolDomainResponse => { return { } as any ; } ; const deserializeAws_json1_1DescribeIdentityProviderResponse = ( output , context ) : DescribeIdentityProviderResponse => { return { IdentityProvider : output . IdentityProvider !== undefined && output . IdentityProvider !== null ? deserializeAws_json1_1IdentityProviderType ( output . IdentityProvider , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeResourceServerResponse = ( output , context ) : DescribeResourceServerResponse => { return { ResourceServer : output . ResourceServer !== undefined && output . ResourceServer !== null ? deserializeAws_json1_1ResourceServerType ( output . ResourceServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeRiskConfigurationResponse = ( output , context ) : DescribeRiskConfigurationResponse => { return { RiskConfiguration : output . RiskConfiguration !== undefined && output . RiskConfiguration !== null ? deserializeAws_json1_1RiskConfigurationType ( output . RiskConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeUserImportJobResponse = ( output , context ) : DescribeUserImportJobResponse => { return { UserImportJob : output . UserImportJob !== undefined && output . UserImportJob !== null ? deserializeAws_json1_1UserImportJobType ( output . UserImportJob , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeUserPoolClientResponse = ( output , context ) : DescribeUserPoolClientResponse => { return { UserPoolClient : output . UserPoolClient !== undefined && output . UserPoolClient !== null ? deserializeAws_json1_1UserPoolClientType ( output . UserPoolClient , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeUserPoolDomainResponse = ( output , context ) : DescribeUserPoolDomainResponse => { return { DomainDescription : output . DomainDescription !== undefined && output . DomainDescription !== null ? deserializeAws_json1_1DomainDescriptionType ( output . DomainDescription , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeUserPoolResponse = ( output , context ) : DescribeUserPoolResponse => { return { UserPool : output . UserPool !== undefined && output . UserPool !== null ? deserializeAws_json1_1UserPoolType ( output . UserPool , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DeviceConfigurationType = ( output , context ) : DeviceConfigurationType => { return { ChallengeRequiredOnNewDevice : __expectBoolean ( output . ChallengeRequiredOnNewDevice ) , DeviceOnlyRememberedOnUserPrompt : __expectBoolean ( output . DeviceOnlyRememberedOnUserPrompt ) , } as any ; } ; const deserializeAws_json1_1DeviceListType = ( output , context ) : DeviceType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DeviceType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DeviceType = ( output , context ) : DeviceType => { return { DeviceAttributes : output . DeviceAttributes !== undefined && output . DeviceAttributes !== null ? deserializeAws_json1_1AttributeListType ( output . DeviceAttributes , context ) : undefined , DeviceCreateDate : output . DeviceCreateDate !== undefined && output . DeviceCreateDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . DeviceCreateDate ) ) ) : undefined , DeviceKey : __expectString ( output . DeviceKey ) , DeviceLastAuthenticatedDate : output . DeviceLastAuthenticatedDate !== undefined && output . DeviceLastAuthenticatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . DeviceLastAuthenticatedDate ) ) ) : undefined , DeviceLastModifiedDate : output . DeviceLastModifiedDate !== undefined && output . DeviceLastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . DeviceLastModifiedDate ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1DomainDescriptionType = ( output , context ) : DomainDescriptionType => { return { AWSAccountId : __expectString ( output . AWSAccountId ) , CloudFrontDistribution : __expectString ( output . CloudFrontDistribution ) , CustomDomainConfig : output . CustomDomainConfig !== undefined && output . CustomDomainConfig !== null ? deserializeAws_json1_1CustomDomainConfigType ( output . CustomDomainConfig , context ) : undefined , Domain : __expectString ( output . Domain ) , S3Bucket : __expectString ( output . S3Bucket ) , Status : __expectString ( output . Status ) , UserPoolId : __expectString ( output . UserPoolId ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1DuplicateProviderException = ( output , context ) : DuplicateProviderException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1EmailConfigurationType = ( output , context ) : EmailConfigurationType => { return { ConfigurationSet : __expectString ( output . ConfigurationSet ) , EmailSendingAccount : __expectString ( output . EmailSendingAccount ) , From : __expectString ( output . From ) , ReplyToEmailAddress : __expectString ( output . ReplyToEmailAddress ) , SourceArn : __expectString ( output . SourceArn ) , } as any ; } ; const deserializeAws_json1_1EnableSoftwareTokenMFAException = ( output , context ) : EnableSoftwareTokenMFAException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1EventContextDataType = ( output , context ) : EventContextDataType => { return { City : __expectString ( output . City ) , Country : __expectString ( output . Country ) , DeviceName : __expectString ( output . DeviceName ) , IpAddress : __expectString ( output . IpAddress ) , Timezone : __expectString ( output . Timezone ) , } as any ; } ; const deserializeAws_json1_1EventFeedbackType = ( output , context ) : EventFeedbackType => { return { FeedbackDate : output . FeedbackDate !== undefined && output . FeedbackDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . FeedbackDate ) ) ) : undefined , FeedbackValue : __expectString ( output . FeedbackValue ) , Provider : __expectString ( output . Provider ) , } as any ; } ; const deserializeAws_json1_1EventFiltersType = ( output , context ) : ( EventFilterType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1EventRiskType = ( output , context ) : EventRiskType => { return { CompromisedCredentialsDetected : __expectBoolean ( output . CompromisedCredentialsDetected ) , RiskDecision : __expectString ( output . RiskDecision ) , RiskLevel : __expectString ( output . RiskLevel ) , } as any ; } ; const deserializeAws_json1_1ExpiredCodeException = ( output , context ) : ExpiredCodeException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ExplicitAuthFlowsListType = ( output , context ) : ( ExplicitAuthFlowsType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1ForgotPasswordResponse = ( output , context ) : ForgotPasswordResponse => { return { CodeDeliveryDetails : output . CodeDeliveryDetails !== undefined && output . CodeDeliveryDetails !== null ? deserializeAws_json1_1CodeDeliveryDetailsType ( output . CodeDeliveryDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetCSVHeaderResponse = ( output , context ) : GetCSVHeaderResponse => { return { CSVHeader : output . CSVHeader !== undefined && output . CSVHeader !== null ? deserializeAws_json1_1ListOfStringTypes ( output . CSVHeader , context ) : undefined , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1GetDeviceResponse = ( output , context ) : GetDeviceResponse => { return { Device : output . Device !== undefined && output . Device !== null ? deserializeAws_json1_1DeviceType ( output . Device , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetGroupResponse = ( output , context ) : GetGroupResponse => { return { Group : output . Group !== undefined && output . Group !== null ? deserializeAws_json1_1GroupType ( output . Group , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetIdentityProviderByIdentifierResponse = ( output , context ) : GetIdentityProviderByIdentifierResponse => { return { IdentityProvider : output . IdentityProvider !== undefined && output . IdentityProvider !== null ? deserializeAws_json1_1IdentityProviderType ( output . IdentityProvider , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetSigningCertificateResponse = ( output , context ) : GetSigningCertificateResponse => { return { Certificate : __expectString ( output . Certificate ) , } as any ; } ; const deserializeAws_json1_1GetUICustomizationResponse = ( output , context ) : GetUICustomizationResponse => { return { UICustomization : output . UICustomization !== undefined && output . UICustomization !== null ? deserializeAws_json1_1UICustomizationType ( output . UICustomization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetUserAttributeVerificationCodeResponse = ( output , context ) : GetUserAttributeVerificationCodeResponse => { return { CodeDeliveryDetails : output . CodeDeliveryDetails !== undefined && output . CodeDeliveryDetails !== null ? deserializeAws_json1_1CodeDeliveryDetailsType ( output . CodeDeliveryDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetUserPoolMfaConfigResponse = ( output , context ) : GetUserPoolMfaConfigResponse => { return { MfaConfiguration : __expectString ( output . MfaConfiguration ) , SmsMfaConfiguration : output . SmsMfaConfiguration !== undefined && output . SmsMfaConfiguration !== null ? deserializeAws_json1_1SmsMfaConfigType ( output . SmsMfaConfiguration , context ) : undefined , SoftwareTokenMfaConfiguration : output . SoftwareTokenMfaConfiguration !== undefined && output . SoftwareTokenMfaConfiguration !== null ? deserializeAws_json1_1SoftwareTokenMfaConfigType ( output . SoftwareTokenMfaConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetUserResponse = ( output , context ) : GetUserResponse => { return { MFAOptions : output . MFAOptions !== undefined && output . MFAOptions !== null ? deserializeAws_json1_1MFAOptionListType ( output . MFAOptions , context ) : undefined , PreferredMfaSetting : __expectString ( output . PreferredMfaSetting ) , UserAttributes : output . UserAttributes !== undefined && output . UserAttributes !== null ? deserializeAws_json1_1AttributeListType ( output . UserAttributes , context ) : undefined , UserMFASettingList : output . UserMFASettingList !== undefined && output . UserMFASettingList !== null ? deserializeAws_json1_1UserMFASettingListType ( output . UserMFASettingList , context ) : undefined , Username : __expectString ( output . Username ) , } as any ; } ; const deserializeAws_json1_1GlobalSignOutResponse = ( output , context ) : GlobalSignOutResponse => { return { } as any ; } ; const deserializeAws_json1_1GroupExistsException = ( output , context ) : GroupExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1GroupListType = ( output , context ) : GroupType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GroupType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GroupType = ( output , context ) : GroupType => { return { CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , Description : __expectString ( output . Description ) , GroupName : __expectString ( output . GroupName ) , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , Precedence : __expectInt32 ( output . Precedence ) , RoleArn : __expectString ( output . RoleArn ) , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1IdentityProviderType = ( output , context ) : IdentityProviderType => { return { AttributeMapping : output . AttributeMapping !== undefined && output . AttributeMapping !== null ? deserializeAws_json1_1AttributeMappingType ( output . AttributeMapping , context ) : undefined , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , IdpIdentifiers : output . IdpIdentifiers !== undefined && output . IdpIdentifiers !== null ? deserializeAws_json1_1IdpIdentifiersListType ( output . IdpIdentifiers , context ) : undefined , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , ProviderDetails : output . ProviderDetails !== undefined && output . ProviderDetails !== null ? deserializeAws_json1_1ProviderDetailsType ( output . ProviderDetails , context ) : undefined , ProviderName : __expectString ( output . ProviderName ) , ProviderType : __expectString ( output . ProviderType ) , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1IdpIdentifiersListType = ( 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_1InitiateAuthResponse = ( output , context ) : InitiateAuthResponse => { return { AuthenticationResult : output . AuthenticationResult !== undefined && output . AuthenticationResult !== null ? deserializeAws_json1_1AuthenticationResultType ( output . AuthenticationResult , context ) : undefined , ChallengeName : __expectString ( output . ChallengeName ) , ChallengeParameters : output . ChallengeParameters !== undefined && output . ChallengeParameters !== null ? deserializeAws_json1_1ChallengeParametersType ( output . ChallengeParameters , context ) : undefined , Session : __expectString ( output . Session ) , } as any ; } ; const deserializeAws_json1_1InternalErrorException = ( output , context ) : InternalErrorException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidEmailRoleAccessPolicyException = ( output , context ) : InvalidEmailRoleAccessPolicyException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidLambdaResponseException = ( output , context ) : InvalidLambdaResponseException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidOAuthFlowException = ( output , context ) : InvalidOAuthFlowException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidParameterException = ( output , context ) : InvalidParameterException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidPasswordException = ( output , context ) : InvalidPasswordException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidSmsRoleAccessPolicyException = ( output , context ) : InvalidSmsRoleAccessPolicyException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidSmsRoleTrustRelationshipException = ( output , context ) : InvalidSmsRoleTrustRelationshipException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidUserPoolConfigurationException = ( output , context ) : InvalidUserPoolConfigurationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LambdaConfigType = ( output , context ) : LambdaConfigType => { return { CreateAuthChallenge : __expectString ( output . CreateAuthChallenge ) , CustomEmailSender : output . CustomEmailSender !== undefined && output . CustomEmailSender !== null ? deserializeAws_json1_1CustomEmailLambdaVersionConfigType ( output . CustomEmailSender , context ) : undefined , CustomMessage : __expectString ( output . CustomMessage ) , CustomSMSSender : output . CustomSMSSender !== undefined && output . CustomSMSSender !== null ? deserializeAws_json1_1CustomSMSLambdaVersionConfigType ( output . CustomSMSSender , context ) : undefined , DefineAuthChallenge : __expectString ( output . DefineAuthChallenge ) , KMSKeyID : __expectString ( output . KMSKeyID ) , PostAuthentication : __expectString ( output . PostAuthentication ) , PostConfirmation : __expectString ( output . PostConfirmation ) , PreAuthentication : __expectString ( output . PreAuthentication ) , PreSignUp : __expectString ( output . PreSignUp ) , PreTokenGeneration : __expectString ( output . PreTokenGeneration ) , UserMigration : __expectString ( output . UserMigration ) , VerifyAuthChallengeResponse : __expectString ( output . VerifyAuthChallengeResponse ) , } as any ; } ; const deserializeAws_json1_1LimitExceededException = ( output , context ) : LimitExceededException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ListDevicesResponse = ( output , context ) : ListDevicesResponse => { return { Devices : output . Devices !== undefined && output . Devices !== null ? deserializeAws_json1_1DeviceListType ( output . Devices , context ) : undefined , PaginationToken : __expectString ( output . PaginationToken ) , } as any ; } ; const deserializeAws_json1_1ListGroupsResponse = ( output , context ) : ListGroupsResponse => { return { Groups : output . Groups !== undefined && output . Groups !== null ? deserializeAws_json1_1GroupListType ( output . Groups , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListIdentityProvidersResponse = ( output , context ) : ListIdentityProvidersResponse => { return { NextToken : __expectString ( output . NextToken ) , Providers : output . Providers !== undefined && output . Providers !== null ? deserializeAws_json1_1ProvidersListType ( output . Providers , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListOfStringTypes = ( 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_1ListResourceServersResponse = ( output , context ) : ListResourceServersResponse => { return { NextToken : __expectString ( output . NextToken ) , ResourceServers : output . ResourceServers !== undefined && output . ResourceServers !== null ? deserializeAws_json1_1ResourceServersListType ( output . ResourceServers , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListTagsForResourceResponse = ( output , context ) : ListTagsForResourceResponse => { return { Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1UserPoolTagsType ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListUserImportJobsResponse = ( output , context ) : ListUserImportJobsResponse => { return { PaginationToken : __expectString ( output . PaginationToken ) , UserImportJobs : output . UserImportJobs !== undefined && output . UserImportJobs !== null ? deserializeAws_json1_1UserImportJobsListType ( output . UserImportJobs , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListUserPoolClientsResponse = ( output , context ) : ListUserPoolClientsResponse => { return { NextToken : __expectString ( output . NextToken ) , UserPoolClients : output . UserPoolClients !== undefined && output . UserPoolClients !== null ? deserializeAws_json1_1UserPoolClientListType ( output . UserPoolClients , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListUserPoolsResponse = ( output , context ) : ListUserPoolsResponse => { return { NextToken : __expectString ( output . NextToken ) , UserPools : output . UserPools !== undefined && output . UserPools !== null ? deserializeAws_json1_1UserPoolListType ( output . UserPools , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListUsersInGroupResponse = ( output , context ) : ListUsersInGroupResponse => { return { NextToken : __expectString ( output . NextToken ) , Users : output . Users !== undefined && output . Users !== null ? deserializeAws_json1_1UsersListType ( output . Users , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListUsersResponse = ( output , context ) : ListUsersResponse => { return { PaginationToken : __expectString ( output . PaginationToken ) , Users : output . Users !== undefined && output . Users !== null ? deserializeAws_json1_1UsersListType ( output . Users , context ) : undefined , } as any ; } ; const deserializeAws_json1_1LogoutURLsListType = ( 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_1MessageTemplateType = ( output , context ) : MessageTemplateType => { return { EmailMessage : __expectString ( output . EmailMessage ) , EmailSubject : __expectString ( output . EmailSubject ) , SMSMessage : __expectString ( output . SMSMessage ) , } as any ; } ; const deserializeAws_json1_1MFAMethodNotFoundException = ( output , context ) : MFAMethodNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1MFAOptionListType = ( output , context ) : MFAOptionType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1MFAOptionType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MFAOptionType = ( output , context ) : MFAOptionType => { return { AttributeName : __expectString ( output . AttributeName ) , DeliveryMedium : __expectString ( output . DeliveryMedium ) , } as any ; } ; const deserializeAws_json1_1NewDeviceMetadataType = ( output , context ) : NewDeviceMetadataType => { return { DeviceGroupKey : __expectString ( output . DeviceGroupKey ) , DeviceKey : __expectString ( output . DeviceKey ) , } as any ; } ; const deserializeAws_json1_1NotAuthorizedException = ( output , context ) : NotAuthorizedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1NotifyConfigurationType = ( output , context ) : NotifyConfigurationType => { return { BlockEmail : output . BlockEmail !== undefined && output . BlockEmail !== null ? deserializeAws_json1_1NotifyEmailType ( output . BlockEmail , context ) : undefined , From : __expectString ( output . From ) , MfaEmail : output . MfaEmail !== undefined && output . MfaEmail !== null ? deserializeAws_json1_1NotifyEmailType ( output . MfaEmail , context ) : undefined , NoActionEmail : output . NoActionEmail !== undefined && output . NoActionEmail !== null ? deserializeAws_json1_1NotifyEmailType ( output . NoActionEmail , context ) : undefined , ReplyTo : __expectString ( output . ReplyTo ) , SourceArn : __expectString ( output . SourceArn ) , } as any ; } ; const deserializeAws_json1_1NotifyEmailType = ( output , context ) : NotifyEmailType => { return { HtmlBody : __expectString ( output . HtmlBody ) , Subject : __expectString ( output . Subject ) , TextBody : __expectString ( output . TextBody ) , } as any ; } ; const deserializeAws_json1_1NumberAttributeConstraintsType = ( output , context ) : NumberAttributeConstraintsType => { return { MaxValue : __expectString ( output . MaxValue ) , MinValue : __expectString ( output . MinValue ) , } as any ; } ; const deserializeAws_json1_1OAuthFlowsType = ( output , context ) : ( OAuthFlowType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1PasswordPolicyType = ( output , context ) : PasswordPolicyType => { return { MinimumLength : __expectInt32 ( output . MinimumLength ) , RequireLowercase : __expectBoolean ( output . RequireLowercase ) , RequireNumbers : __expectBoolean ( output . RequireNumbers ) , RequireSymbols : __expectBoolean ( output . RequireSymbols ) , RequireUppercase : __expectBoolean ( output . RequireUppercase ) , TemporaryPasswordValidityDays : __expectInt32 ( output . TemporaryPasswordValidityDays ) , } as any ; } ; const deserializeAws_json1_1PasswordResetRequiredException = ( output , context ) : PasswordResetRequiredException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1PreconditionNotMetException = ( output , context ) : PreconditionNotMetException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ProviderDescription = ( output , context ) : ProviderDescription => { return { CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , ProviderName : __expectString ( output . ProviderName ) , ProviderType : __expectString ( output . ProviderType ) , } as any ; } ; const deserializeAws_json1_1ProviderDetailsType = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1ProvidersListType = ( output , context ) : ProviderDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ProviderDescription ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RecoveryMechanismsType = ( output , context ) : RecoveryOptionType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RecoveryOptionType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RecoveryOptionType = ( output , context ) : RecoveryOptionType => { return { Name : __expectString ( output . Name ) , Priority : __expectInt32 ( output . Priority ) , } as any ; } ; const deserializeAws_json1_1ResendConfirmationCodeResponse = ( output , context ) : ResendConfirmationCodeResponse => { return { CodeDeliveryDetails : output . CodeDeliveryDetails !== undefined && output . CodeDeliveryDetails !== null ? deserializeAws_json1_1CodeDeliveryDetailsType ( output . CodeDeliveryDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceServerScopeListType = ( output , context ) : ResourceServerScopeType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ResourceServerScopeType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ResourceServerScopeType = ( output , context ) : ResourceServerScopeType => { return { ScopeDescription : __expectString ( output . ScopeDescription ) , ScopeName : __expectString ( output . ScopeName ) , } as any ; } ; const deserializeAws_json1_1ResourceServersListType = ( output , context ) : ResourceServerType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ResourceServerType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ResourceServerType = ( output , context ) : ResourceServerType => { return { Identifier : __expectString ( output . Identifier ) , Name : __expectString ( output . Name ) , Scopes : output . Scopes !== undefined && output . Scopes !== null ? deserializeAws_json1_1ResourceServerScopeListType ( output . Scopes , context ) : undefined , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1RespondToAuthChallengeResponse = ( output , context ) : RespondToAuthChallengeResponse => { return { AuthenticationResult : output . AuthenticationResult !== undefined && output . AuthenticationResult !== null ? deserializeAws_json1_1AuthenticationResultType ( output . AuthenticationResult , context ) : undefined , ChallengeName : __expectString ( output . ChallengeName ) , ChallengeParameters : output . ChallengeParameters !== undefined && output . ChallengeParameters !== null ? deserializeAws_json1_1ChallengeParametersType ( output . ChallengeParameters , context ) : undefined , Session : __expectString ( output . Session ) , } as any ; } ; const deserializeAws_json1_1RevokeTokenResponse = ( output , context ) : RevokeTokenResponse => { return { } as any ; } ; const deserializeAws_json1_1RiskConfigurationType = ( output , context ) : RiskConfigurationType => { return { AccountTakeoverRiskConfiguration : output . AccountTakeoverRiskConfiguration !== undefined && output . AccountTakeoverRiskConfiguration !== null ? deserializeAws_json1_1AccountTakeoverRiskConfigurationType ( output . AccountTakeoverRiskConfiguration , context ) : undefined , ClientId : __expectString ( output . ClientId ) , CompromisedCredentialsRiskConfiguration : output . CompromisedCredentialsRiskConfiguration !== undefined && output . CompromisedCredentialsRiskConfiguration !== null ? deserializeAws_json1_1CompromisedCredentialsRiskConfigurationType ( output . CompromisedCredentialsRiskConfiguration , context ) : undefined , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , RiskExceptionConfiguration : output . RiskExceptionConfiguration !== undefined && output . RiskExceptionConfiguration !== null ? deserializeAws_json1_1RiskExceptionConfigurationType ( output . RiskExceptionConfiguration , context ) : undefined , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1RiskExceptionConfigurationType = ( output , context ) : RiskExceptionConfigurationType => { return { BlockedIPRangeList : output . BlockedIPRangeList !== undefined && output . BlockedIPRangeList !== null ? deserializeAws_json1_1BlockedIPRangeListType ( output . BlockedIPRangeList , context ) : undefined , SkippedIPRangeList : output . SkippedIPRangeList !== undefined && output . SkippedIPRangeList !== null ? deserializeAws_json1_1SkippedIPRangeListType ( output . SkippedIPRangeList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SchemaAttributesListType = ( output , context ) : SchemaAttributeType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1SchemaAttributeType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1SchemaAttributeType = ( output , context ) : SchemaAttributeType => { return { AttributeDataType : __expectString ( output . AttributeDataType ) , DeveloperOnlyAttribute : __expectBoolean ( output . DeveloperOnlyAttribute ) , Mutable : __expectBoolean ( output . Mutable ) , Name : __expectString ( output . Name ) , NumberAttributeConstraints : output . NumberAttributeConstraints !== undefined && output . NumberAttributeConstraints !== null ? deserializeAws_json1_1NumberAttributeConstraintsType ( output . NumberAttributeConstraints , context ) : undefined , Required : __expectBoolean ( output . Required ) , StringAttributeConstraints : output . StringAttributeConstraints !== undefined && output . StringAttributeConstraints !== null ? deserializeAws_json1_1StringAttributeConstraintsType ( output . StringAttributeConstraints , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ScopeDoesNotExistException = ( output , context ) : ScopeDoesNotExistException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ScopeListType = ( 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_1SetRiskConfigurationResponse = ( output , context ) : SetRiskConfigurationResponse => { return { RiskConfiguration : output . RiskConfiguration !== undefined && output . RiskConfiguration !== null ? deserializeAws_json1_1RiskConfigurationType ( output . RiskConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SetUICustomizationResponse = ( output , context ) : SetUICustomizationResponse => { return { UICustomization : output . UICustomization !== undefined && output . UICustomization !== null ? deserializeAws_json1_1UICustomizationType ( output . UICustomization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SetUserMFAPreferenceResponse = ( output , context ) : SetUserMFAPreferenceResponse => { return { } as any ; } ; const deserializeAws_json1_1SetUserPoolMfaConfigResponse = ( output , context ) : SetUserPoolMfaConfigResponse => { return { MfaConfiguration : __expectString ( output . MfaConfiguration ) , SmsMfaConfiguration : output . SmsMfaConfiguration !== undefined && output . SmsMfaConfiguration !== null ? deserializeAws_json1_1SmsMfaConfigType ( output . SmsMfaConfiguration , context ) : undefined , SoftwareTokenMfaConfiguration : output . SoftwareTokenMfaConfiguration !== undefined && output . SoftwareTokenMfaConfiguration !== null ? deserializeAws_json1_1SoftwareTokenMfaConfigType ( output . SoftwareTokenMfaConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SetUserSettingsResponse = ( output , context ) : SetUserSettingsResponse => { return { } as any ; } ; const deserializeAws_json1_1SignUpResponse = ( output , context ) : SignUpResponse => { return { CodeDeliveryDetails : output . CodeDeliveryDetails !== undefined && output . CodeDeliveryDetails !== null ? deserializeAws_json1_1CodeDeliveryDetailsType ( output . CodeDeliveryDetails , context ) : undefined , UserConfirmed : __expectBoolean ( output . UserConfirmed ) , UserSub : __expectString ( output . UserSub ) , } as any ; } ; const deserializeAws_json1_1SkippedIPRangeListType = ( 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_1SmsConfigurationType = ( output , context ) : SmsConfigurationType => { return { ExternalId : __expectString ( output . ExternalId ) , SnsCallerArn : __expectString ( output . SnsCallerArn ) , } as any ; } ; const deserializeAws_json1_1SmsMfaConfigType = ( output , context ) : SmsMfaConfigType => { return { SmsAuthenticationMessage : __expectString ( output . SmsAuthenticationMessage ) , SmsConfiguration : output . SmsConfiguration !== undefined && output . SmsConfiguration !== null ? deserializeAws_json1_1SmsConfigurationType ( output . SmsConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SoftwareTokenMfaConfigType = ( output , context ) : SoftwareTokenMfaConfigType => { return { Enabled : __expectBoolean ( output . Enabled ) , } as any ; } ; const deserializeAws_json1_1SoftwareTokenMFANotFoundException = ( output , context ) : SoftwareTokenMFANotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1StartUserImportJobResponse = ( output , context ) : StartUserImportJobResponse => { return { UserImportJob : output . UserImportJob !== undefined && output . UserImportJob !== null ? deserializeAws_json1_1UserImportJobType ( output . UserImportJob , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StopUserImportJobResponse = ( output , context ) : StopUserImportJobResponse => { return { UserImportJob : output . UserImportJob !== undefined && output . UserImportJob !== null ? deserializeAws_json1_1UserImportJobType ( output . UserImportJob , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StringAttributeConstraintsType = ( output , context ) : StringAttributeConstraintsType => { return { MaxLength : __expectString ( output . MaxLength ) , MinLength : __expectString ( output . MinLength ) , } as any ; } ; const deserializeAws_json1_1SupportedIdentityProvidersListType = ( 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_1TagResourceResponse = ( output , context ) : TagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1TokenValidityUnitsType = ( output , context ) : TokenValidityUnitsType => { return { AccessToken : __expectString ( output . AccessToken ) , IdToken : __expectString ( output . IdToken ) , RefreshToken : __expectString ( output . RefreshToken ) , } as any ; } ; const deserializeAws_json1_1TooManyFailedAttemptsException = ( output , context ) : TooManyFailedAttemptsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1TooManyRequestsException = ( output , context ) : TooManyRequestsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UICustomizationType = ( output , context ) : UICustomizationType => { return { CSS : __expectString ( output . CSS ) , CSSVersion : __expectString ( output . CSSVersion ) , ClientId : __expectString ( output . ClientId ) , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , ImageUrl : __expectString ( output . ImageUrl ) , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1UnauthorizedException = ( output , context ) : UnauthorizedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnexpectedLambdaException = ( output , context ) : UnexpectedLambdaException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedIdentityProviderException = ( output , context ) : UnsupportedIdentityProviderException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedOperationException = ( output , context ) : UnsupportedOperationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedTokenTypeException = ( output , context ) : UnsupportedTokenTypeException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedUserStateException = ( output , context ) : UnsupportedUserStateException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UntagResourceResponse = ( output , context ) : UntagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateAuthEventFeedbackResponse = ( output , context ) : UpdateAuthEventFeedbackResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateDeviceStatusResponse = ( output , context ) : UpdateDeviceStatusResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateGroupResponse = ( output , context ) : UpdateGroupResponse => { return { Group : output . Group !== undefined && output . Group !== null ? deserializeAws_json1_1GroupType ( output . Group , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateIdentityProviderResponse = ( output , context ) : UpdateIdentityProviderResponse => { return { IdentityProvider : output . IdentityProvider !== undefined && output . IdentityProvider !== null ? deserializeAws_json1_1IdentityProviderType ( output . IdentityProvider , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateResourceServerResponse = ( output , context ) : UpdateResourceServerResponse => { return { ResourceServer : output . ResourceServer !== undefined && output . ResourceServer !== null ? deserializeAws_json1_1ResourceServerType ( output . ResourceServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateUserAttributesResponse = ( output , context ) : UpdateUserAttributesResponse => { return { CodeDeliveryDetailsList : output . CodeDeliveryDetailsList !== undefined && output . CodeDeliveryDetailsList !== null ? deserializeAws_json1_1CodeDeliveryDetailsListType ( output . CodeDeliveryDetailsList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateUserPoolClientResponse = ( output , context ) : UpdateUserPoolClientResponse => { return { UserPoolClient : output . UserPoolClient !== undefined && output . UserPoolClient !== null ? deserializeAws_json1_1UserPoolClientType ( output . UserPoolClient , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateUserPoolDomainResponse = ( output , context ) : UpdateUserPoolDomainResponse => { return { CloudFrontDomain : __expectString ( output . CloudFrontDomain ) , } as any ; } ; const deserializeAws_json1_1UpdateUserPoolResponse = ( output , context ) : UpdateUserPoolResponse => { return { } as any ; } ; const deserializeAws_json1_1UserImportInProgressException = ( output , context ) : UserImportInProgressException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserImportJobsListType = ( output , context ) : UserImportJobType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1UserImportJobType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1UserImportJobType = ( output , context ) : UserImportJobType => { return { CloudWatchLogsRoleArn : __expectString ( output . CloudWatchLogsRoleArn ) , CompletionDate : output . CompletionDate !== undefined && output . CompletionDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CompletionDate ) ) ) : undefined , CompletionMessage : __expectString ( output . CompletionMessage ) , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , FailedUsers : __expectLong ( output . FailedUsers ) , ImportedUsers : __expectLong ( output . ImportedUsers ) , JobId : __expectString ( output . JobId ) , JobName : __expectString ( output . JobName ) , PreSignedUrl : __expectString ( output . PreSignedUrl ) , SkippedUsers : __expectLong ( output . SkippedUsers ) , StartDate : output . StartDate !== undefined && output . StartDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . StartDate ) ) ) : undefined , Status : __expectString ( output . Status ) , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1UserLambdaValidationException = ( output , context ) : UserLambdaValidationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserMFASettingListType = ( 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_1UsernameAttributesListType = ( output , context ) : ( UsernameAttributeType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1UsernameConfigurationType = ( output , context ) : UsernameConfigurationType => { return { CaseSensitive : __expectBoolean ( output . CaseSensitive ) , } as any ; } ; const deserializeAws_json1_1UsernameExistsException = ( output , context ) : UsernameExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserNotConfirmedException = ( output , context ) : UserNotConfirmedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserNotFoundException = ( output , context ) : UserNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserPoolAddOnNotEnabledException = ( output , context ) : UserPoolAddOnNotEnabledException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserPoolAddOnsType = ( output , context ) : UserPoolAddOnsType => { return { AdvancedSecurityMode : __expectString ( output . AdvancedSecurityMode ) , } as any ; } ; const deserializeAws_json1_1UserPoolClientDescription = ( output , context ) : UserPoolClientDescription => { return { ClientId : __expectString ( output . ClientId ) , ClientName : __expectString ( output . ClientName ) , UserPoolId : __expectString ( output . UserPoolId ) , } as any ; } ; const deserializeAws_json1_1UserPoolClientListType = ( output , context ) : UserPoolClientDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1UserPoolClientDescription ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1UserPoolClientType = ( output , context ) : UserPoolClientType => { return { AccessTokenValidity : __expectInt32 ( output . AccessTokenValidity ) , AllowedOAuthFlows : output . AllowedOAuthFlows !== undefined && output . AllowedOAuthFlows !== null ? deserializeAws_json1_1OAuthFlowsType ( output . AllowedOAuthFlows , context ) : undefined , AllowedOAuthFlowsUserPoolClient : __expectBoolean ( output . AllowedOAuthFlowsUserPoolClient ) , AllowedOAuthScopes : output . AllowedOAuthScopes !== undefined && output . AllowedOAuthScopes !== null ? deserializeAws_json1_1ScopeListType ( output . AllowedOAuthScopes , context ) : undefined , AnalyticsConfiguration : output . AnalyticsConfiguration !== undefined && output . AnalyticsConfiguration !== null ? deserializeAws_json1_1AnalyticsConfigurationType ( output . AnalyticsConfiguration , context ) : undefined , CallbackURLs : output . CallbackURLs !== undefined && output . CallbackURLs !== null ? deserializeAws_json1_1CallbackURLsListType ( output . CallbackURLs , context ) : undefined , ClientId : __expectString ( output . ClientId ) , ClientName : __expectString ( output . ClientName ) , ClientSecret : __expectString ( output . ClientSecret ) , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , DefaultRedirectURI : __expectString ( output . DefaultRedirectURI ) , EnableTokenRevocation : __expectBoolean ( output . EnableTokenRevocation ) , ExplicitAuthFlows : output . ExplicitAuthFlows !== undefined && output . ExplicitAuthFlows !== null ? deserializeAws_json1_1ExplicitAuthFlowsListType ( output . ExplicitAuthFlows , context ) : undefined , IdTokenValidity : __expectInt32 ( output . IdTokenValidity ) , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , LogoutURLs : output . LogoutURLs !== undefined && output . LogoutURLs !== null ? deserializeAws_json1_1LogoutURLsListType ( output . LogoutURLs , context ) : undefined , PreventUserExistenceErrors : __expectString ( output . PreventUserExistenceErrors ) , ReadAttributes : output . ReadAttributes !== undefined && output . ReadAttributes !== null ? deserializeAws_json1_1ClientPermissionListType ( output . ReadAttributes , context ) : undefined , RefreshTokenValidity : __expectInt32 ( output . RefreshTokenValidity ) , SupportedIdentityProviders : output . SupportedIdentityProviders !== undefined && output . SupportedIdentityProviders !== null ? deserializeAws_json1_1SupportedIdentityProvidersListType ( output . SupportedIdentityProviders , context ) : undefined , TokenValidityUnits : output . TokenValidityUnits !== undefined && output . TokenValidityUnits !== null ? deserializeAws_json1_1TokenValidityUnitsType ( output . TokenValidityUnits , context ) : undefined , UserPoolId : __expectString ( output . UserPoolId ) , WriteAttributes : output . WriteAttributes !== undefined && output . WriteAttributes !== null ? deserializeAws_json1_1ClientPermissionListType ( output . WriteAttributes , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UserPoolDescriptionType = ( output , context ) : UserPoolDescriptionType => { return { CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , Id : __expectString ( output . Id ) , LambdaConfig : output . LambdaConfig !== undefined && output . LambdaConfig !== null ? deserializeAws_json1_1LambdaConfigType ( output . LambdaConfig , context ) : undefined , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , Name : __expectString ( output . Name ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1UserPoolListType = ( output , context ) : UserPoolDescriptionType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1UserPoolDescriptionType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1UserPoolPolicyType = ( output , context ) : UserPoolPolicyType => { return { PasswordPolicy : output . PasswordPolicy !== undefined && output . PasswordPolicy !== null ? deserializeAws_json1_1PasswordPolicyType ( output . PasswordPolicy , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UserPoolTaggingException = ( output , context ) : UserPoolTaggingException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UserPoolTagsType = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1UserPoolType = ( output , context ) : UserPoolType => { return { AccountRecoverySetting : output . AccountRecoverySetting !== undefined && output . AccountRecoverySetting !== null ? deserializeAws_json1_1AccountRecoverySettingType ( output . AccountRecoverySetting , context ) : undefined , AdminCreateUserConfig : output . AdminCreateUserConfig !== undefined && output . AdminCreateUserConfig !== null ? deserializeAws_json1_1AdminCreateUserConfigType ( output . AdminCreateUserConfig , context ) : undefined , AliasAttributes : output . AliasAttributes !== undefined && output . AliasAttributes !== null ? deserializeAws_json1_1AliasAttributesListType ( output . AliasAttributes , context ) : undefined , Arn : __expectString ( output . Arn ) , AutoVerifiedAttributes : output . AutoVerifiedAttributes !== undefined && output . AutoVerifiedAttributes !== null ? deserializeAws_json1_1VerifiedAttributesListType ( output . AutoVerifiedAttributes , context ) : undefined , CreationDate : output . CreationDate !== undefined && output . CreationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationDate ) ) ) : undefined , CustomDomain : __expectString ( output . CustomDomain ) , DeviceConfiguration : output . DeviceConfiguration !== undefined && output . DeviceConfiguration !== null ? deserializeAws_json1_1DeviceConfigurationType ( output . DeviceConfiguration , context ) : undefined , Domain : __expectString ( output . Domain ) , EmailConfiguration : output . EmailConfiguration !== undefined && output . EmailConfiguration !== null ? deserializeAws_json1_1EmailConfigurationType ( output . EmailConfiguration , context ) : undefined , EmailConfigurationFailure : __expectString ( output . EmailConfigurationFailure ) , EmailVerificationMessage : __expectString ( output . EmailVerificationMessage ) , EmailVerificationSubject : __expectString ( output . EmailVerificationSubject ) , EstimatedNumberOfUsers : __expectInt32 ( output . EstimatedNumberOfUsers ) , Id : __expectString ( output . Id ) , LambdaConfig : output . LambdaConfig !== undefined && output . LambdaConfig !== null ? deserializeAws_json1_1LambdaConfigType ( output . LambdaConfig , context ) : undefined , LastModifiedDate : output . LastModifiedDate !== undefined && output . LastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastModifiedDate ) ) ) : undefined , MfaConfiguration : __expectString ( output . MfaConfiguration ) , Name : __expectString ( output . Name ) , Policies : output . Policies !== undefined && output . Policies !== null ? deserializeAws_json1_1UserPoolPolicyType ( output . Policies , context ) : undefined , SchemaAttributes : output . SchemaAttributes !== undefined && output . SchemaAttributes !== null ? deserializeAws_json1_1SchemaAttributesListType ( output . SchemaAttributes , context ) : undefined , SmsAuthenticationMessage : __expectString ( output . SmsAuthenticationMessage ) , SmsConfiguration : output . SmsConfiguration !== undefined && output . SmsConfiguration !== null ? deserializeAws_json1_1SmsConfigurationType ( output . SmsConfiguration , context ) : undefined , SmsConfigurationFailure : __expectString ( output . SmsConfigurationFailure ) , SmsVerificationMessage : __expectString ( output . SmsVerificationMessage ) , Status : __expectString ( output . Status ) , UserPoolAddOns : output . UserPoolAddOns !== undefined && output . UserPoolAddOns !== null ? deserializeAws_json1_1UserPoolAddOnsType ( output . UserPoolAddOns , context ) : undefined , UserPoolTags : output . UserPoolTags !== undefined && output . UserPoolTags !== null ? deserializeAws_json1_1UserPoolTagsType ( output . UserPoolTags , context ) : undefined , UsernameAttributes : output . UsernameAttributes !== undefined && output . UsernameAttributes !== null ? deserializeAws_json1_1UsernameAttributesListType ( output . UsernameAttributes , context ) : undefined , UsernameConfiguration : output . UsernameConfiguration !== undefined && output . UsernameConfiguration !== null ? deserializeAws_json1_1UsernameConfigurationType ( output . UsernameConfiguration , context ) : undefined , VerificationMessageTemplate : output . VerificationMessageTemplate !== undefined && output . VerificationMessageTemplate !== null ? deserializeAws_json1_1VerificationMessageTemplateType ( output . VerificationMessageTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UsersListType = ( output , context ) : UserType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1UserType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1UserType = ( output , context ) : UserType => { return { Attributes : output . Attributes !== undefined && output . Attributes !== null ? deserializeAws_json1_1AttributeListType ( output . Attributes , context ) : undefined , Enabled : __expectBoolean ( output . Enabled ) , MFAOptions : output . MFAOptions !== undefined && output . MFAOptions !== null ? deserializeAws_json1_1MFAOptionListType ( output . MFAOptions , context ) : undefined , UserCreateDate : output . UserCreateDate !== undefined && output . UserCreateDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . UserCreateDate ) ) ) : undefined , UserLastModifiedDate : output . UserLastModifiedDate !== undefined && output . UserLastModifiedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . UserLastModifiedDate ) ) ) : undefined , UserStatus : __expectString ( output . UserStatus ) , Username : __expectString ( output . Username ) , } as any ; } ; const deserializeAws_json1_1VerificationMessageTemplateType = ( output , context ) : VerificationMessageTemplateType => { return { DefaultEmailOption : __expectString ( output . DefaultEmailOption ) , EmailMessage : __expectString ( output . EmailMessage ) , EmailMessageByLink : __expectString ( output . EmailMessageByLink ) , EmailSubject : __expectString ( output . EmailSubject ) , EmailSubjectByLink : __expectString ( output . EmailSubjectByLink ) , SmsMessage : __expectString ( output . SmsMessage ) , } as any ; } ; const deserializeAws_json1_1VerifiedAttributesListType = ( output , context ) : ( VerifiedAttributeType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1VerifySoftwareTokenResponse = ( output , context ) : VerifySoftwareTokenResponse => { return { Session : __expectString ( output . Session ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1VerifyUserAttributeResponse = ( output , context ) : VerifyUserAttributeResponse => { return { } 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 "" ; } ;